summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--common/Makefile28
1 files changed, 15 insertions, 13 deletions
diff --git a/common/Makefile b/common/Makefile
index 8cd0ab3001..5351ef0f77 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -63,27 +63,29 @@ obj-$(CONFIG_BAREBOX_UPDATE_IMX_NAND_FCB) += imx-bbu-nand-fcb.o
obj-$(CONFIG_CONSOLE_RATP) += ratp.o
obj-$(CONFIG_BOOT) += boot.o
-quiet_cmd_pwd_h = PWDH $@
ifdef CONFIG_PASSWORD
-ifneq ($(CONFIG_PASSWORD_DEFAULT),"")
-PASSWD_FILE := $(shell cd $(srctree); find $(CONFIG_PASSWORD_DEFAULT) -type f)
-cmd_pwd_h = echo -n "static const char default_passwd[] = \"" > $@; \
- cat $< | tr -d '\n' >> $@; \
- echo "\";" >> $@
-include/generated/passwd.h: $(PASSWD_FILE)
- $(call if_changed,pwd_h)
+ifeq ($(CONFIG_PASSWORD_DEFAULT),"")
+define filechk_passwd
+ echo "static const char default_passwd[] = \"\";"
+endef
else
-cmd_pwd_h = echo "static const char default_passwd[] = \"\";" > $@
-
-include/generated/passwd.h: FORCE
- $(call if_changed,pwd_h)
+define filechk_passwd
+( \
+echo -n "static const char default_passwd[] = \""; \
+cat $(shell find $(srctree) -name $(CONFIG_PASSWORD_DEFAULT) -type f) | tr -d '\n';\
+echo "\";" \
+)
+endef
endif
+include/generated/passwd.h: $(srctree)/$(src)/Makefile FORCE
+ $(call filechk,passwd)
+
targets += include/generated/passwd.h
$(obj)/password.o: include/generated/passwd.h
-endif
+endif # CONFIG_PASSWORD
# dependencies on generated files need to be listed explicitly
$(obj)/version.o: include/generated/compile.h