@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
# 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.
$(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)
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 $@ $<
$(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 $@
$(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 $@
$(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 $@