[hackers] [farbfeld] don't link against unneeded libs || Hiltjo Posthuma
commit 7f295f8c100a504c305d537bd3fde6492f15ef7a
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
AuthorDate: Thu Mar 24 19:09:41 2016 +0100
Commit: FRIGN <dev_AT_frign.de>
CommitDate: Sun Apr 3 20:39:13 2016 +0200
don't link against unneeded libs
- jpg2ff requires libjpeg
- ff2png, png2ff requires libpng (and libz)
- ff2ppm has no dependencies
diff --git a/Makefile b/Makefile
index 63b4d0a..ac85a0f 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -8,11 +8,21 @@ HDR = arg.h
MAN1 = 2ff.1 ${BIN:=.1}
MAN5 = farbfeld.5
-all: png2ff ff2png jpg2ff ff2ppm
+all: ${BIN}
+
+png2ff ff2png:
+ _AT_echo CC $@
+ _AT_${CC} -o $@ ${CFLAGS} ${CPPFLAGS} -L${PNGLIB} -lpng -I${PNGINC} \
+ ${LDFLAGS} $_AT_.c
+
+jpg2ff:
+ _AT_echo CC $@
+ _AT_${CC} -o $@ ${CFLAGS} ${CPPFLAGS} -L${JPGLIB} -ljpeg -I${JPGINC} \
+ ${LDFLAGS} $_AT_.c
.c:
- _AT_echo CC $<
- _AT_${CC} -o $@ ${CFLAGS} ${LIBS} ${LDFLAGS} $<
+ _AT_echo CC $@
+ _AT_${CC} -o $@ ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} $<
clean:
_AT_echo cleaning
diff --git a/config.mk b/config.mk
index 94a4570..4ecba54 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -13,12 +13,12 @@ PNGINC = /usr/local/include
JPGLIB = /usr/local/lib
JPGINC = /usr/local/include
-INCS = -I${PNGINC} -I${JPGINC}
-LIBS = -L${PNGLIB} -L${JPGLIB} -lpng -ljpeg
+INCS =
+LIBS =
# flags
CPPFLAGS = -D_DEFAULT_SOURCE
-CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS} ${CPPFLAGS}
+CFLAGS = -std=c99 -pedantic -Wall -Os ${INCS}
LDFLAGS = -s ${LIBS}
# compiler and linker
Received on Sun Apr 03 2016 - 20:39:55 CEST
This archive was generated by hypermail 2.3.0
: Sun Apr 03 2016 - 20:48:17 CEST