diff options
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r-- | arch/um/Makefile | 93 |
1 files changed, 18 insertions, 75 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile index ca40397017b9..d944c343acdb 100644 --- a/arch/um/Makefile +++ b/arch/um/Makefile | |||
@@ -18,28 +18,16 @@ core-y += $(ARCH_DIR)/kernel/ \ | |||
18 | $(ARCH_DIR)/drivers/ \ | 18 | $(ARCH_DIR)/drivers/ \ |
19 | $(ARCH_DIR)/os-$(OS)/ | 19 | $(ARCH_DIR)/os-$(OS)/ |
20 | 20 | ||
21 | # Have to precede the include because the included Makefiles reference them. | 21 | MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas |
22 | SYMLINK_HEADERS := archparam.h system.h sigcontext.h processor.h ptrace.h \ | ||
23 | module.h vm-flags.h elf.h host_ldt.h | ||
24 | SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header)) | ||
25 | |||
26 | # XXX: The "os" symlink is only used by arch/um/include/os.h, which includes | ||
27 | # ../os/include/file.h | ||
28 | # | ||
29 | # These are cleaned up during mrproper. Please DO NOT fix it again, this is | ||
30 | # the Correct Thing(tm) to do! | ||
31 | ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ | ||
32 | $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h | ||
33 | |||
34 | MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/skas | ||
35 | 22 | ||
36 | include $(srctree)/$(ARCH_DIR)/Makefile-skas | 23 | include $(srctree)/$(ARCH_DIR)/Makefile-skas |
37 | 24 | ||
38 | ARCH_INCLUDE := -I$(ARCH_DIR)/include | 25 | ARCH_INCLUDE := -I$(srctree)/$(ARCH_DIR)/include/shared |
26 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared | ||
39 | ifneq ($(KBUILD_SRC),) | 27 | ifneq ($(KBUILD_SRC),) |
40 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include | 28 | ARCH_INCLUDE += -I$(ARCH_DIR)/include/shared # for two generated files |
41 | endif | 29 | endif |
42 | SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) | 30 | KBUILD_CPPFLAGS += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH) |
43 | 31 | ||
44 | # -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so | 32 | # -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so |
45 | # named - it's a common symbol in libpcap, so we get a binary which crashes. | 33 | # named - it's a common symbol in libpcap, so we get a binary which crashes. |
@@ -65,6 +53,8 @@ include $(srctree)/$(ARCH_DIR)/Makefile-$(SUBARCH) | |||
65 | #This will adjust *FLAGS accordingly to the platform. | 53 | #This will adjust *FLAGS accordingly to the platform. |
66 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) | 54 | include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) |
67 | 55 | ||
56 | KBUILD_CPPFLAGS += -I$(srctree)/arch/$(HEADER_ARCH)/include | ||
57 | |||
68 | # -Derrno=kernel_errno - This turns all kernel references to errno into | 58 | # -Derrno=kernel_errno - This turns all kernel references to errno into |
69 | # kernel_errno to separate them from the libc errno. This allows -fno-common | 59 | # kernel_errno to separate them from the libc errno. This allows -fno-common |
70 | # in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different | 60 | # in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different |
@@ -93,14 +83,10 @@ define archhelp | |||
93 | echo ' find in the kernel root.' | 83 | echo ' find in the kernel root.' |
94 | endef | 84 | endef |
95 | 85 | ||
96 | ifneq ($(KBUILD_SRC),) | 86 | KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH) |
97 | $(shell mkdir -p $(ARCH_DIR) && ln -fsn $(srctree)/$(ARCH_DIR)/Kconfig.$(SUBARCH) $(ARCH_DIR)/Kconfig.arch) | ||
98 | else | ||
99 | $(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch) | ||
100 | endif | ||
101 | 87 | ||
102 | archprepare: $(ARCH_SYMLINKS) $(ARCH_DIR)/include/user_constants.h | 88 | archprepare: $(ARCH_DIR)/include/shared/user_constants.h |
103 | prepare: $(ARCH_DIR)/include/kern_constants.h | 89 | prepare: $(ARCH_DIR)/include/shared/kern_constants.h |
104 | 90 | ||
105 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static | 91 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static |
106 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib | 92 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib |
@@ -132,62 +118,19 @@ endef | |||
132 | 118 | ||
133 | # When cleaning we don't include .config, so we don't include | 119 | # When cleaning we don't include .config, so we don't include |
134 | # TT or skas makefiles and don't clean skas_ptregs.h. | 120 | # TT or skas makefiles and don't clean skas_ptregs.h. |
135 | CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ | 121 | CLEAN_FILES += linux x.i gmon.out \ |
136 | $(ARCH_DIR)/include/user_constants.h \ | 122 | $(ARCH_DIR)/include/shared/user_constants.h \ |
137 | $(ARCH_DIR)/include/kern_constants.h $(ARCH_DIR)/Kconfig.arch | 123 | $(ARCH_DIR)/include/shared/kern_constants.h |
138 | |||
139 | MRPROPER_FILES += $(ARCH_SYMLINKS) | ||
140 | 124 | ||
141 | archclean: | 125 | archclean: |
142 | @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ | 126 | @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ |
143 | -o -name '*.gcov' \) -type f -print | xargs rm -f | 127 | -o -name '*.gcov' \) -type f -print | xargs rm -f |
144 | 128 | ||
145 | $(SYMLINK_HEADERS): | 129 | $(objtree)/$(ARCH_DIR)/include/shared: |
146 | @echo ' SYMLINK $@' | ||
147 | ifneq ($(KBUILD_SRC),) | ||
148 | $(Q)mkdir -p $(objtree)/include/asm-um | ||
149 | $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@ | ||
150 | else | ||
151 | $(Q)cd $(srctree)/$(dir $@) ; \ | ||
152 | ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) | ||
153 | endif | ||
154 | |||
155 | include/asm-um/arch: | ||
156 | @echo ' SYMLINK $@' | ||
157 | ifneq ($(KBUILD_SRC),) | ||
158 | $(Q)mkdir -p $(objtree)/include/asm-um | ||
159 | $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch | ||
160 | else | ||
161 | $(Q)cd $(srctree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch | ||
162 | endif | ||
163 | |||
164 | $(objtree)/$(ARCH_DIR)/include: | ||
165 | @echo ' MKDIR $@' | 130 | @echo ' MKDIR $@' |
166 | $(Q)mkdir -p $@ | 131 | $(Q)mkdir -p $@ |
167 | 132 | ||
168 | $(ARCH_DIR)/include/sysdep: $(objtree)/$(ARCH_DIR)/include | ||
169 | @echo ' SYMLINK $@' | ||
170 | ifneq ($(KBUILD_SRC),) | ||
171 | $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) $(ARCH_DIR)/include/sysdep | ||
172 | else | ||
173 | $(Q)cd $(ARCH_DIR)/include && ln -fsn sysdep-$(SUBARCH) sysdep | ||
174 | endif | ||
175 | |||
176 | $(ARCH_DIR)/os: | ||
177 | @echo ' SYMLINK $@' | ||
178 | ifneq ($(KBUILD_SRC),) | ||
179 | $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/os-$(OS) $(ARCH_DIR)/os | ||
180 | else | ||
181 | $(Q)cd $(ARCH_DIR) && ln -fsn os-$(OS) os | ||
182 | endif | ||
183 | |||
184 | # Generated files | 133 | # Generated files |
185 | define filechk_umlconfig | ||
186 | sed 's/ CONFIG/ UML_CONFIG/' | ||
187 | endef | ||
188 | |||
189 | $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h | ||
190 | $(call filechk,umlconfig) | ||
191 | 134 | ||
192 | $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE | 135 | $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s: FORCE |
193 | $(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@ | 136 | $(Q)$(MAKE) $(build)=$(ARCH_DIR)/sys-$(SUBARCH) $@ |
@@ -205,11 +148,11 @@ define filechk_gen-asm-offsets | |||
205 | echo ""; ) | 148 | echo ""; ) |
206 | endef | 149 | endef |
207 | 150 | ||
208 | $(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s | 151 | $(ARCH_DIR)/include/shared/user_constants.h: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.s |
209 | $(call filechk,gen-asm-offsets) | 152 | $(call filechk,gen-asm-offsets) |
210 | 153 | ||
211 | $(ARCH_DIR)/include/kern_constants.h: $(objtree)/$(ARCH_DIR)/include | 154 | $(ARCH_DIR)/include/shared/kern_constants.h: $(objtree)/$(ARCH_DIR)/include/shared |
212 | @echo ' SYMLINK $@' | 155 | @echo ' SYMLINK $@' |
213 | $(Q)ln -sf ../../../include/asm-um/asm-offsets.h $@ | 156 | $(Q)ln -sf ../../../../include/asm/asm-offsets.h $@ |
214 | 157 | ||
215 | export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH | 158 | export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH |