summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index df2cd128101..4d0d53d7480 100644
--- a/Makefile
+++ b/Makefile
@@ -368,6 +368,16 @@ endif
all: $(ALL)
+# awk script for extract part of CFLAGS we want to export
+AWK_SRC = BEGIN { print "CFLAGS =" } \
+ !/^-[DI]/ { printf " %s", $$1 } \
+ END { print "\n" }
+
+$(obj)u-boot-cflags.mk:
+ echo "CC = $(CC)" > $@ ; \
+ echo $(CFLAGS) | \
+ awk -v RS='[ \t\n]+' -v ORS='' -- '$(AWK_SRC)' >> $@
+
$(obj)u-boot.hex: $(obj)u-boot
$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@