aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r--arch/um/Makefile93
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. 21MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
22SYMLINK_HEADERS := archparam.h system.h sigcontext.h processor.h ptrace.h \
23 module.h vm-flags.h elf.h host_ldt.h
24SYMLINK_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!
31ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \
32 $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h
33
34MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/skas
35 22
36include $(srctree)/$(ARCH_DIR)/Makefile-skas 23include $(srctree)/$(ARCH_DIR)/Makefile-skas
37 24
38ARCH_INCLUDE := -I$(ARCH_DIR)/include 25ARCH_INCLUDE := -I$(srctree)/$(ARCH_DIR)/include/shared
26ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/sys-$(SUBARCH)/shared
39ifneq ($(KBUILD_SRC),) 27ifneq ($(KBUILD_SRC),)
40ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include 28ARCH_INCLUDE += -I$(ARCH_DIR)/include/shared # for two generated files
41endif 29endif
42SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) 30KBUILD_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.
66include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) 54include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
67 55
56KBUILD_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.'
94endef 84endef
95 85
96ifneq ($(KBUILD_SRC),) 86KBUILD_KCONFIG := arch/um/Kconfig.$(HEADER_ARCH)
97$(shell mkdir -p $(ARCH_DIR) && ln -fsn $(srctree)/$(ARCH_DIR)/Kconfig.$(SUBARCH) $(ARCH_DIR)/Kconfig.arch)
98else
99$(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch)
100endif
101 87
102archprepare: $(ARCH_SYMLINKS) $(ARCH_DIR)/include/user_constants.h 88archprepare: $(ARCH_DIR)/include/shared/user_constants.h
103prepare: $(ARCH_DIR)/include/kern_constants.h 89prepare: $(ARCH_DIR)/include/shared/kern_constants.h
104 90
105LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 91LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
106LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 92LINK-$(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.
135CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ 121CLEAN_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
139MRPROPER_FILES += $(ARCH_SYMLINKS)
140 124
141archclean: 125archclean:
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 $@'
147ifneq ($(KBUILD_SRC),)
148 $(Q)mkdir -p $(objtree)/include/asm-um
149 $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
150else
151 $(Q)cd $(srctree)/$(dir $@) ; \
152 ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
153endif
154
155include/asm-um/arch:
156 @echo ' SYMLINK $@'
157ifneq ($(KBUILD_SRC),)
158 $(Q)mkdir -p $(objtree)/include/asm-um
159 $(Q)ln -fsn $(srctree)/include/asm-$(HEADER_ARCH) include/asm-um/arch
160else
161 $(Q)cd $(srctree)/include/asm-um && ln -fsn ../asm-$(HEADER_ARCH) arch
162endif
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 $@'
170ifneq ($(KBUILD_SRC),)
171 $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) $(ARCH_DIR)/include/sysdep
172else
173 $(Q)cd $(ARCH_DIR)/include && ln -fsn sysdep-$(SUBARCH) sysdep
174endif
175
176$(ARCH_DIR)/os:
177 @echo ' SYMLINK $@'
178ifneq ($(KBUILD_SRC),)
179 $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/os-$(OS) $(ARCH_DIR)/os
180else
181 $(Q)cd $(ARCH_DIR) && ln -fsn os-$(OS) os
182endif
183
184# Generated files 133# Generated files
185define filechk_umlconfig
186 sed 's/ CONFIG/ UML_CONFIG/'
187endef
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 ""; )
206endef 149endef
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
215export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH 158export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS HEADER_ARCH DEV_NULL_PATH