Browse Source

Use mkconfig.pl to generate fragments from config.h

Don't use -MP to generate phony rules for included files, otherwise
make won't use the pattern rule for config/%.h.  :(
tags/v0.9.3
Michael Brown 19 years ago
parent
commit
b79895c9d6
1 changed files with 6 additions and 2 deletions
  1. 6
    2
      src/Makefile.housekeeping

+ 6
- 2
src/Makefile.housekeeping View File

@@ -50,6 +50,11 @@ oldgas :
50 50
 #
51 51
 CFLAGS	+= -include compiler.h
52 52
 
53
+# config/%.h files are generated from config.h using mkconfig.pl
54
+config/%.h : config.h
55
+	$(MKCONFIG) $<
56
+CLEANUP	+= config/*.h
57
+
53 58
 # SRCDIRS lists all directories containing source files.
54 59
 srcdirs :
55 60
 	@echo $(SRCDIRS)
@@ -104,8 +109,7 @@ endef
104 109
 define obj_template
105 110
 
106 111
 	@$(CPP) $(CFLAGS) $(CFLAGS_$(3)) $(CFLAGS_$(4)) \
107
-		-M $(1) -MT "$(4)_DEPS" -MG -MP | \
108
-		sed 's/$(4)_DEPS[[:space:]]*:/$(4)_DEPS =/' >> $(2)
112
+		-M $(1) -MT "$(4)_DEPS" -MG | tr : = >> $(2)
109 113
 	@echo -e '\n$$(BIN)/$(4).o : $(1) $$(MAKEDEPS) $$($(4)_DEPS)' \
110 114
 		 '\n\t$$(RULE_$(3))\n' \
111 115
 		 '\nBOBJS += $$(BIN)/$(4).o\n' \

Loading…
Cancel
Save