summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2011-04-12 20:14:03 +0200
committerLars-Dominik Braun <lars@6xq.net>2011-04-12 20:18:00 +0200
commit859e5378cc68510374d86bc242d216b3dc7ee773 (patch)
tree4572bb52775aeed7b2a809cb38c89a535e4a1430 /Makefile
parente9decbdfccc7bb9076282315007fa7364a097ece (diff)
downloadpianobar-windows-859e5378cc68510374d86bc242d216b3dc7ee773.tar.gz
pianobar-windows-859e5378cc68510374d86bc242d216b3dc7ee773.tar.bz2
pianobar-windows-859e5378cc68510374d86bc242d216b3dc7ee773.zip
Added LDFLAGS to Makefile and simplified LIB*_LDFLAGS
See issue #103.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile28
1 files changed, 9 insertions, 19 deletions
diff --git a/Makefile b/Makefile
index 7d50ee7..ab29ced 100644
--- a/Makefile
+++ b/Makefile
@@ -5,6 +5,7 @@ BINDIR:=${PREFIX}/bin
LIBDIR:=${PREFIX}/lib
MANDIR:=${PREFIX}/share/man
CFLAGS:=-O2 -DNDEBUG
+LDFLAGS:=
CC:=c99
PIANOBAR_DIR=src
@@ -61,49 +62,38 @@ LIBEZXML_OBJ=${LIBEZXML_SRC:.c=.o}
LIBEZXML_RELOBJ=${LIBEZXML_SRC:.c=.lo}
LIBEZXML_INCLUDE=${LIBEZXML_DIR}
-LIBAO_INCLUDE=/usr/include
-LIBAO_LIB=-lao
-
-LIBM_LIB=-lm
-
ifeq (${DISABLE_FAAD}, 1)
LIBFAAD_CFLAGS=
LIBFAAD_LDFLAGS=
else
- LIBFAAD_INCLUDE:=/usr/include
- LIBFAAD_LIB:=-lfaad
- LIBFAAD_CFLAGS=-I ${LIBFAAD_INCLUDE} -DENABLE_FAAD
- LIBFAAD_LDFLAGS=${LIBFAAD_LIB}
+ LIBFAAD_CFLAGS=-DENABLE_FAAD
+ LIBFAAD_LDFLAGS=-lfaad
endif
ifeq (${DISABLE_MAD}, 1)
LIBMAD_CFLAGS=
LIBMAD_LDFLAGS=
else
- LIBMAD_INCLUDE:=/usr/include
- LIBMAD_LIB:=-lmad
- LIBMAD_CFLAGS=-I ${LIBMAD_INCLUDE} -DENABLE_MAD
- LIBMAD_LDFLAGS=${LIBMAD_LIB}
+ LIBMAD_CFLAGS=-DENABLE_MAD
+ LIBMAD_LDFLAGS=-lmad
endif
-PTHREAD_LIB=-lpthread
-
# build pianobar
pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} \
${LIBWAITRESS_HDR} ${LIBEZXML_OBJ} ${LIBEZXML_HDR}
- ${CC} ${CFLAGS} ${LIBAO_LIB} ${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} \
- ${PTHREAD_LIB} ${LIBM_LIB} -o $@ ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
+ ${CC} ${CFLAGS} ${LDFLAGS} -lao -lpthread -lm ${LIBFAAD_LDFLAGS} \
+ ${LIBMAD_LDFLAGS} -o $@ ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
${LIBWAITRESS_OBJ} ${LIBEZXML_OBJ}
# build shared libpiano
libpiano: ${LIBPIANO_RELOBJ} ${LIBPIANO_HDR} ${LIBWAITRESS_RELOBJ} \
${LIBWAITRESS_HDR} ${LIBEZXML_RELOBJ} ${LIBEZXML_HDR}
- ${CC} -shared ${CFLAGS} -o $@.so.0.0.0 ${LIBPIANO_RELOBJ} \
+ ${CC} -shared ${CFLAGS} ${LDFLAGS} -o $@.so.0.0.0 ${LIBPIANO_RELOBJ} \
${LIBWAITRESS_RELOBJ} ${LIBEZXML_RELOBJ}
%.o: %.c
${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
- -I ${LIBEZXML_INCLUDE} -I ${LIBAO_INCLUDE} ${LIBFAAD_CFLAGS} \
+ -I ${LIBEZXML_INCLUDE} ${LIBFAAD_CFLAGS} \
${LIBMAD_CFLAGS} -c -o $@ $<
# create position independent code (for shared libraries)