Blame view
arch/um/Makefile
4.91 KB
4f1933620 kbuild: change kb... |
1 2 3 4 |
# # This file is included by the global makefile so that you can add your own # architecture-specific flags and dependencies. # |
4c9e13851 uml: style fixes ... |
5 |
# Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com) |
1da177e4c Linux-2.6.12-rc2 |
6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# Licensed under the GPL # ARCH_DIR := arch/um OS := $(shell uname -s) # We require bash because the vmlinux link and loader script cpp use bash # features. SHELL := /bin/bash filechk_gen_header = $< core-y += $(ARCH_DIR)/kernel/ \ $(ARCH_DIR)/drivers/ \ $(ARCH_DIR)/os-$(OS)/ |
8569c9140 x86, um: take arc... |
20 |
MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas |
1da177e4c Linux-2.6.12-rc2 |
21 |
|
7bbe7204e um: merge Makefil... |
22 23 24 25 26 27 28 29 30 |
HEADER_ARCH := $(SUBARCH) # Additional ARCH settings for x86 ifeq ($(SUBARCH),i386) HEADER_ARCH := x86 endif ifeq ($(SUBARCH),x86_64) HEADER_ARCH := x86 endif |
5c48b108e um: take arch/um/... |
31 |
HOST_DIR := arch/$(HEADER_ARCH) |
42fda6638 uml: throw out CO... |
32 |
include $(srctree)/$(ARCH_DIR)/Makefile-skas |
5c48b108e um: take arch/um/... |
33 34 35 |
include $(srctree)/$(HOST_DIR)/Makefile.um core-y += $(HOST_DIR)/um/ |
1da177e4c Linux-2.6.12-rc2 |
36 |
|
22409f9c8 get rid of the la... |
37 38 |
SHARED_HEADERS := $(ARCH_DIR)/include/shared ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS) |
5c48b108e um: take arch/um/... |
39 40 |
ARCH_INCLUDE += -I$(srctree)/$(HOST_DIR)/um/shared KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um |
1da177e4c Linux-2.6.12-rc2 |
41 |
|
98105d47d [PATCH] uml: comm... |
42 43 |
# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so # named - it's a common symbol in libpcap, so we get a binary which crashes. |
fd7481047 [PATCH] uml: Fix ... |
44 |
# |
98105d47d [PATCH] uml: comm... |
45 46 47 48 |
# Same things for in6addr_loopback and mktime - found in libc. For these two we # only get link-time error, luckily. # # These apply to USER_CFLAGS to. |
1da177e4c Linux-2.6.12-rc2 |
49 |
|
260c0cb88 uml: fx command-l... |
50 |
KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ -DSUBARCH=\"$(SUBARCH)\" \ |
98105d47d [PATCH] uml: comm... |
51 |
$(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \ |
818f6ef40 uml: fix an IPV6 ... |
52 |
-Din6addr_loopback=kernel_in6addr_loopback \ |
2c51a4bc0 um: fix strrchr()... |
53 |
-Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr |
fd7481047 [PATCH] uml: Fix ... |
54 |
|
222d394d3 kbuild: enable 'm... |
55 |
KBUILD_AFLAGS += $(ARCH_INCLUDE) |
1da177e4c Linux-2.6.12-rc2 |
56 |
|
d45e44d4b [PATCH] uml: fix ... |
57 |
USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\ |
a0f97e06a kbuild: enable 'm... |
58 |
$(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \ |
4d45db9c4 um: switch to -id... |
59 |
$(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include |
d45e44d4b [PATCH] uml: fix ... |
60 |
|
d45e44d4b [PATCH] uml: fix ... |
61 62 |
#This will adjust *FLAGS accordingly to the platform. include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS) |
ecc354a90 [PATCH] uml: rein... |
63 |
|
c9b284b20 um: Run host arch... |
64 65 |
KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \ -I$(HOST_DIR)/include/generated |
1de1502c9 x86, um: now we c... |
66 |
|
ecc354a90 [PATCH] uml: rein... |
67 68 |
# -Derrno=kernel_errno - This turns all kernel references to errno into # kernel_errno to separate them from the libc errno. This allows -fno-common |
a0f97e06a kbuild: enable 'm... |
69 |
# in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different |
ecc354a90 [PATCH] uml: rein... |
70 |
# errnos. |
98105d47d [PATCH] uml: comm... |
71 |
# These apply to kernelspace only. |
f15cf5151 uml: correctly st... |
72 73 74 |
# # strip leading and trailing whitespace to make the USER_CFLAGS removal of these # defines more robust |
ecc354a90 [PATCH] uml: rein... |
75 |
|
f15cf5151 uml: correctly st... |
76 77 |
KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \ -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES)) |
a0f97e06a kbuild: enable 'm... |
78 |
KBUILD_CFLAGS += $(KERNEL_DEFINES) |
1da177e4c Linux-2.6.12-rc2 |
79 |
|
4f1933620 kbuild: change kb... |
80 |
PHONY += linux |
1da177e4c Linux-2.6.12-rc2 |
81 82 83 84 |
all: linux linux: vmlinux |
a4b741e38 [PATCH] uml: uml-... |
85 |
@echo ' LINK $@' |
cb8aa3d29 [PATCH] uml: use ... |
86 |
$(Q)ln -f $< $@ |
1da177e4c Linux-2.6.12-rc2 |
87 88 89 90 |
define archhelp echo '* linux - Binary kernel image (./linux) - for backward' echo ' compatibility only, this creates a hard link to the' |
4b3f686d4 Attack of "the th... |
91 |
echo ' real kernel binary, the "vmlinux" binary you' |
1da177e4c Linux-2.6.12-rc2 |
92 93 |
echo ' find in the kernel root.' endef |
5c48b108e um: take arch/um/... |
94 |
KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig |
1da177e4c Linux-2.6.12-rc2 |
95 |
|
c9b284b20 um: Run host arch... |
96 |
archheaders: |
79320bcbf um: Use $(srctree... |
97 |
$(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \ |
c9b284b20 um: Run host arch... |
98 |
ARCH=$(SUBARCH) O='$(objtree)' archheaders |
4de1c5f65 um: take user_con... |
99 |
archprepare: include/generated/user_constants.h |
1da177e4c Linux-2.6.12-rc2 |
100 101 102 |
LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib |
275e6e1ee [PATCH] uml: fix ... |
103 104 105 |
CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \ $(call cc-option, -fno-stack-protector,) \ $(call cc-option, -fno-stack-protector-all,) |
51b563fc9 arm, cris, mips, ... |
106 107 108 109 |
# Options used by linker script export LDS_START := $(START) export LDS_ELF_ARCH := $(ELF_ARCH) export LDS_ELF_FORMAT := $(ELF_FORMAT) |
1da177e4c Linux-2.6.12-rc2 |
110 |
|
4c9e13851 uml: style fixes ... |
111 |
# The wrappers will select whether using "malloc" or the kernel allocator. |
1da177e4c Linux-2.6.12-rc2 |
112 |
LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc |
260c0cb88 uml: fx command-l... |
113 |
LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt)) |
0ba7fe03b uml: allow LFLAGS... |
114 115 |
CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE) |
1da177e4c Linux-2.6.12-rc2 |
116 117 118 119 |
define cmd_vmlinux__ $(CC) $(CFLAGS_vmlinux) -o $@ \ -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \ -Wl,--start-group $(vmlinux-main) -Wl,--end-group \ |
776cfebb4 [PATCH] uml kbuil... |
120 |
-lutil \ |
75473c1d3 fallout from kbui... |
121 |
$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o \ |
1da177e4c Linux-2.6.12-rc2 |
122 123 |
FORCE ,$^) ; rm -f linux endef |
4c9e13851 uml: style fixes ... |
124 125 |
# When cleaning we don't include .config, so we don't include # TT or skas makefiles and don't clean skas_ptregs.h. |
9e636452d um: get rid of ke... |
126 |
CLEAN_FILES += linux x.i gmon.out |
1da177e4c Linux-2.6.12-rc2 |
127 |
|
1da177e4c Linux-2.6.12-rc2 |
128 |
archclean: |
1da177e4c Linux-2.6.12-rc2 |
129 130 |
@find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \ -o -name '*.gcov' \) -type f -print | xargs rm -f |
1da177e4c Linux-2.6.12-rc2 |
131 |
# Generated files |
4ee189a92 [PATCH] uml: fix ... |
132 |
|
392f4b7db um: Generate head... |
133 |
$(HOST_DIR)/um/user-offsets.s: __headers FORCE |
5c48b108e um: take arch/um/... |
134 |
$(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@ |
4ee189a92 [PATCH] uml: fix ... |
135 |
|
f64a227b6 kbuild: um fix so... |
136 137 |
define filechk_gen-asm-offsets (set -e; \ |
f64a227b6 kbuild: um fix so... |
138 139 140 141 142 143 144 145 |
echo "/*"; \ echo " * DO NOT MODIFY."; \ echo " *"; \ echo " * This file was generated by arch/$(ARCH)/Makefile"; \ echo " *"; \ echo " */"; \ echo ""; \ sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \ |
ecba97d4a [PATCH] uml makef... |
146 |
echo ""; ) |
f64a227b6 kbuild: um fix so... |
147 |
endef |
5c48b108e um: take arch/um/... |
148 |
include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s |
8d0b9dc9b [PATCH] uml: star... |
149 |
$(call filechk,gen-asm-offsets) |
5c48b108e um: take arch/um/... |
150 |
export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH |