build: separate CPPFLAGS from CFLAGS
There are a couple of places where CPPFLAGS are pasted into CFLAGS, eliminate them. Change-Id: Ic7f568cf87a7d9c5c52e2942032a867161036bd7 Signed-off-by: Patrick Georgi <patrick@georgi-clan.de> Reviewed-on: http://review.coreboot.org/5765 Tested-by: build bot (Jenkins) Reviewed-by: Kyösti Mälkki <kyosti.malkki@gmail.com>
This commit is contained in:
parent
98f49d2823
commit
58f73a69cd
2
Makefile
2
Makefile
|
@ -242,7 +242,7 @@ ifn$(EMPTY)def $(1)-objs_$(2)_template
|
||||||
de$(EMPTY)fine $(1)-objs_$(2)_template
|
de$(EMPTY)fine $(1)-objs_$(2)_template
|
||||||
$(obj)/$$(1).$(1).o: src/$$(1).$(2) $(obj)/config.h $(4)
|
$(obj)/$$(1).$(1).o: src/$$(1).$(2) $(obj)/config.h $(4)
|
||||||
@printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
|
@printf " CC $$$$(subst $$$$(obj)/,,$$$$(@))\n"
|
||||||
$(CC_$(1)) $(3) -MMD $$$$(CFLAGS_$(1)) -c -o $$$$@ $$$$<
|
$(CC_$(1)) $(3) -MMD $$$$(CPPFLAGS_$(1)) $$$$(CFLAGS_$(1)) -c -o $$$$@ $$$$<
|
||||||
en$(EMPTY)def
|
en$(EMPTY)def
|
||||||
end$(EMPTY)if
|
end$(EMPTY)if
|
||||||
endef
|
endef
|
||||||
|
|
16
Makefile.inc
16
Makefile.inc
|
@ -152,7 +152,7 @@ $(obj)/$(1).ramstage.o: src/$(1).asl $(obj)/config.h
|
||||||
$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-RAMSTAGE-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl
|
$(CC_ramstage) -x assembler-with-cpp -E -MMD -MT $$(@) -D__ACPI__ -P -include $(src)/include/kconfig.h -I$(obj) -I$(src) -I$(src)/include -I$(src)/arch/$(ARCHDIR-$(ARCH-RAMSTAGE-y))/include -I$(src)/mainboard/$(MAINBOARDDIR) $$< -o $$(basename $$@).asl
|
||||||
cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$(basename $$@)).asl
|
cd $$(dir $$@); $(IASL) -p $$(notdir $$@) -tc $$(notdir $$(basename $$@)).asl
|
||||||
mv $$(basename $$@).hex $$(basename $$@).c
|
mv $$(basename $$@).hex $$(basename $$@).c
|
||||||
$(CC_ramstage) $$(CFLAGS_ramstage) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$@).c
|
$(CC_ramstage) $$(CFLAGS_ramstage) $$(CPPFLAGS_ramstage) $$(if $$(subst dsdt,,$$(basename $$(notdir $(1)))), -DAmlCode=AmlCode_$$(basename $$(notdir $(1)))) -c -o $$@ $$(basename $$@).c
|
||||||
# keep %.o: %.c rule from catching the temporary .c file after a make clean
|
# keep %.o: %.c rule from catching the temporary .c file after a make clean
|
||||||
mv $$(basename $$@).c $$(basename $$@).hex
|
mv $$(basename $$@).c $$(basename $$@).hex
|
||||||
endef
|
endef
|
||||||
|
@ -214,11 +214,11 @@ ifneq ($(CONFIG_LOCALVERSION),"")
|
||||||
COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION))
|
COREBOOT_EXTRA_VERSION := -$(call strip_quotes,$(CONFIG_LOCALVERSION))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
CPPFLAGS := -Isrc -Isrc/include -I$(obj)
|
CPPFLAGS_common := -Isrc -Isrc/include -I$(obj)
|
||||||
CPPFLAGS += -Isrc/device/oprom/include
|
CPPFLAGS_common += -Isrc/device/oprom/include
|
||||||
CPPFLAGS += -include $(src)/include/kconfig.h
|
CPPFLAGS_common += -include $(src)/include/kconfig.h
|
||||||
|
|
||||||
CFLAGS_common = $(CPPFLAGS) -Os -pipe -g -nostdinc
|
CFLAGS_common = -Os -pipe -g -nostdinc
|
||||||
CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
|
CFLAGS_common += -nostdlib -Wall -Wundef -Wstrict-prototypes -Wmissing-prototypes
|
||||||
CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
|
CFLAGS_common += -Wwrite-strings -Wredundant-decls -Wno-trigraphs
|
||||||
CFLAGS_common += -Wstrict-aliasing -Wshadow
|
CFLAGS_common += -Wstrict-aliasing -Wshadow
|
||||||
|
@ -314,15 +314,15 @@ $(objutil)/%.o: $(objutil)/%.c
|
||||||
|
|
||||||
$(obj)/%.ramstage.o $(abspath $(obj))/%.ramstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
|
$(obj)/%.ramstage.o $(abspath $(obj))/%.ramstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
|
||||||
@printf " CC $(subst $(obj)/,,$(@))\n"
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
||||||
$(CC_ramstage) -MMD $(CFLAGS_ramstage) -c -o $@ $<
|
$(CC_ramstage) -MMD $(CFLAGS_ramstage) $(CPPFLAGS_ramstage) -c -o $@ $<
|
||||||
|
|
||||||
$(obj)/%.romstage.o $(abspath $(obj))/%.romstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
|
$(obj)/%.romstage.o $(abspath $(obj))/%.romstage.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
|
||||||
@printf " CC $(subst $(obj)/,,$(@))\n"
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
||||||
$(CC_romstage) -MMD -D__PRE_RAM__ $(CFLAGS_romstage) -c -o $@ $<
|
$(CC_romstage) -MMD -D__PRE_RAM__ $(CFLAGS_romstage) $(CPPFLAGS_romstage) -c -o $@ $<
|
||||||
|
|
||||||
$(obj)/%.bootblock.o $(abspath $(obj))/%.bootblock.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
|
$(obj)/%.bootblock.o $(abspath $(obj))/%.bootblock.o: $(obj)/%.c $(obj)/config.h $(OPTION_TABLE_H)
|
||||||
@printf " CC $(subst $(obj)/,,$(@))\n"
|
@printf " CC $(subst $(obj)/,,$(@))\n"
|
||||||
$(CC_bootblock) -MMD $(bootblock-c-ccopts) $(CFLAGS_bootblock) -c -o $@ $<
|
$(CC_bootblock) -MMD $(bootblock-c-ccopts) $(CFLAGS_bootblock) $(CPPFLAGS_bootblock) -c -o $@ $<
|
||||||
|
|
||||||
#######################################################################
|
#######################################################################
|
||||||
# Clean up rules
|
# Clean up rules
|
||||||
|
|
|
@ -155,7 +155,7 @@ $(objgenerated)/crt0.s: $(objgenerated)/crt0.romstage.S $(obj)/config.h $(obj)/b
|
||||||
|
|
||||||
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
|
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
|
||||||
@printf " CC romstage.inc\n"
|
@printf " CC romstage.inc\n"
|
||||||
$(CC_romstage) -MMD $(CFLAGS_romstage) -D__PRE_RAM__ -I$(src) -I. -I$(obj) -c -S $< -o $@
|
$(CC_romstage) -MMD $(CFLAGS_romstage) $(CPPFLAGS_romstage) -D__PRE_RAM__ -I$(src) -I. -I$(obj) -c -S $< -o $@
|
||||||
|
|
||||||
endif # CONFIG_ARCH_ROMSTAGE_ARMV7
|
endif # CONFIG_ARCH_ROMSTAGE_ARMV7
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ $(objgenerated)/ramstage.o: $(stages_o) $$(ramstage-objs) $(LIBGCC_FILE_NAME_ram
|
||||||
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
|
ifeq ($(CONFIG_COMPILER_LLVM_CLANG),y)
|
||||||
$(LD_ramstage) -m -m armelf_linux_eabi -r -o $@ --wrap __divdi3 --wrap __udivdi3 --wrap __moddi3 --wrap __umoddi3 --wrap __uidiv --start-group $(ramstage-objs) $(LIBGCC_FILE_NAME_ramstage) --end-group
|
$(LD_ramstage) -m -m armelf_linux_eabi -r -o $@ --wrap __divdi3 --wrap __udivdi3 --wrap __moddi3 --wrap __umoddi3 --wrap __uidiv --start-group $(ramstage-objs) $(LIBGCC_FILE_NAME_ramstage) --end-group
|
||||||
else
|
else
|
||||||
$(CC_ramstage) $(CFLAGS_ramstage) -nostdlib -r -o $@ -Wl,--start-group $(stages_o) $(ramstage-objs) $(LIBGCC_FILE_NAME_ramstage) -Wl,--end-group
|
$(CC_ramstage) $(CFLAGS_ramstage) $(CPPFLAGS_ramstage) -nostdlib -r -o $@ -Wl,--start-group $(stages_o) $(ramstage-objs) $(LIBGCC_FILE_NAME_ramstage) -Wl,--end-group
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(CONFIG_GENERATE_PIRQ_TABLE),y)
|
ifeq ($(CONFIG_GENERATE_PIRQ_TABLE),y)
|
||||||
|
|
|
@ -193,7 +193,7 @@ else
|
||||||
|
|
||||||
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
|
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc: $(src)/mainboard/$(MAINBOARDDIR)/romstage.c $(OPTION_TABLE_H) $(obj)/build.h $(obj)/config.h
|
||||||
@printf " CC romstage.inc\n"
|
@printf " CC romstage.inc\n"
|
||||||
$(CC_romstage) -MMD $(CFLAGS_romstage) -D__PRE_RAM__ -I$(src) -I. -I$(obj) -c -S $< -o $@
|
$(CC_romstage) -MMD $(CFLAGS_romstage) $(CPPFLAGS_romstage) -D__PRE_RAM__ -I$(src) -I. -I$(obj) -c -S $< -o $@
|
||||||
|
|
||||||
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc
|
$(obj)/mainboard/$(MAINBOARDDIR)/romstage.inc: $(obj)/mainboard/$(MAINBOARDDIR)/romstage.pre.inc
|
||||||
@printf " POST romstage.inc\n"
|
@printf " POST romstage.inc\n"
|
||||||
|
|
|
@ -9,6 +9,6 @@ cpu_microcode-$(CONFIG_CPU_MICROCODE_CBFS_GENERATE) += microcode_blob.c
|
||||||
|
|
||||||
ifneq ($(CONFIG_MICROCODE_INCLUDE_PATH),)
|
ifneq ($(CONFIG_MICROCODE_INCLUDE_PATH),)
|
||||||
ifneq ($(wildcard $(shell realpath -L "$(top)/$(CONFIG_MICROCODE_INCLUDE_PATH)")),)
|
ifneq ($(wildcard $(shell realpath -L "$(top)/$(CONFIG_MICROCODE_INCLUDE_PATH)")),)
|
||||||
CPPFLAGS += -I$(CONFIG_MICROCODE_INCLUDE_PATH)
|
CPPFLAGS_common += -I$(CONFIG_MICROCODE_INCLUDE_PATH)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
|
@ -22,7 +22,7 @@ romstage-y += fsp_util.c
|
||||||
ramstage-$(CONFIG_ENABLE_MRC_CACHE) += fastboot_cache.c
|
ramstage-$(CONFIG_ENABLE_MRC_CACHE) += fastboot_cache.c
|
||||||
romstage-$(CONFIG_ENABLE_MRC_CACHE) += fastboot_cache.c
|
romstage-$(CONFIG_ENABLE_MRC_CACHE) += fastboot_cache.c
|
||||||
|
|
||||||
CPPFLAGS += -Isrc/drivers/intel/fsp
|
CPPFLAGS_common += -Isrc/drivers/intel/fsp
|
||||||
|
|
||||||
ifeq ($(CONFIG_USE_GENERIC_FSP_CAR_INC),y)
|
ifeq ($(CONFIG_USE_GENERIC_FSP_CAR_INC),y)
|
||||||
cpu_incs += $(src)/drivers/intel/fsp/cache_as_ram.inc
|
cpu_incs += $(src)/drivers/intel/fsp/cache_as_ram.inc
|
||||||
|
|
|
@ -32,6 +32,6 @@ romstage-y += ../../../arch/x86/lib/walkcbfs.S
|
||||||
smm-$(CONFIG_HAVE_SMI_HANDLER) += udelay.c
|
smm-$(CONFIG_HAVE_SMI_HANDLER) += udelay.c
|
||||||
smm-$(CONFIG_HAVE_SMI_HANDLER) += finalize.c
|
smm-$(CONFIG_HAVE_SMI_HANDLER) += finalize.c
|
||||||
|
|
||||||
CPPFLAGS += -I$(src)/northbridge/intel/fsp_sandybridge/fsp
|
CPPFLAGS_common += -I$(src)/northbridge/intel/fsp_sandybridge/fsp
|
||||||
|
|
||||||
$(obj)/northbridge/intel/fsp_sandybridge/acpi.ramstage.o : $(obj)/build.h
|
$(obj)/northbridge/intel/fsp_sandybridge/acpi.ramstage.o : $(obj)/build.h
|
||||||
|
|
|
@ -53,7 +53,7 @@ ramstage-$(CONFIG_ELOG) += elog.c
|
||||||
# Remove as ramstage gets fleshed out
|
# Remove as ramstage gets fleshed out
|
||||||
ramstage-y += placeholders.c
|
ramstage-y += placeholders.c
|
||||||
|
|
||||||
CPPFLAGS += -Isrc/soc/intel/baytrail/
|
CPPFLAGS_common += -Isrc/soc/intel/baytrail/
|
||||||
|
|
||||||
# Run an intermediate step when producing coreboot.rom
|
# Run an intermediate step when producing coreboot.rom
|
||||||
# that adds additional components to the final firmware
|
# that adds additional components to the final firmware
|
||||||
|
|
|
@ -70,4 +70,4 @@ endif
|
||||||
|
|
||||||
PHONY += bd82x6x_add_me
|
PHONY += bd82x6x_add_me
|
||||||
|
|
||||||
CPPFLAGS += -I$(src)/southbridge/intel/fsp_bd82x6x
|
CPPFLAGS_common += -I$(src)/southbridge/intel/fsp_bd82x6x
|
||||||
|
|
|
@ -48,7 +48,7 @@ VB_FIRMWARE_ARCH := $(ARCHDIR-$(ARCH-ROMSTAGE-y))
|
||||||
VB_SOURCE := vboot_reference
|
VB_SOURCE := vboot_reference
|
||||||
|
|
||||||
# Add the vboot include paths.
|
# Add the vboot include paths.
|
||||||
CPPFLAGS += -I$(VB_SOURCE)/firmware/include
|
CPPFLAGS_common += -I$(VB_SOURCE)/firmware/include
|
||||||
|
|
||||||
VBOOT_STUB_ELF = $(obj)/vendorcode/google/chromeos/vbootstub.elf
|
VBOOT_STUB_ELF = $(obj)/vendorcode/google/chromeos/vbootstub.elf
|
||||||
VBOOT_STUB = $(VBOOT_STUB_ELF).rmod
|
VBOOT_STUB = $(VBOOT_STUB_ELF).rmod
|
||||||
|
|
|
@ -64,8 +64,8 @@ OBJCOPY_$(1) := $(OBJCOPY_$(2))
|
||||||
OBJDUMP_$(1) := $(OBJDUMP_$(2))
|
OBJDUMP_$(1) := $(OBJDUMP_$(2))
|
||||||
STRIP_$(1) := $(STRIP_$(2))
|
STRIP_$(1) := $(STRIP_$(2))
|
||||||
READELF_$(1) := $(READELF_$(2))
|
READELF_$(1) := $(READELF_$(2))
|
||||||
CPPFLAGS_$(1) = -Isrc/arch/$(ARCHDIR-$(2))/include
|
CFLAGS_$(1) = $$(CFLAGS_common) $$(CFLAGS_$(2))
|
||||||
CFLAGS_$(1) = $$(CFLAGS_common) $$(CPPFLAGS_$(1)) $(CFLAGS_$(2))
|
CPPFLAGS_$(1) = $$(CPPFLAGS_common) $$(CPPFLAGS_$(2))
|
||||||
LIBGCC_FILE_NAME_$(1) = $(shell [ -r `$(CC_$(2)) -print-libgcc-file-name` ] && \
|
LIBGCC_FILE_NAME_$(1) = $(shell [ -r `$(CC_$(2)) -print-libgcc-file-name` ] && \
|
||||||
$(CC_$(2)) -print-libgcc-file-name)
|
$(CC_$(2)) -print-libgcc-file-name)
|
||||||
endef
|
endef
|
||||||
|
|
Loading…
Reference in New Issue