diff options
Diffstat (limited to 'arch/um/Makefile')
-rw-r--r-- | arch/um/Makefile | 76 |
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)) | |||
28 | ARCH_SYMLINKS = include/asm-um/arch $(ARCH_DIR)/include/sysdep $(ARCH_DIR)/os \ | 28 | ARCH_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 | ||
31 | GEN_HEADERS += $(ARCH_DIR)/include/task.h $(ARCH_DIR)/include/kern_constants.h | ||
32 | |||
33 | um-modes-$(CONFIG_MODE_TT) += tt | 31 | um-modes-$(CONFIG_MODE_TT) += tt |
34 | um-modes-$(CONFIG_MODE_SKAS) += skas | 32 | um-modes-$(CONFIG_MODE_SKAS) += skas |
35 | 33 | ||
@@ -45,17 +43,19 @@ endif | |||
45 | 43 | ||
46 | ARCH_INCLUDE := -I$(ARCH_DIR)/include | 44 | ARCH_INCLUDE := -I$(ARCH_DIR)/include |
47 | ifneq ($(KBUILD_SRC),) | 45 | ifneq ($(KBUILD_SRC),) |
48 | ARCH_INCLUDE += -I$(ARCH_DIR)/include2 | ||
49 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include | 46 | ARCH_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include |
50 | MRPROPER_DIRS += $(ARCH_DIR)/include2 | ||
51 | endif | 47 | endif |
52 | SYS_DIR := $(ARCH_DIR)/include/sysdep-$(SUBARCH) | 48 | SYS_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 | ||
57 | CFLAGS += $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ | 55 | CFLAGS += $(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 | |||
59 | AFLAGS += $(ARCH_INCLUDE) | 59 | AFLAGS += $(ARCH_INCLUDE) |
60 | 60 | ||
61 | USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) | 61 | USER_CFLAGS := $(patsubst -I%,,$(CFLAGS)) |
@@ -83,10 +83,6 @@ CONFIG_KERNEL_HALF_GIGS ?= 0 | |||
83 | 83 | ||
84 | SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) | 84 | SIZE = (($(CONFIG_NEST_LEVEL) + $(CONFIG_KERNEL_HALF_GIGS)) * 0x20000000) |
85 | 85 | ||
86 | ifeq ($(CONFIG_MODE_SKAS), y) | ||
87 | $(SYS_HEADERS) : $(ARCH_DIR)/include/skas_ptregs.h | ||
88 | endif | ||
89 | |||
90 | .PHONY: linux | 86 | .PHONY: linux |
91 | 87 | ||
92 | all: linux | 88 | all: 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) |
108 | endif | 104 | endif |
109 | 105 | ||
110 | archprepare: $(ARCH_SYMLINKS) $(SYS_HEADERS) $(GEN_HEADERS) | 106 | archprepare: $(ARCH_SYMLINKS) $(ARCH_DIR)/include/user_constants.h |
107 | prepare: $(ARCH_DIR)/include/kern_constants.h | ||
111 | 108 | ||
112 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static | 109 | LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static |
113 | LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib | 110 | LINK-$(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. |
144 | CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/include/uml-config.h \ | 141 | CLEAN_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 | ||
148 | MRPROPER_FILES += $(SYMLINK_HEADERS) $(ARCH_SYMLINKS) \ | 145 | MRPROPER_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 | ||
151 | archclean: | 148 | archclean: |
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 $@' |
159 | ifneq ($(KBUILD_SRC),) | 154 | ifneq ($(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 $@) $@ |
161 | else | 156 | else |
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 $@' |
177 | ifneq ($(KBUILD_SRC),) | 172 | ifneq ($(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 | ||
182 | else | 175 | else |
183 | $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep | 176 | $(Q)cd $(ARCH_DIR)/include && ln -sf sysdep-$(SUBARCH) sysdep |
184 | endif | 177 | endif |
@@ -198,8 +191,6 @@ endef | |||
198 | 191 | ||
199 | define filechk_gen-asm-offsets | 192 | define 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" ) | ||
213 | endef | 203 | endef |
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 | ||
224 | CLEAN_FILES += $(ARCH_DIR)/user-offsets.s $(ARCH_DIR)/user-offsets.h | 214 | CLEAN_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 | ||
237 | CLEAN_FILES += $(ARCH_DIR)/kernel-offsets.s $(ARCH_DIR)/kernel-offsets.h | 223 | CLEAN_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 | ||
267 | export SUBARCH USER_CFLAGS OS | 225 | export SUBARCH USER_CFLAGS OS |