diff options
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r-- | arch/um/Makefile | 49 |
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 | ||
21 | MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas | 21 | MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas |
22 | 22 | ||
23 | HEADER_ARCH := $(SUBARCH) | ||
24 | |||
25 | # Additional ARCH settings for x86 | ||
26 | ifeq ($(SUBARCH),i386) | ||
27 | HEADER_ARCH := x86 | ||
28 | endif | ||
29 | ifeq ($(SUBARCH),x86_64) | ||
30 | HEADER_ARCH := x86 | ||
31 | endif | ||
32 | |||
33 | HOST_DIR := arch/$(HEADER_ARCH) | ||
34 | |||
23 | include $(srctree)/$(ARCH_DIR)/Makefile-skas | 35 | include $(srctree)/$(ARCH_DIR)/Makefile-skas |
36 | include $(srctree)/$(HOST_DIR)/Makefile.um | ||
37 | |||
38 | core-y += $(HOST_DIR)/um/ | ||
24 | 39 | ||
25 | SHARED_HEADERS := $(ARCH_DIR)/include/shared | 40 | SHARED_HEADERS := $(ARCH_DIR)/include/shared |
26 | ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS) | 41 | ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS) |
27 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared | 42 | ARCH_INCLUDE += -I$(srctree)/$(HOST_DIR)/um/shared |
28 | ifneq ($(KBUILD_SRC),) | 43 | KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um |
29 | ARCH_INCLUDE += -I$(SHARED_HEADERS) | ||
30 | endif | ||
31 | KBUILD_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 | ||
48 | USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ | 60 | USER_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 | |||
52 | include $(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. |
55 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | 65 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) |
56 | 66 | ||
57 | KBUILD_CPPFLAGS += -I$(srctree)/arch/$(HEADER_ARCH)/include | 67 | KBUILD_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.' |
85 | endef | 95 | endef |
86 | 96 | ||
87 | KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH) | 97 | KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig |
88 | 98 | ||
89 | archprepare: $(SHARED_HEADERS)/user_constants.h | 99 | archprepare: include/generated/user_constants.h |
90 | archprepare: $(SHARED_HEADERS)/kern_constants.h | ||
91 | 100 | ||
92 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static | 101 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static |
93 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib | 102 | LINK-$(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. |
121 | CLEAN_FILES += linux x.i gmon.out \ | 130 | CLEAN_FILES += linux x.i gmon.out |
122 | $(SHARED_HEADERS)/user_constants.h \ | ||
123 | $(SHARED_HEADERS)/kern_constants.h | ||
124 | 131 | ||
125 | archclean: | 132 | archclean: |
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 | ||
134 | define filechk_gen-asm-offsets | 141 | define filechk_gen-asm-offsets |
135 | (set -e; \ | 142 | (set -e; \ |
@@ -144,11 +151,7 @@ define filechk_gen-asm-offsets | |||
144 | echo ""; ) | 151 | echo ""; ) |
145 | endef | 152 | endef |
146 | 153 | ||
147 | $(SHARED_HEADERS)/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s | 154 | include/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: | 157 | export 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 | |||
154 | export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH | ||