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