From bee5745ccc20be6dbba243b1f8af0d5c522923e8 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Guido=20Mart=C3=ADnez?= Date: Fri, 21 Nov 2014 13:19:00 -0300 Subject: [PATCH] Makefile: don't depend on the umask MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Some packages and BR itself create files and directories on the target with cp/mkdir/etc which depend on the umask at the time of building. To fix this, use a trick inside the Makefile which wraps all rules when the umask is not 0022. This sets the umask at the top level, and then the building process continues as usual. [Thomas: add --no-print-directory, as suggested by Arnout.] Signed-off-by: Guido Martínez Acked-by: Arnout Vandecappelle (Essensium/Mind) Tested-by: Arnout Vandecappelle (Essensium/Mind) Signed-off-by: Thomas Petazzoni --- Makefile | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Makefile b/Makefile index daf692e591..55b1d45786 100644 --- a/Makefile +++ b/Makefile @@ -24,6 +24,19 @@ # You shouldn't need to mess with anything beyond this point... #-------------------------------------------------------------- +# Trick for always running with a fixed umask +UMASK=0022 +ifneq ($(shell umask),$(UMASK)) +.PHONY: all $(MAKECMDGOALS) + +all: + @umask $(UMASK) && $(MAKE) --no-print-directory + +$(MAKECMDGOALS): + @umask $(UMASK) && $(MAKE) --no-print-directory $@ + +else # umask + # This is our default rule, so must come first all: @@ -937,3 +950,5 @@ include docs/manual/manual.mk -include $(BR2_EXTERNAL)/docs/*/*.mk .PHONY: $(noconfig_targets) + +endif #umask -- 2.30.2