aboutsummaryrefslogtreecommitdiffstats
path: root/xen/Rules.mk
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2011-03-18 16:31:11 +0000
committerJan Beulich <jbeulich@novell.com>2011-03-18 16:31:11 +0000
commitdf7204aff805d633ace83add39607f8d06e7b342 (patch)
tree7ace28f96db087fd16462b981c3de261e792165c /xen/Rules.mk
parentc94112e5887eabda23723d5beecd2bb4d17006a7 (diff)
downloadxen-df7204aff805d633ace83add39607f8d06e7b342.tar.gz
xen-df7204aff805d633ace83add39607f8d06e7b342.tar.bz2
xen-df7204aff805d633ace83add39607f8d06e7b342.zip
Rules.mk: adjustments to the .o -> .init.o build rule
First, $(shell ...) getting executed before the containing command gets invoked doesn't have the intended effect when the inner command wants variables of the outer command expanded. This needs to be done by the shell executing the entire command. Second, pattern rules for intermediate files with their targets not mentioned explicitly result in them getting deleted. Since the .*.o.d files get generated on the first make run and included for the second, the second run sees them mentioned explicitly and re-builds them (and the final *.init.o files), which is particularly annoying if the second build is actually an install (as root) while normal builds get run as ordinary user: Some of the output files will suddenly be root owned, possibly causing permission issues on a later rebuild. Signed-off-by: Jan Beulich <jbeulich@novell.com> Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'xen/Rules.mk')
-rw-r--r--xen/Rules.mk4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/Rules.mk b/xen/Rules.mk
index c7fe2510fb..e9d9c89850 100644
--- a/xen/Rules.mk
+++ b/xen/Rules.mk
@@ -156,13 +156,13 @@ _clean_%/: FORCE
SPECIAL_DATA_SECTIONS := rodata $(foreach n,1 2 4 8,rodata.str1.$(n)) \
$(foreach r,rel rel.ro,data.$(r) data.$(r).local)
-%.init.o: %.o Makefile
+$(filter %.init.o,$(obj-y) $(obj-bin-y)): %.init.o: %.o Makefile
$(OBJDUMP) -h $< | sed -n '/[0-9]/{s,00*,0,g;p}' | while read idx name sz rest; do \
case "$$name" in \
.text|.text.*|.data|.data.*|.bss) \
test $$sz != 0 || continue; \
echo "Error: size of $<:$$name is 0x$$sz" >&2; \
- exit $(shell expr $$idx + 1);; \
+ exit $$(expr $$idx + 1);; \
esac; \
done
$(OBJCOPY) $(foreach s,$(SPECIAL_DATA_SECTIONS),--rename-section .$(s)=.init.$(s)) $< $@