summaryrefslogtreecommitdiff
path: root/config.mk
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-10-07 13:53:49 +0000
committerWolfgang Denk <wd@denx.de>2011-10-17 23:56:59 +0200
commit47508843061b8dd9455ec86df00d56b462f2a5c9 (patch)
tree58ce11c4c387062919137a2f8c7f2ba18ce3f14a /config.mk
parent925493582cc6e0760df813a9897464c77d5c7b25 (diff)
Adjust dependency rules to permit per-file flags
The dependency rules are currently done in a shell 'for' loop. This does not permit Makefile variables to adjust preprocessor flags as is done with normal compile flags, using the CFLAGS_path/file.o syntax. This change moves the dependency generation into the Makefile itself, and permits a CPPFLAGS_path/file.o to adjust preprocessor flags on a file or directory basis. The CPPFLAGS_... variable is also folded into CFLAGS during the build. Signed-off-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'config.mk')
-rw-r--r--config.mk7
1 files changed, 7 insertions, 0 deletions
diff --git a/config.mk b/config.mk
index e2b440d8b2d..3fa9eefce0c 100644
--- a/config.mk
+++ b/config.mk
@@ -277,6 +277,13 @@ export CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS
BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
+EXTRA_CPPFLAGS = $(CPPFLAGS_$(BCURDIR)/$(@F)) $(CPPFLAGS_$(BCURDIR))
+ALL_CFLAGS += $(EXTRA_CPPFLAGS)
+
+# The _DEP version uses the $< file target (for dependency generation)
+# See rules.mk
+EXTRA_CPPFLAGS_DEP = $(CPPFLAGS_$(BCURDIR)/$(addsuffix .o,$(basename $<))) \
+ $(CPPFLAGS_$(BCURDIR))
$(obj)%.s: %.S
$(CPP) $(ALL_AFLAGS) -o $@ $<
$(obj)%.o: %.S