aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r--arch/um/Makefile49
1 files changed, 26 insertions, 23 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index c0f712cc7c5f..7730af6ec13f 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -20,15 +20,27 @@ core-y += $(ARCH_DIR)/kernel/ \
20 20
21MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas 21MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
22 22
23HEADER_ARCH := $(SUBARCH)
24
25# Additional ARCH settings for x86
26ifeq ($(SUBARCH),i386)
27 HEADER_ARCH := x86
28endif
29ifeq ($(SUBARCH),x86_64)
30 HEADER_ARCH := x86
31endif
32
33HOST_DIR := arch/$(HEADER_ARCH)
34
23include $(srctree)/$(ARCH_DIR)/Makefile-skas 35include $(srctree)/$(ARCH_DIR)/Makefile-skas
36include $(srctree)/$(HOST_DIR)/Makefile.um
37
38core-y += $(HOST_DIR)/um/
24 39
25SHARED_HEADERS := $(ARCH_DIR)/include/shared 40SHARED_HEADERS := $(ARCH_DIR)/include/shared
26ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS) 41ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS)
27ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared 42ARCH_INCLUDE += -I$(srctree)/$(HOST_DIR)/um/shared
28ifneq ($(KBUILD_SRC),) 43KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um
29ARCH_INCLUDE += -I$(SHARED_HEADERS)
30endif
31KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)
32 44
33# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so 45# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so
34# named - it's a common symbol in libpcap, so we get a binary which crashes. 46# named - it's a common symbol in libpcap, so we get a binary which crashes.
@@ -47,14 +59,12 @@ KBUILD_AFLAGS += $(ARCH_INCLUDE)
47 59
48USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ 60USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
49 $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ 61 $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
50 $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 62 $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include
51
52include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH)
53 63
54#This will adjust *FLAGS accordingly to the platform. 64#This will adjust *FLAGS accordingly to the platform.
55include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 65include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
56 66
57KBUILD_CPPFLAGS += -I$(srctree)/arch/$(HEADER_ARCH)/include 67KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include
58 68
59# -Derrno=kernel_errno - This turns all kernel references to errno into 69# -Derrno=kernel_errno - This turns all kernel references to errno into
60# kernel_errno to separate them from the libc errno. This allows -fno-common 70# kernel_errno to separate them from the libc errno. This allows -fno-common
@@ -84,10 +94,9 @@ define archhelp
84 echo ' find in the kernel root.' 94 echo ' find in the kernel root.'
85endef 95endef
86 96
87KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH) 97KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
88 98
89archprepare: $(SHARED_HEADERS)/user_constants.h 99archprepare: include/generated/user_constants.h
90archprepare: $(SHARED_HEADERS)/kern_constants.h
91 100
92LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 101LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
93LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 102LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
@@ -118,9 +127,7 @@ endef
118 127
119# When cleaning we don't include .config, so we don't include 128# When cleaning we don't include .config, so we don't include
120# TT or skas makefiles and don't clean skas_ptregs.h. 129# TT or skas makefiles and don't clean skas_ptregs.h.
121CLEAN_FILES += linux x.i gmon.out \ 130CLEAN_FILES += linux x.i gmon.out
122 $(SHARED_HEADERS)/user_constants.h \
123 $(SHARED_HEADERS)/kern_constants.h
124 131
125archclean: 132archclean:
126 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ 133 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
@@ -128,8 +135,8 @@ archclean:
128 135
129# Generated files 136# Generated files
130 137
131$(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE 138$(HOST_DIR)/um/user-offsets.s: FORCE
132 $(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@ 139 $(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@
133 140
134define filechk_gen-asm-offsets 141define filechk_gen-asm-offsets
135 (set -e; \ 142 (set -e; \
@@ -144,11 +151,7 @@ define filechk_gen-asm-offsets
144 echo ""; ) 151 echo ""; )
145endef 152endef
146 153
147$(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s 154include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s
148 $(call filechk,gen-asm-offsets) 155 $(call filechk,gen-asm-offsets)
149 156
150$(SHARED_HEADERS)/kern_constants.h: 157export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH
151 $(Q)mkdir -p $(dir $@)
152 $(Q)echo '#include "../../../../include/generated/asm-offsets.h"' >$@
153
154export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH