Build: use CPP just for pre-processing
authorMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 22 Dec 2016 03:51:53 +0000 (12:51 +0900)
committerMasahiro Yamada <yamada.masahiro@socionext.com>
Thu, 5 Jan 2017 02:35:59 +0000 (11:35 +0900)
Using AS for pre-processing looks a bit weird, and some assembly
specific options are given for nothing.  Rather, use CPP.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
Makefile
make_helpers/build_macros.mk

index bb46afcb40791a69781b04ef664c52bf86561129..adfdba6c2aa65782020306294803d1f10b0b0340 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -143,16 +143,14 @@ TF_CFLAGS_aarch64 =       -mgeneral-regs-only -mstrict-align
 ASFLAGS_aarch32                =       -march=armv8-a
 TF_CFLAGS_aarch32      =       -march=armv8-a
 
-ASFLAGS                        +=      -nostdinc -ffreestanding -Wa,--fatal-warnings   \
-                               -Werror -Wmissing-include-dirs                  \
-                               -D__ASSEMBLY__ $(ASFLAGS_$(ARCH))               \
-                               ${DEFINES} ${INCLUDES}
-TF_CFLAGS              +=      -nostdinc -ffreestanding -Wall                  \
-                               -Werror -Wmissing-include-dirs                  \
-                               -std=c99 -Os                                    \
-                               $(TF_CFLAGS_$(ARCH))                            \
-                               ${DEFINES} ${INCLUDES}
-TF_CFLAGS              +=      -ffunction-sections -fdata-sections
+CPPFLAGS               =       ${DEFINES} ${INCLUDES} -nostdinc                \
+                               -Wmissing-include-dirs -Werror
+ASFLAGS                        +=      $(CPPFLAGS) $(ASFLAGS_$(ARCH))                  \
+                               -D__ASSEMBLY__ -ffreestanding                   \
+                               -Wa,--fatal-warnings
+TF_CFLAGS              +=      $(CPPFLAGS) $(TF_CFLAGS_$(ARCH))                \
+                               -ffreestanding -Wall -std=c99 -Os               \
+                               -ffunction-sections -fdata-sections
 
 LDFLAGS                        +=      --fatal-warnings -O1
 LDFLAGS                        +=      --gc-sections
index 4ec060b64852ec3571dbd2378e12a685e063f401..dd8c2b5084b4841c4395e43c3491e2b2164a269e 100644 (file)
@@ -262,11 +262,11 @@ $(eval PREREQUISITES := $(1).d)
 
 $(1): $(2)
        @echo "  PP      $$<"
-       $$(Q)$$(AS) $$(ASFLAGS) -P -E -D__LINKER__ -o $$@ $$<
+       $$(Q)$$(CPP) $$(CPPFLAGS) -P -D__ASSEMBLY__ -D__LINKER__ -o $$@ $$<
 
 $(PREREQUISITES): $(2) | $(dir ${1})
        @echo "  DEPS    $$@"
-       $$(Q)$$(AS) $$(ASFLAGS) -M -MT $(1) -MF $$@ $$<
+       $$(Q)$$(CPP) $$(CPPFLAGS) -D__ASSEMBLY__ -M -MT $(1) -MF $$@ $$<
 
 ifdef IS_ANYTHING_TO_BUILD
 -include $(PREREQUISITES)