Makefile.rules 1.1 KB

12345678910111213141516171819202122232425262728
  1. # SPDX-License-Identifier: GPL-2.0
  2. # ===========================================================================
  3. # arch/um: Generic definitions
  4. # ===========================================================================
  5. USER_SINGLE_OBJS := \
  6. $(foreach f,$(patsubst %.o,%,$(obj-y) $(obj-m)),$($(f)-objs))
  7. USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS))
  8. USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
  9. $(USER_OBJS:.o=.%): \
  10. c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) -include $(srctree)/include/linux/kern_levels.h -include user.h $(CFLAGS_$(basetarget).o)
  11. # These are like USER_OBJS but filter USER_CFLAGS through unprofile instead of
  12. # using it directly.
  13. UNPROFILE_OBJS := $(foreach file,$(UNPROFILE_OBJS),$(obj)/$(file))
  14. $(UNPROFILE_OBJS:.o=.%): \
  15. c_flags = -Wp,-MD,$(depfile) $(call unprofile,$(USER_CFLAGS)) $(CFLAGS_$(basetarget).o)
  16. $(USER_OBJS) $(UNPROFILE_OBJS): \
  17. CHECKFLAGS := $(patsubst $(NOSTDINC_FLAGS),,$(CHECKFLAGS))
  18. # The stubs can't try to call mcount or update basic block data
  19. define unprofile
  20. $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
  21. endef