diff options
Diffstat (limited to 'Make.rules')
-rw-r--r-- | Make.rules | 32 |
1 files changed, 26 insertions, 6 deletions
@@ -69,7 +69,9 @@ CROSS_COMPILE ?= CC := $(CROSS_COMPILE)gcc AR := $(CROSS_COMPILE)ar LD := $(CROSS_COMPILE)ld +LN := ln -sf SCDOC := scdoc +SED := sed INSTALL := install INSTALLDIR := $(INSTALL) -d @@ -80,7 +82,7 @@ CFLAGS_ALL += $(CFLAGS) LDFLAGS ?= -g LDFLAGS_ALL += $(LDFLAGS) -export CC AR LD SCDOC INSTALL INSTALLDIR CFLAGS_ALL LDFLAGS_ALL +export CC AR LD LN SCDOC SED INSTALL INSTALLDIR CFLAGS_ALL LDFLAGS_ALL build := @@ -94,8 +96,8 @@ endif ifneq ($(origin targets),file) targets := endif -ifneq ($(origin docs),file) -docs := +ifneq ($(origin nontargets),file) +nontargets := endif src := @@ -274,11 +276,29 @@ quiet_cmd_scdoc = SCDOC $@ cmd_scdoc = $(SCDOC) < $< > $@ __scdocs := $(addprefix $(obj)/,$(sort $(scdocs-y))) +nontargets += $(__scdocs) docs += $(__scdocs) $(__scdocs): $(obj)/%: $(src)/%.scd FORCE $(call if_changed,scdoc) +#### +# Template (.in) files + +quiet_cmd_sed = SED $@ + cmd_sed = $(SED) \ + -e "s|@EXEC_DIR@|$(SBINDIR)|" \ + -e "s|@LIB_DIR@|$(LIBDIR)|" \ + -e "s|@INCLUDE_DIR@|$(INCLUDEDIR)|" \ + -e "s|@VERSION@|$(VERSION)|" \ + $< > $@ + +$(obj)/%: $(src)/%.in FORCE + $(call if_changed,sed) + + +nontargets += $(addprefix $(obj)/,$(sort $(generate-y))) + ### # why - tell why a a target got build ifeq ($(VERBOSE),2) @@ -288,9 +308,9 @@ why = \ $(if $(strip $(any-prereq)),- due to: $(any-prereq), \ $(if $(arg-check), \ $(if $(cmd_$@),- due to command line change: $(arg-check), \ - $(if $(filter $@, $(targets) $(docs)), \ + $(if $(filter $@, $(targets) $(nontargets)), \ - due to missing .cmd file, \ - - due to $(notdir $@) not in $$(targets) or $$(docs) \ + - due to $(notdir $@) not in $$(targets) or $$(nontargets) \ ) \ ) \ ) \ @@ -351,7 +371,7 @@ FORCE: targets := $(wildcard $(sort $(targets))) docs := $(wildcard $(sort $(docs))) -cmd_files := $(wildcard $(foreach f,$(targets) $(docs),$(dir $(f)).$(notdir $(f)).cmd)) +cmd_files := $(wildcard $(foreach f,$(targets) $(nontargets),$(dir $(f)).$(notdir $(f)).cmd)) ifneq ($(cmd_files),) include $(cmd_files) |