diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2016-05-17 23:02:25 +0200 |
---|---|---|
committer | FRIGN <dev@frign.de> | 2016-05-18 10:34:05 +0200 |
commit | c494437937ee01c6d3eb5b630a15e207aae76c25 (patch) | |
tree | 1cc20abba300350b3b8add22be703f9b507b792b /Makefile | |
parent | 3d0f4c70385c8ad1dbaad1bb266e644c7109aa6a (diff) |
Makefile improvements
- fix: rebuild on source change.
- allow to override dependency flag per tool (the ones that have deps).
- rebuild on config.mk or headers change.
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 17 |
1 files changed, 10 insertions, 7 deletions
@@ -11,17 +11,20 @@ MAN5 = farbfeld.5 all: ${BIN} -png2ff ff2png: - ${CC} -o $@ ${CFLAGS} ${CPPFLAGS} -L${PNGLIB} -lpng -I${PNGINC} ${LDFLAGS} $@.c +${BIN}: ${@:=.o} -jpg2ff ff2jpg: - ${CC} -o $@ ${CFLAGS} ${CPPFLAGS} -L${JPGLIB} -ljpeg -I${JPGINC} ${LDFLAGS} $@.c +OBJ = ${SRC:.c=.o} -.c: - ${CC} -o $@ ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} $< +${OBJ}: config.mk ${HDR} + +.o: + ${CC} ${CFLAGS} ${$*-LDFLAGS} -o $@ $< + +.c.o: + ${CC} ${CFLAGS} ${$*-CFLAGS} ${CPPFLAGS} -c $< clean: - rm -f ${BIN} + rm -f ${BIN} ${OBJ} dist: rm -rf "farbfeld-${VERSION}" |