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