projects
/
dosdemo
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added dependency tracking to the GNU makefile
[dosdemo]
/
GNUmakefile
diff --git
a/GNUmakefile
b/GNUmakefile
index
e81d771
..
5e3fdeb
100644
(file)
--- a/
GNUmakefile
+++ b/
GNUmakefile
@@
-1,5
+1,6
@@
src = $(wildcard src/*.c) $(wildcard src/sdl/*.c)
obj = $(src:.c=.o)
src = $(wildcard src/*.c) $(wildcard src/sdl/*.c)
obj = $(src:.c=.o)
+dep = $(obj:.o=.d)
bin = demo
inc = -Isrc -Isrc/sdl -Ilibs/imago/src -Ilibs/mikmod/include
bin = demo
inc = -Isrc -Isrc/sdl -Ilibs/imago/src -Ilibs/mikmod/include
@@
-10,6
+11,11
@@
LDFLAGS = -Llibs/imago -Llibs/mikmod -limago -lmikmod `sdl-config --libs` -lm
$(bin): $(obj) imago mikmod
$(CC) -o $@ $(obj) $(LDFLAGS)
$(bin): $(obj) imago mikmod
$(CC) -o $@ $(obj) $(LDFLAGS)
+-include $(dep)
+
+%.d: %.c
+ @$(CPP) $(CFLAGS) $< -MM -MT $(@:.d=.o) >$@
+
.PHONY: imago
imago:
$(MAKE) -C libs/imago
.PHONY: imago
imago:
$(MAKE) -C libs/imago
@@
-21,3
+27,7
@@
mikmod:
.PHONY: clean
clean:
rm -f $(obj) $(bin)
.PHONY: clean
clean:
rm -f $(obj) $(bin)
+
+.PHONY: cleandep
+cleandep:
+ rm -f $(dep)