105 lines
4.0 KiB
Plaintext
105 lines
4.0 KiB
Plaintext
$OpenBSD: patch-Makefile,v 1.19 2012/08/22 20:14:06 naddy Exp $
|
|
--- Makefile.orig Sun Jun 24 16:34:26 2012
|
|
+++ Makefile Mon Aug 20 17:01:25 2012
|
|
@@ -6,15 +6,8 @@ LIBDIR:=${PREFIX}/lib
|
|
INCDIR:=${PREFIX}/include
|
|
MANDIR:=${PREFIX}/share/man
|
|
DYNLINK:=0
|
|
+CFLAGS+=-std=c99 -fgnu89-inline
|
|
|
|
-# Respect environment variables set by user; does not work with :=
|
|
-ifeq (${CFLAGS},)
|
|
- CFLAGS=-O2 -DNDEBUG
|
|
-endif
|
|
-ifeq (${CC},cc)
|
|
- CC=c99
|
|
-endif
|
|
-
|
|
PIANOBAR_DIR=src
|
|
PIANOBAR_SRC=\
|
|
${PIANOBAR_DIR}/main.c \
|
|
@@ -88,49 +81,40 @@ LIBJSONC_LDFLAGS=$(shell pkg-config --libs json)
|
|
|
|
# build pianobar
|
|
ifeq (${DYNLINK},1)
|
|
-pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} libpiano.so.0
|
|
- @echo " LINK $@"
|
|
- @${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \
|
|
+pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} libpiano.so.${LIBpiano_VERSION}
|
|
+ ${CC} -o $@ ${PIANOBAR_OBJ} ${LDFLAGS} -lao -lpthread -lm -L. -lpiano \
|
|
${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS}
|
|
else
|
|
pianobar: ${PIANOBAR_OBJ} ${PIANOBAR_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} \
|
|
${LIBWAITRESS_HDR}
|
|
- @echo " LINK $@"
|
|
- @${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
|
|
+ ${CC} ${CFLAGS} ${LDFLAGS} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} \
|
|
${LIBWAITRESS_OBJ} -lao -lpthread -lm \
|
|
${LIBFAAD_LDFLAGS} ${LIBMAD_LDFLAGS} ${LIBGNUTLS_LDFLAGS} \
|
|
${LIBGCRYPT_LDFLAGS} ${LIBJSONC_LDFLAGS} -o $@
|
|
endif
|
|
|
|
# build shared and static libpiano
|
|
-libpiano.so.0: ${LIBPIANO_RELOBJ} ${LIBPIANO_HDR} ${LIBWAITRESS_RELOBJ} \
|
|
+libpiano.so.${LIBpiano_VERSION}: ${LIBPIANO_RELOBJ} ${LIBPIANO_HDR} ${LIBWAITRESS_RELOBJ} \
|
|
${LIBWAITRESS_HDR} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ}
|
|
- @echo " LINK $@"
|
|
- @${CC} -shared -Wl,-soname,libpiano.so.0 ${CFLAGS} ${LDFLAGS} \
|
|
- -o libpiano.so.0.0.0 ${LIBPIANO_RELOBJ} \
|
|
+ ${CC} -shared ${CFLAGS} ${LDFLAGS} \
|
|
+ -o libpiano.so.${LIBpiano_VERSION} ${LIBPIANO_RELOBJ} \
|
|
${LIBWAITRESS_RELOBJ} ${LIBGNUTLS_LDFLAGS} ${LIBGCRYPT_LDFLAGS} \
|
|
${LIBJSONC_LDFLAGS}
|
|
- @ln -s libpiano.so.0.0.0 libpiano.so.0
|
|
- @ln -s libpiano.so.0 libpiano.so
|
|
- @echo " AR libpiano.a"
|
|
- @${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ}
|
|
+ ${AR} rcs libpiano.a ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ}
|
|
|
|
%.o: %.c
|
|
- @echo " CC $<"
|
|
- @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
|
|
+ ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
|
|
${LIBFAAD_CFLAGS} ${LIBMAD_CFLAGS} ${LIBGNUTLS_CFLAGS} \
|
|
${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} -c -o $@ $<
|
|
|
|
# create position independent code (for shared libraries)
|
|
%.lo: %.c
|
|
- @echo " CC $< (PIC)"
|
|
- @${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
|
|
- ${LIBJSONC_CFLAGS} \
|
|
+ ${CC} ${CFLAGS} -I ${LIBPIANO_INCLUDE} -I ${LIBWAITRESS_INCLUDE} \
|
|
+ ${LIBGCRYPT_CFLAGS} ${LIBJSONC_CFLAGS} \
|
|
-c -fPIC -o $@ $<
|
|
|
|
clean:
|
|
- @echo " CLEAN"
|
|
- @${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
|
|
+ ${RM} ${PIANOBAR_OBJ} ${LIBPIANO_OBJ} ${LIBWAITRESS_OBJ} ${LIBWAITRESS_OBJ}/test.o \
|
|
${LIBPIANO_RELOBJ} ${LIBWAITRESS_RELOBJ} pianobar libpiano.so* \
|
|
libpiano.a waitress-test
|
|
|
|
@@ -177,17 +161,15 @@ else
|
|
install: pianobar
|
|
endif
|
|
install -d ${DESTDIR}/${BINDIR}/
|
|
- install -m755 pianobar ${DESTDIR}/${BINDIR}/
|
|
+ ${INSTALL_PROGRAM} pianobar ${DESTDIR}/${BINDIR}/
|
|
install -d ${DESTDIR}/${MANDIR}/man1/
|
|
- install -m644 contrib/pianobar.1 ${DESTDIR}/${MANDIR}/man1/
|
|
+ ${INSTALL_MAN} contrib/pianobar.1 ${DESTDIR}/${MANDIR}/man1/
|
|
|
|
install-libpiano:
|
|
install -d ${DESTDIR}/${LIBDIR}/
|
|
- install -m644 libpiano.so.0.0.0 ${DESTDIR}/${LIBDIR}/
|
|
- ln -s libpiano.so.0.0.0 ${DESTDIR}/${LIBDIR}/libpiano.so.0
|
|
- ln -s libpiano.so.0 ${DESTDIR}/${LIBDIR}/libpiano.so
|
|
- install -m644 libpiano.a ${DESTDIR}/${LIBDIR}/
|
|
+ ${INSTALL_DATA} libpiano.so.${LIBpiano_VERSION} ${DESTDIR}/${LIBDIR}/
|
|
+ ${INSTALL_DATA} libpiano.a ${DESTDIR}/${LIBDIR}/
|
|
install -d ${DESTDIR}/${INCDIR}/
|
|
- install -m644 src/libpiano/piano.h ${DESTDIR}/${INCDIR}/
|
|
+ ${INSTALL_DATA} src/libpiano/piano.h ${DESTDIR}/${INCDIR}/
|
|
|
|
.PHONY: install install-libpiano test debug all
|