aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r--arch/um/Makefile76
1 files changed, 17 insertions, 59 deletions
diff --git a/arch/um/Makefile b/arch/um/Makefile
index ce987266dac6..e1ffad224605 100644
--- a/arch/um/Makefile
+++ b/arch/um/Makefile
@@ -28,8 +28,6 @@ SYMLINK_HEADERS := $(foreach header,$(SYMLINK_HEADERS),include/asm-um/$(header))
28ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ 28ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \
29 $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h 29 $(SYMLINK_HEADERS) $(ARCH_DIR)/include/uml-config.h
30 30
31GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h
32
33um-modes-$(CONFIG_MODE_TT) += tt 31um-modes-$(CONFIG_MODE_TT) += tt
34um-modes-$(CONFIG_MODE_SKAS) += skas 32um-modes-$(CONFIG_MODE_SKAS) += skas
35 33
@@ -45,17 +43,19 @@ endif
45 43
46ARCH_INCLUDE := -I$(ARCH_DIR)/include 44ARCH_INCLUDE := -I$(ARCH_DIR)/include
47ifneq ($(KBUILD_SRC),) 45ifneq ($(KBUILD_SRC),)
48ARCH_INCLUDE += -I$(ARCH_DIR)/include2
49ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include 46ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include
50MRPROPER_DIRS += $(ARCH_DIR)/include2
51endif 47endif
52SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) 48SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH)
53 49
54# -Dvmap=kernel_vmap affects everything, and prevents anything from 50# -Dvmap=kernel_vmap affects everything, and prevents anything from
55# referencing the libpcap.o symbol so named. 51# referencing the libpcap.o symbol so named.
52#
53# Same things for in6addr_loopback - found in libc.
56 54
57CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ 55CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \
58 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap 56 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
57 -Din6addr_loopback=kernel_in6addr_loopback
58
59AFLAGS += $(ARCH_INCLUDE) 59AFLAGS += $(ARCH_INCLUDE)
60 60
61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) 61USER_CFLAGS := $(patsubst -I%,,$(CFLAGS))
@@ -83,10 +83,6 @@ CONFIG_KERNEL_HALF_GIGS ?= 0
83 83
84SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) 84SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000)
85 85
86ifeq ($(CONFIG_MODE_SKAS), y)
87$(SYS_HEADERS) : $(ARCH_DIR)/include/skas_ptregs.h
88endif
89
90.PHONY: linux 86.PHONY: linux
91 87
92all: linux 88all: linux
@@ -107,7 +103,8 @@ else
107$(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch) 103$(shell cd $(ARCH_DIR) && ln -sf Kconfig.$(SUBARCH) Kconfig.arch)
108endif 104endif
109 105
110archprepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) 106archprepare: $(ARCH_SYMLINKS) $(ARCH_DIR)/include/user_constants.h
107prepare: $(ARCH_DIR)/include/kern_constants.h
111 108
112LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static 109LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
113LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib 110LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
@@ -142,22 +139,20 @@ endef
142#When cleaning we don't include .config, so we don't include 139#When cleaning we don't include .config, so we don't include
143#TT or skas makefiles and don't clean skas_ptregs.h. 140#TT or skas makefiles and don't clean skas_ptregs.h.
144CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ 141CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \
145 $(GEN_HEADERS) $(ARCH_DIR)/include/skas_ptregs.h \ 142 $(ARCH_DIR)/include/user_constants.h \
146 $(ARCH_DIR)/include/user_constants.h $(ARCH_DIR)/Kconfig.arch 143 $(ARCH_DIR)/include/kern_constants.h $(ARCH_DIR)/Kconfig.arch
147 144
148MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ 145MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \
149 $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os 146 $(addprefix $(ARCH_DIR)/kernel/,$(KERN_SYMLINKS)) $(ARCH_DIR)/os
150 147
151archclean: 148archclean:
152 $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/util
153 $(Q)$(MAKE) $(clean)=$(ARCH_DIR)/os-$(OS)/util
154 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ 149 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
155 -o -name '*.gcov' \) -type f -print | xargs rm -f 150 -o -name '*.gcov' \) -type f -print | xargs rm -f
156 151
157$(SYMLINK_HEADERS): 152$(SYMLINK_HEADERS):
158 @echo ' SYMLINK $@' 153 @echo ' SYMLINK $@'
159ifneq ($(KBUILD_SRC),) 154ifneq ($(KBUILD_SRC),)
160 ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@ 155 $(Q)ln -fsn $(srctree)/include/asm-um/$(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $@
161else 156else
162 $(Q)cd $(TOPDIR)/$(dir $@) ; \ 157 $(Q)cd $(TOPDIR)/$(dir $@) ; \
163 ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@) 158 ln -sf $(basename $(notdir $@))-$(SUBARCH)$(suffix $@) $(notdir $@)
@@ -176,9 +171,7 @@ $(ARCH_DIR)/include/sysdep:
176 @echo ' SYMLINK $@' 171 @echo ' SYMLINK $@'
177ifneq ($(KBUILD_SRC),) 172ifneq ($(KBUILD_SRC),)
178 $(Q)mkdir -p $(ARCH_DIR)/include 173 $(Q)mkdir -p $(ARCH_DIR)/include
179 $(Q)mkdir -p $(ARCH_DIR)/include2 174 $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) $(ARCH_DIR)/include/sysdep
180 $(Q)ln -fsn sysdep-$(SUBARCH) $(ARCH_DIR)/include/sysdep
181 $(Q)ln -fsn $(srctree)/$(ARCH_DIR)/include/sysdep-$(SUBARCH) $(ARCH_DIR)/include2/sysdep
182else 175else
183 $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep 176 $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep
184endif 177endif
@@ -198,8 +191,6 @@ endef
198 191
199define filechk_gen-asm-offsets 192define filechk_gen-asm-offsets
200 (set -e; \ 193 (set -e; \
201 echo "#ifndef __ASM_OFFSETS_H__"; \
202 echo "#define __ASM_OFFSETS_H__"; \
203 echo "/*"; \ 194 echo "/*"; \
204 echo " * DO NOT MODIFY."; \ 195 echo " * DO NOT MODIFY."; \
205 echo " *"; \ 196 echo " *"; \
@@ -208,8 +199,7 @@ define filechk_gen-asm-offsets
208 echo " */"; \ 199 echo " */"; \
209 echo ""; \ 200 echo ""; \
210 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ 201 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
211 echo ""; \ 202 echo ""; )
212 echo "#endif" )
213endef 203endef
214 204
215$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h 205$(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h
@@ -218,50 +208,18 @@ $(ARCH_DIR)/include/uml-config.h : include/linux/autoconf.h
218$(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c 208$(ARCH_DIR)/user-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/user-offsets.c
219 $(CC) $(USER_CFLAGS) -S -o $@ $< 209 $(CC) $(USER_CFLAGS) -S -o $@ $<
220 210
221$(ARCH_DIR)/user-offsets.h: $(ARCH_DIR)/user-offsets.s 211$(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/user-offsets.s
222 $(call filechk,gen-asm-offsets) 212 $(call filechk,gen-asm-offsets)
223 213
224CLEAN_FILES += $(ARCH_DIR)/user-offsets.s $(ARCH_DIR)/user-offsets.h 214CLEAN_FILES += $(ARCH_DIR)/user-offsets.s
225 215
226$(ARCH_DIR)/kernel-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/kernel-offsets.c \ 216$(ARCH_DIR)/kernel-offsets.s: $(ARCH_DIR)/sys-$(SUBARCH)/kernel-offsets.c \
227 $(ARCH_SYMLINKS) \ 217 archprepare
228 $(SYS_DIR)/sc.h \
229 include/asm include/linux/version.h \
230 include/config/MARKER \
231 $(ARCH_DIR)/include/user_constants.h
232 $(CC) $(CFLAGS) $(NOSTDINC_FLAGS) $(CPPFLAGS) -S -o $@ $< 218 $(CC) $(CFLAGS) $(NOSTDINC_FLAGS) $(CPPFLAGS) -S -o $@ $<
233 219
234$(ARCH_DIR)/kernel-offsets.h: $(ARCH_DIR)/kernel-offsets.s 220$(ARCH_DIR)/include/kern_constants.h: $(ARCH_DIR)/kernel-offsets.s
235 $(call filechk,gen-asm-offsets) 221 $(call filechk,gen-asm-offsets)
236 222
237CLEAN_FILES += $(ARCH_DIR)/kernel-offsets.s $(ARCH_DIR)/kernel-offsets.h 223CLEAN_FILES += $(ARCH_DIR)/kernel-offsets.s
238
239$(ARCH_DIR)/include/task.h: $(ARCH_DIR)/util/mk_task
240 $(call filechk,gen_header)
241
242$(ARCH_DIR)/include/user_constants.h: $(ARCH_DIR)/os-$(OS)/util/mk_user_constants
243 $(call filechk,gen_header)
244
245$(ARCH_DIR)/include/kern_constants.h: $(ARCH_DIR)/util/mk_constants
246 $(call filechk,gen_header)
247
248$(ARCH_DIR)/include/skas_ptregs.h: $(ARCH_DIR)/kernel/skas/util/mk_ptregs
249 $(call filechk,gen_header)
250
251$(ARCH_DIR)/os-$(OS)/util/mk_user_constants: $(ARCH_DIR)/os-$(OS)/util FORCE ;
252
253$(ARCH_DIR)/util/mk_task $(ARCH_DIR)/util/mk_constants: $(ARCH_DIR)/include/user_constants.h $(ARCH_DIR)/util \
254 FORCE ;
255
256$(ARCH_DIR)/kernel/skas/util/mk_ptregs: $(ARCH_DIR)/kernel/skas/util FORCE ;
257
258$(ARCH_DIR)/util: scripts_basic $(SYS_DIR)/sc.h $(ARCH_DIR)/kernel-offsets.h FORCE
259 $(Q)$(MAKE) $(build)=$@
260
261$(ARCH_DIR)/kernel/skas/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE
262 $(Q)$(MAKE) $(build)=$@
263
264$(ARCH_DIR)/os-$(OS)/util: scripts_basic $(ARCH_DIR)/user-offsets.h FORCE
265 $(Q)$(MAKE) $(build)=$@
266 224
267export SUBARCH USER_CFLAGS OS 225export SUBARCH USER_CFLAGS OS