# Syntax: $(call BUILD_CONFIG_H_template,<header_file_path>,<list_of_options_to_export>,<header_barrier>)
define BUILD_CONFIG_H_template
-$(1) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default)
- @$(QUIET_CMD_ECHO) " CONFGEN $$(@:$(MAKERULES_DIR)/%=%)"
+$(notdir $(addsuffix .stamp,$(1))) : $(wildcard $(CONFIG_FILE)) $(wildcard $(CONFIG_FILE)-default)
+ @$(QUIET_CMD_ECHO) " CONFGEN $$(@:%.stamp=%)"
@if [ ! -d `dirname $(1).tmp` ] ; then \
mkdir `dirname $(1).tmp` ; fi
@echo "/* Automatically generated from */" > "$(1).tmp"
sed -n -e 's/^\([^.]*\)\.\(.*\)$$$$/#define \1 \2/p' \
>> "$(1).tmp"
@echo "#endif /*$(3)*/" >> "$(1).tmp"
- @if cmp --quiet "$(1).tmp" "$(1)" ; then rm "$(1).tmp"; touch "$(1)" ; \
+ @touch "$$@"
+ @if cmp --quiet "$(1).tmp" "$(1)" ; then rm "$(1).tmp"; \
else mv "$(1).tmp" "$(1)" ; \
- echo Updated configuration "$(1)" ; fi
+ echo "Updated configuration $(1)" ; fi
endef
_$(basename $(notdir $(confh)))_H \
)))
+config_h_stamp_files = $(notdir $(addsuffix .stamp,$(config_include_HEADERS) $(LOCAL_CONFIG_H)))
+
# Add some hooks to standard passes
-include-pass-local: $(addprefix $(USER_INCLUDE_DIR)/,$(config_include_HEADERS))
+include-pass-local: $(config_h_stamp_files)
clean-local: clean-local-config-h
clean-local-config-h:
- @$(foreach confh,$(addprefix $(USER_INCLUDE_DIR)/,$(config_include_HEADERS)),\
- if [ -e $(confh) ] ; then touch -t 200001010101 $(confh) ; fi ; \
+ @$(foreach confh,$(config_h_stamp_files),\
+ if [ -e $(confh) ] ; then rm $(confh) ; fi ; \
)
# Syntax: $(call COMPILE_c_o_template,<source>,<target>,<additional c-flags>)
define COMPILE_c_o_template
-$(2): $(1) $(LOCAL_CONFIG_H) $$(GEN_HEADERS)
+$(2): $(1) $$(GEN_HEADERS)
@$(QUIET_CMD_ECHO) " CC $$@"
$(Q) if $$(c_o_COMPILE) $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \
then mv -f "$$@.d.tmp" "$$@.d" ; \
# Syntax: $(call COMPILE_c_o_template,<source>,<target>,<additional c-flags>)
define COMPILE_c_o_template
-$(2): $(1) $(LOCAL_CONFIG_H) $$(GEN_HEADERS)
+$(2): $(1) $$(GEN_HEADERS)
@$(QUIET_CMD_ECHO) " CC $$@"
$(Q) if $$(c_o_COMPILE) $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \
then mv -f "$$@.d.tmp" "$$@.d" ; \
# Syntax: $(call COMPILE_cc_o_template,<source>,<target>,<additional c-flags>)
define COMPILE_cc_o_template
-$(2): $(1) $(LOCAL_CONFIG_H) $$(GEN_HEADERS)
+$(2): $(1) $$(GEN_HEADERS)
@$(QUIET_CMD_ECHO) " CXX $$@"
$(Q) if $$(cc_o_COMPILE) $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \
then mv -f "$$@.d.tmp" "$$@.d" ; \
# Syntax: $(call COMPILE_S_o_template,<source>,<target>,<additional c-flags>)
define COMPILE_S_o_template
-$(2): $(1) $(LOCAL_CONFIG_H) $$(GEN_HEADERS)
+$(2): $(1) $$(GEN_HEADERS)
@$(QUIET_CMD_ECHO) " AS $$@"
$(Q) if $$(S_o_COMPILE) -D__ASSEMBLY__ $$(CC_DEPFLAGS) $(3) -o $$@ -c $$< ; \
then if [ -e "$$@.d.tmp" ] ; then mv -f "$$@.d.tmp" "$$@.d" ; fi ; \
define COMPILE_c_o_kern_template
-$(2): $(1) $(LOCAL_CONFIG_H)
+$(2): $(1)
@$(QUIET_CMD_ECHO) " CC [K] $$@"
$(Q) if $$(c_o_kern_COMPILE) $$(kern_CC_DEPFLAGS) $(3) $(KERN_KBUILD_MODNAME) \
-D"KBUILD_BASENAME=$(KERN_MQ)$(notdir $(basename $(1)))$(KERN_MQ)" \