Makefile 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. # SPDX-License-Identifier: GPL-2.0
  2. #
  3. # Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux,intel}.com)
  4. #
  5. # Don't instrument UML-specific code; without this, we may crash when
  6. # accessing the instrumentation buffer for the first time from the
  7. # kernel.
  8. KCOV_INSTRUMENT := n
  9. CPPFLAGS_vmlinux.lds := -DSTART=$(LDS_START) \
  10. -DELF_ARCH=$(LDS_ELF_ARCH) \
  11. -DELF_FORMAT=$(LDS_ELF_FORMAT) \
  12. $(LDS_EXTRA)
  13. extra-y := vmlinux.lds
  14. obj-y = config.o exec.o exitcode.o irq.o ksyms.o mem.o \
  15. physmem.o process.o ptrace.o reboot.o sigio.o \
  16. signal.o sysrq.o time.o tlb.o trap.o \
  17. um_arch.o umid.o kmsg_dump.o capflags.o skas/
  18. obj-y += load_file.o
  19. obj-$(CONFIG_BLK_DEV_INITRD) += initrd.o
  20. obj-$(CONFIG_GPROF) += gprof_syms.o
  21. obj-$(CONFIG_OF) += dtb.o
  22. obj-$(CONFIG_EARLY_PRINTK) += early_printk.o
  23. obj-$(CONFIG_STACKTRACE) += stacktrace.o
  24. obj-$(CONFIG_GENERIC_PCI_IOMAP) += ioport.o
  25. USER_OBJS := config.o
  26. include $(srctree)/arch/um/scripts/Makefile.rules
  27. targets := config.c config.tmp capflags.c
  28. # Be careful with the below Sed code - sed is pitfall-rich!
  29. # We use sed to lower build requirements, for "embedded" builders for instance.
  30. $(obj)/config.tmp: $(objtree)/.config FORCE
  31. $(call if_changed,quote1)
  32. quiet_cmd_quote1 = QUOTE $@
  33. cmd_quote1 = sed -e 's/"/\\"/g' -e 's/^/"/' -e 's/$$/\\n",/' \
  34. $< > $@
  35. $(obj)/config.c: $(src)/config.c.in $(obj)/config.tmp FORCE
  36. $(call if_changed,quote2)
  37. quiet_cmd_mkcapflags = MKCAP $@
  38. cmd_mkcapflags = $(CONFIG_SHELL) $(src)/../../x86/kernel/cpu/mkcapflags.sh $@ $^
  39. cpufeature = $(src)/../../x86/include/asm/cpufeatures.h
  40. vmxfeature = $(src)/../../x86/include/asm/vmxfeatures.h
  41. $(obj)/capflags.c: $(cpufeature) $(vmxfeature) $(src)/../../x86/kernel/cpu/mkcapflags.sh FORCE
  42. $(call if_changed,mkcapflags)
  43. quiet_cmd_quote2 = QUOTE $@
  44. cmd_quote2 = sed -e '/CONFIG/{' \
  45. -e 's/"CONFIG"//' \
  46. -e 'r $(obj)/config.tmp' \
  47. -e 'a \' \
  48. -e '""' \
  49. -e '}' \
  50. $< > $@