xref: /linux/arch/um/kernel/skas/Makefile (revision 32e8eaf263d9be014ba1970444f745682fa9c6c0)
1# SPDX-License-Identifier: GPL-2.0
2#
3# Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
4#
5
6obj-y := stub.o mmu.o process.o syscall.o uaccess.o \
7	 stub_exe_embed.o
8
9# Stub executable
10
11stub_exe_objs-y := stub_exe.o
12
13stub_exe_objs := $(foreach F,$(stub_exe_objs-y),$(obj)/$F)
14
15# Object file containing the ELF executable
16$(obj)/stub_exe_embed.o: $(src)/stub_exe_embed.S $(obj)/stub_exe
17
18$(obj)/stub_exe.dbg: $(stub_exe_objs) FORCE
19	$(call if_changed,stub_exe)
20
21$(obj)/stub_exe: OBJCOPYFLAGS := -S
22$(obj)/stub_exe: $(obj)/stub_exe.dbg FORCE
23	$(call if_changed,objcopy)
24
25quiet_cmd_stub_exe = STUB_EXE $@
26      cmd_stub_exe = $(CC) -nostdlib -o $@ \
27			   $(KBUILD_CFLAGS) $(STUB_EXE_LDFLAGS) \
28			   $(filter %.o,$^)
29
30STUB_EXE_LDFLAGS = -n -static
31
32targets += stub_exe.dbg stub_exe $(stub_exe_objs-y)
33
34# end
35
36# stub.o is in the stub, so it can't be built with profiling
37# GCC hardened also auto-enables -fpic, but we need %ebx so it can't work ->
38# disable it
39
40CFLAGS_stub.o := $(CFLAGS_NO_HARDENING)
41CFLAGS_stub_exe.o := $(CFLAGS_NO_HARDENING)
42UNPROFILE_OBJS := stub.o stub_exe.o
43KCOV_INSTRUMENT := n
44
45include $(srctree)/arch/um/scripts/Makefile.rules
46