From 07d48880d55cb0ee39fa23085e4d8523e62a1fa8 Mon Sep 17 00:00:00 2001 From: Antti-Juhani Kaijanaho Date: Mon, 2 Jul 2012 19:06:23 +0300 Subject: GNUmakefile: Use gcc's -MD feature instead of calling gcc -M separately Signed-off-by: Antti-Juhani Kaijanaho --- GNUmakefile | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/GNUmakefile b/GNUmakefile index 0de0533..2723e8f 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -133,13 +133,7 @@ join-dctrl/join-dctrl : join-dctrl/join-dctrl.o libdctrl.a $(CC) $(LDFLAGS) -o $@ $^ $(LDLIBS) %.o : %.c - $(CC) $(ALL_CFLAGS) -c -o $@ $< - -%.d: %.c - $(CC) -M $(ALL_CFLAGS) $< > $@.$$$$; \ - sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \ - rm -f $@.$$$$ - + $(CC) $(ALL_CFLAGS) -MD -MF $*.d -c -o $@ $< libdctrl.a : $(libobj) ar cr $@ $^ @@ -214,9 +208,5 @@ maintainer-clean : distclean tags : etags *.[hc] -ifeq ($(MAKECMDGOALS),clean) -else ifeq ($(MAKECMDGOALS),distclean) -else ifeq ($(MAKECMDGOALS),maintainer-clean) -else -include $(obj:.o=.d) -endif +-include $(obj:.o=.d) + -- cgit v1.2.3