changeset 181:5350ce9f446f

Arranged for dependencies to be generated when building object files; no more extraneous dependency rebuilds
author lost@l-w.ca
date Sat, 17 Sep 2011 11:45:13 -0600
parents 11b710d231bd
children e0cc66fd0551
files Makefile
diffstat 1 files changed, 6 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Sat Sep 17 09:57:55 2011 -0600
+++ b/Makefile	Sat Sep 17 11:45:13 2011 -0600
@@ -79,14 +79,6 @@
 	@$(AR) rc $@ $(lwlib_objs)
 	@$(RANLIB) $@
 
-%.d: %.c
-	@echo "Building dependencies for $@"
-	@$(CC) -MM $(CPPFLAGS) -o $*.d $<
-	@mv -f $*.d $*.d.tmp
-	@sed -e 's|.*:|$*.o $*.d:|' < $*.d.tmp > $*.d
-	@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
-	@rm -f $*.d.tmp
-
 alldeps := $(lwasm_deps) $(lwlink_deps) $(lwar_deps) $(lwlib_deps) ($lwobjdump_deps)
 
 -include $(alldeps)
@@ -94,6 +86,12 @@
 extra_clean := $(extra_clean) *~ */*~
 
 %.o: %.c
+	@echo "Building dependencies for $@"
+	@$(CC) -MM $(CPPFLAGS) -o $*.d $<
+	@mv -f $*.d $*.d.tmp
+	@sed -e 's|.*:|$*.o $*.d:|' < $*.d.tmp > $*.d
+	@sed -e 's/.*://' -e 's/\\$$//' < $*.d.tmp | fmt -1 | sed -e 's/^ *//' -e 's/$$/:/' >> $*.d
+	@rm -f $*.d.tmp
 	@echo Building $@
 	@$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<