m68k: Use generic time config
[deliverable/linux.git] / arch / um / Makefile
CommitLineData
4f193362
PS
1#
2# This file is included by the global makefile so that you can add your own
3# architecture-specific flags and dependencies.
4#
4c9e1385 5# Copyright (C) 2002 - 2007 Jeff Dike (jdike@{addtoit,linux.intel}.com)
1da177e4
LT
6# Licensed under the GPL
7#
8
9ARCH_DIR := arch/um
10OS := $(shell uname -s)
11# We require bash because the vmlinux link and loader script cpp use bash
12# features.
13SHELL := /bin/bash
14
15filechk_gen_header = $<
16
17core-y += $(ARCH_DIR)/kernel/ \
18 $(ARCH_DIR)/drivers/ \
19 $(ARCH_DIR)/os-$(OS)/
20
8569c914 21MODE_INCLUDE += -I$(srctree)/$(ARCH_DIR)/include/shared/skas
1da177e4 22
7bbe7204
AV
23HEADER_ARCH := $(SUBARCH)
24
25# Additional ARCH settings for x86
26ifeq ($(SUBARCH),i386)
27 HEADER_ARCH := x86
28endif
29ifeq ($(SUBARCH),x86_64)
30 HEADER_ARCH := x86
12783aa0 31 KBUILD_CFLAGS += -mcmodel=large
7bbe7204
AV
32endif
33
5c48b108
AV
34HOST_DIR := arch/$(HEADER_ARCH)
35
42fda663 36include $(srctree)/$(ARCH_DIR)/Makefile-skas
5c48b108
AV
37include $(srctree)/$(HOST_DIR)/Makefile.um
38
39core-y += $(HOST_DIR)/um/
1da177e4 40
22409f9c
AV
41SHARED_HEADERS := $(ARCH_DIR)/include/shared
42ARCH_INCLUDE := -I$(srctree)/$(SHARED_HEADERS)
5c48b108
AV
43ARCH_INCLUDE += -I$(srctree)/$(HOST_DIR)/um/shared
44KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/um
1da177e4 45
98105d47
PBG
46# -Dvmap=kernel_vmap prevents anything from referencing the libpcap.o symbol so
47# named - it's a common symbol in libpcap, so we get a binary which crashes.
fd748104 48#
98105d47
PBG
49# Same things for in6addr_loopback and mktime - found in libc. For these two we
50# only get link-time error, luckily.
51#
52# These apply to USER_CFLAGS to.
1da177e4 53
dc5be20a 54KBUILD_CFLAGS += $(CFLAGS) $(CFLAGS-y) -D__arch_um__ \
98105d47 55 $(ARCH_INCLUDE) $(MODE_INCLUDE) -Dvmap=kernel_vmap \
818f6ef4 56 -Din6addr_loopback=kernel_in6addr_loopback \
2c51a4bc 57 -Din6addr_any=kernel_in6addr_any -Dstrrchr=kernel_strrchr
fd748104 58
222d394d 59KBUILD_AFLAGS += $(ARCH_INCLUDE)
1da177e4 60
d45e44d4 61USER_CFLAGS = $(patsubst $(KERNEL_DEFINES),,$(patsubst -D__KERNEL__,,\
a0f97e06 62 $(patsubst -I%,,$(KBUILD_CFLAGS)))) $(ARCH_INCLUDE) $(MODE_INCLUDE) \
4d45db9c 63 $(filter -I%,$(CFLAGS)) -D_FILE_OFFSET_BITS=64 -idirafter include
d45e44d4 64
d45e44d4 65#This will adjust *FLAGS accordingly to the platform.
66include $(srctree)/$(ARCH_DIR)/Makefile-os-$(OS)
ecc354a9 67
c9b284b2
PA
68KBUILD_CPPFLAGS += -I$(srctree)/$(HOST_DIR)/include \
69 -I$(HOST_DIR)/include/generated
1de1502c 70
ecc354a9
PBG
71# -Derrno=kernel_errno - This turns all kernel references to errno into
72# kernel_errno to separate them from the libc errno. This allows -fno-common
a0f97e06 73# in KBUILD_CFLAGS. Otherwise, it would cause ld to complain about the two different
ecc354a9 74# errnos.
98105d47 75# These apply to kernelspace only.
f15cf515
JD
76#
77# strip leading and trailing whitespace to make the USER_CFLAGS removal of these
78# defines more robust
ecc354a9 79
f15cf515
JD
80KERNEL_DEFINES = $(strip -Derrno=kernel_errno -Dsigprocmask=kernel_sigprocmask \
81 -Dmktime=kernel_mktime $(ARCH_KERNEL_DEFINES))
a0f97e06 82KBUILD_CFLAGS += $(KERNEL_DEFINES)
1da177e4 83
4f193362 84PHONY += linux
1da177e4
LT
85
86all: linux
87
88linux: vmlinux
a4b741e3 89 @echo ' LINK $@'
cb8aa3d2 90 $(Q)ln -f $< $@
1da177e4
LT
91
92define archhelp
93 echo '* linux - Binary kernel image (./linux) - for backward'
94 echo ' compatibility only, this creates a hard link to the'
4b3f686d 95 echo ' real kernel binary, the "vmlinux" binary you'
1da177e4
LT
96 echo ' find in the kernel root.'
97endef
98
5c48b108 99KBUILD_KCONFIG := $(HOST_DIR)/um/Kconfig
1da177e4 100
c9b284b2 101archheaders:
79320bcb 102 $(Q)$(MAKE) -C '$(srctree)' KBUILD_SRC= \
dc5be20a 103 ARCH=$(HEADER_ARCH) O='$(objtree)' archheaders
c9b284b2 104
4de1c5f6 105archprepare: include/generated/user_constants.h
1da177e4
LT
106
107LINK-$(CONFIG_LD_SCRIPT_STATIC) += -static
108LINK-$(CONFIG_LD_SCRIPT_DYN) += -Wl,-rpath,/lib
109
275e6e1e
PBG
110CFLAGS_NO_HARDENING := $(call cc-option, -fno-PIC,) $(call cc-option, -fno-pic,) \
111 $(call cc-option, -fno-stack-protector,) \
112 $(call cc-option, -fno-stack-protector-all,)
113
51b563fc
SR
114# Options used by linker script
115export LDS_START := $(START)
116export LDS_ELF_ARCH := $(ELF_ARCH)
117export LDS_ELF_FORMAT := $(ELF_FORMAT)
1da177e4 118
4c9e1385 119# The wrappers will select whether using "malloc" or the kernel allocator.
1da177e4
LT
120LINK_WRAPS = -Wl,--wrap,malloc -Wl,--wrap,free -Wl,--wrap,calloc
121
260c0cb8 122LD_FLAGS_CMDLINE = $(foreach opt,$(LDFLAGS),-Wl,$(opt))
0ba7fe03
JD
123
124CFLAGS_vmlinux := $(LINK-y) $(LINK_WRAPS) $(LD_FLAGS_CMDLINE)
1da177e4
LT
125define cmd_vmlinux__
126 $(CC) $(CFLAGS_vmlinux) -o $@ \
127 -Wl,-T,$(vmlinux-lds) $(vmlinux-init) \
128 -Wl,--start-group $(vmlinux-main) -Wl,--end-group \
776cfebb 129 -lutil \
75473c1d 130 $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o \
1da177e4
LT
131 FORCE ,$^) ; rm -f linux
132endef
133
4c9e1385
JD
134# When cleaning we don't include .config, so we don't include
135# TT or skas makefiles and don't clean skas_ptregs.h.
9e636452 136CLEAN_FILES += linux x.i gmon.out
1da177e4 137
1da177e4 138archclean:
1da177e4
LT
139 @find . \( -name '*.bb' -o -name '*.bbg' -o -name '*.da' \
140 -o -name '*.gcov' \) -type f -print | xargs rm -f
141
1da177e4 142# Generated files
4ee189a9 143
392f4b7d 144$(HOST_DIR)/um/user-offsets.s: __headers FORCE
5c48b108 145 $(Q)$(MAKE) $(build)=$(HOST_DIR)/um $@
4ee189a9 146
f64a227b
SR
147define filechk_gen-asm-offsets
148 (set -e; \
f64a227b
SR
149 echo "/*"; \
150 echo " * DO NOT MODIFY."; \
151 echo " *"; \
152 echo " * This file was generated by arch/$(ARCH)/Makefile"; \
153 echo " *"; \
154 echo " */"; \
155 echo ""; \
156 sed -ne "/^->/{s:^->\([^ ]*\) [\$$#]*\([^ ]*\) \(.*\):#define \1 \2 /* \3 */:; s:->::; p;}"; \
ecba97d4 157 echo ""; )
f64a227b
SR
158endef
159
5c48b108 160include/generated/user_constants.h: $(HOST_DIR)/um/user-offsets.s
8d0b9dc9
AV
161 $(call filechk,gen-asm-offsets)
162
5c48b108 163export SUBARCH USER_CFLAGS CFLAGS_NO_HARDENING OS DEV_NULL_PATH
This page took 0.567685 seconds and 5 git commands to generate.