Commit f2e1d57e authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

Build: exclude -c flag from TF_CFLAGS



The -c flag should not be included in the global variable TF_CFLAGS;
it should be specified in the build rule only when its target is a
*.o file.
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent cef7b3ce
...@@ -149,7 +149,7 @@ ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \ ...@@ -149,7 +149,7 @@ ASFLAGS += -nostdinc -ffreestanding -Wa,--fatal-warnings \
${DEFINES} ${INCLUDES} ${DEFINES} ${INCLUDES}
TF_CFLAGS += -nostdinc -ffreestanding -Wall \ TF_CFLAGS += -nostdinc -ffreestanding -Wall \
-Werror -Wmissing-include-dirs \ -Werror -Wmissing-include-dirs \
-std=c99 -c -Os \ -std=c99 -Os \
$(TF_CFLAGS_$(ARCH)) \ $(TF_CFLAGS_$(ARCH)) \
${DEFINES} ${INCLUDES} ${DEFINES} ${INCLUDES}
TF_CFLAGS += -ffunction-sections -fdata-sections TF_CFLAGS += -ffunction-sections -fdata-sections
......
...@@ -358,7 +358,7 @@ ifdef MAKE_BUILD_STRINGS ...@@ -358,7 +358,7 @@ ifdef MAKE_BUILD_STRINGS
else else
@echo 'const char build_message[] = "Built : "$(BUILD_MESSAGE_TIMESTAMP); \ @echo 'const char build_message[] = "Built : "$(BUILD_MESSAGE_TIMESTAMP); \
const char version_string[] = "${VERSION_STRING}";' | \ const char version_string[] = "${VERSION_STRING}";' | \
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc - -o $(BUILD_DIR)/build_message.o $$(CC) $$(TF_CFLAGS) $$(CFLAGS) -xc -c - -o $(BUILD_DIR)/build_message.o
endif endif
$$(Q)$$(LD) -o $$@ $$(LDFLAGS) -Map=$(MAPFILE) --script $(LINKERFILE) \ $$(Q)$$(LD) -o $$@ $$(LDFLAGS) -Map=$(MAPFILE) --script $(LINKERFILE) \
$(BUILD_DIR)/build_message.o $(OBJS) $(BUILD_DIR)/build_message.o $(OBJS)
......
...@@ -104,6 +104,6 @@ BUILT_TIME_DATE_STRING = const char build_message[] = "Built : "${BUILD_MESSAGE_ ...@@ -104,6 +104,6 @@ BUILT_TIME_DATE_STRING = const char build_message[] = "Built : "${BUILD_MESSAGE_
VERSION_STRING_MESSAGE = const char version_string[] = "${VERSION_STRING}"; VERSION_STRING_MESSAGE = const char version_string[] = "${VERSION_STRING}";
define MAKE_BUILD_STRINGS define MAKE_BUILD_STRINGS
@echo $$(BUILT_TIME_DATE_STRING) $$(VERSION_STRING_MESSAGE) | \ @echo $$(BUILT_TIME_DATE_STRING) $$(VERSION_STRING_MESSAGE) | \
$$(CC) $$(TF_CFLAGS) $$(CFLAGS) -x c - -o $1 $$(CC) $$(TF_CFLAGS) $$(CFLAGS) -x c -c - -o $1
endef endef
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment