build: introduce cpp_flags macro

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
This commit is contained in:
Anthony PERARD authored and Jan Beulich committed 2021-09-07 09:14:12 +02:00
1 parent 6c27a8da8d
commit 2ff44490fc
6 files changed
+10 -7

No files matched your search

+1 -1
View File
@@ -410,7 +410,7 @@ include/xen/compile.h: include/xen/compile.h.in .banner
@mv -f $@.new $@
asm-offsets.s: arch/$(TARGET_ARCH)/$(TARGET_SUBARCH)/asm-offsets.c
$(CC) $(filter-out -Wa$(comma)% -flto,$(c_flags)) -S -g0 -o $@.new -MQ $@ $<
$(CC) $(call cpp_flags,$(c_flags)) -S -g0 -o $@.new -MQ $@ $<
$(call move-if-changed,$@.new,$@)
include/asm-$(TARGET_ARCH)/asm-offsets.h: asm-offsets.s
+5 -2
View File
@@ -133,6 +133,9 @@ endif
# Always build obj-bin files as binary even if they come from C source.
$(obj-bin-y): XEN_CFLAGS := $(filter-out -flto,$(XEN_CFLAGS))
# To be use with e.g. $(a_flags) or $(c_flags) to produce CPP flags
cpp_flags = $(filter-out -Wa$(comma)% -flto,$(1))
# Calculation of flags, first the generic flags, then the arch specific flags,
# and last the flags modified for a target or a directory.
@@ -222,13 +225,13 @@ $(filter %.init.o,$(obj-y) $(obj-bin-y) $(extra-y)): %.init.o: %.o FORCE
$(call if_changed,obj_init_o)
quiet_cmd_cpp_i_c = CPP $@
cmd_cpp_i_c = $(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -MQ $@ -o $@ $<
cmd_cpp_i_c = $(CPP) $(call cpp_flags,$(c_flags)) -MQ $@ -o $@ $<
quiet_cmd_cc_s_c = CC $@
cmd_cc_s_c = $(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -S $< -o $@
quiet_cmd_cpp_s_S = CPP $@
cmd_cpp_s_S = $(CPP) $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
cmd_cpp_s_S = $(CPP) $(call cpp_flags,$(a_flags)) -MQ $@ -o $@ $<
%.i: %.c FORCE
$(call if_changed,cpp_i_c)
+1 -1
View File
@@ -292,7 +292,7 @@ $(BASEDIR)/include/asm-x86/asm-macros.h: asm-macros.i Makefile
efi.lds: AFLAGS-y += -DEFI
xen.lds efi.lds: xen.lds.S
$(CPP) -P $(filter-out -Wa$(comma)%,$(a_flags)) -MQ $@ -o $@ $<
$(CPP) -P $(call cpp_flags,$(a_flags)) -MQ $@ -o $@ $<
boot/mkelf32: boot/mkelf32.c
$(HOSTCC) $(HOSTCFLAGS) -o $@ $<
+1 -1
View File
@@ -15,7 +15,7 @@ guest_walk_%.o: guest_walk.c Makefile
$(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
guest_walk_%.i: guest_walk.c Makefile
$(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
$(CPP) $(call cpp_flags,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
guest_walk_%.s: guest_walk.c Makefile
$(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@
+1 -1
View File
@@ -9,7 +9,7 @@ guest_walk_%level.o: guest_walk.c Makefile
$(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
guest_walk_%level.i: guest_walk.c Makefile
$(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
$(CPP) $(call cpp_flags,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
guest_walk_%level.s: guest_walk.c Makefile
$(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@
+1 -1
View File
@@ -10,7 +10,7 @@ guest_%.o: multi.c Makefile
$(CC) $(c_flags) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
guest_%.i: multi.c Makefile
$(CPP) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
$(CPP) $(call cpp_flags,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -c $< -o $@
guest_%.s: multi.c Makefile
$(CC) $(filter-out -Wa$(comma)%,$(c_flags)) -DGUEST_PAGING_LEVELS=$* -S $< -o $@
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.