Makefile.rules 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. # ===========================================================================
  2. # arch/um: Generic definitions
  3. # ===========================================================================
  4. USER_SINGLE_OBJS := \
  5. $(foreach f,$(patsubst %.o,%,$(obj-y) $(obj-m)),$($(f)-objs))
  6. USER_OBJS += $(filter %_user.o,$(obj-y) $(obj-m) $(USER_SINGLE_OBJS))
  7. USER_OBJS := $(foreach file,$(USER_OBJS),$(obj)/$(file))
  8. $(USER_OBJS) $(USER_OBJS:.o=.i) $(USER_OBJS:.o=.s) $(USER_OBJS:.o=.lst): \
  9. c_flags = -Wp,-MD,$(depfile) $(USER_CFLAGS) $(CFLAGS_$(notdir $@))
  10. $(USER_OBJS): cmd_checksrc =
  11. $(USER_OBJS): quiet_cmd_checksrc =
  12. $(USER_OBJS): cmd_force_checksrc =
  13. $(USER_OBJS): quiet_cmd_force_checksrc =
  14. # The stubs and unmap.o can't try to call mcount or update basic block data
  15. define unprofile
  16. $(patsubst -pg,,$(patsubst -fprofile-arcs -ftest-coverage,,$(1)))
  17. endef
  18. # cmd_make_link checks to see if the $(foo-dir) variable starts with a /. If
  19. # so, it's considered to be a path relative to $(srcdir) rather than
  20. # $(srcdir)/arch/$(SUBARCH). This is because x86_64 wants to get ldt.c from
  21. # arch/um/sys-i386 rather than arch/i386 like the other borrowed files. So,
  22. # it sets $(ldt.c-dir) to /arch/um/sys-i386.
  23. quiet_cmd_make_link = SYMLINK $@
  24. cmd_make_link = rm -f $@; ln -sf $(srctree)$(if $(filter-out /%,$($(notdir $@)-dir)),/arch/$(SUBARCH))/$($(notdir $@)-dir)/$(notdir $@) $@
  25. # this needs to be before the foreach, because targets does not accept
  26. # complete paths like $(obj)/$(f). To make sure this works, use a := assignment
  27. # or we will get $(obj)/$(f) in the "targets" value.
  28. # Also, this forces you to use the := syntax when assigning to targets.
  29. # Otherwise the line below will cause an infinite loop (if you don't know why,
  30. # just do it).
  31. targets := $(targets) $(SYMLINKS)
  32. SYMLINKS := $(foreach f,$(SYMLINKS),$(obj)/$(f))
  33. $(SYMLINKS): FORCE
  34. $(call if_changed,make_link)