blob: 09951990a6226b0a422c5812c6af7dbe67ef18a1 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001#
2# i386/Makefile
3#
4# This file is included by the global makefile so that you can add your own
5# architecture-specific flags and dependencies. Remember to do have actions
6# for "archclean" cleaning up for this architecture.
7#
8# This file is subject to the terms and conditions of the GNU General Public
9# License. See the file "COPYING" in the main directory of this archive
10# for more details.
11#
12# Copyright (C) 1994 by Linus Torvalds
13#
14# 19990713 Artur Skawina <skawina@geocities.com>
15# Added '-march' and '-mpreferred-stack-boundary' support
16#
Kianusch Sayah Karadji47137412005-05-05 16:16:17 -070017# 20050320 Kianusch Sayah Karadji <kianusch@sk-tech.net>
Linus Torvalds1da177e2005-04-16 15:20:36 -070018# Added support for GEODE CPU
19
H. Peter Anvind0e7feb2005-06-23 00:08:09 -070020HAS_BIARCH := $(call cc-option-yn, -m32)
21ifeq ($(HAS_BIARCH),y)
22AS := $(AS) --32
23LD := $(LD) -m elf_i386
24CC := $(CC) -m32
25endif
26
Linus Torvalds1da177e2005-04-16 15:20:36 -070027LDFLAGS := -m elf_i386
28OBJCOPYFLAGS := -O binary -R .note -R .comment -S
29LDFLAGS_vmlinux :=
30CHECKFLAGS += -D__i386__
31
32CFLAGS += -pipe -msoft-float
33
34# prevent gcc from keeping the stack 16 byte aligned
35CFLAGS += $(call cc-option,-mpreferred-stack-boundary=2)
36
37align := $(cc-option-align)
38cflags-$(CONFIG_M386) += -march=i386
39cflags-$(CONFIG_M486) += -march=i486
40cflags-$(CONFIG_M586) += -march=i586
41cflags-$(CONFIG_M586TSC) += -march=i586
42cflags-$(CONFIG_M586MMX) += $(call cc-option,-march=pentium-mmx,-march=i586)
43cflags-$(CONFIG_M686) += -march=i686
44cflags-$(CONFIG_MPENTIUMII) += -march=i686 $(call cc-option,-mtune=pentium2)
45cflags-$(CONFIG_MPENTIUMIII) += -march=i686 $(call cc-option,-mtune=pentium3)
46cflags-$(CONFIG_MPENTIUMM) += -march=i686 $(call cc-option,-mtune=pentium3)
47cflags-$(CONFIG_MPENTIUM4) += -march=i686 $(call cc-option,-mtune=pentium4)
48cflags-$(CONFIG_MK6) += -march=k6
49# Please note, that patches that add -march=athlon-xp and friends are pointless.
50# They make zero difference whatsosever to performance at this time.
51cflags-$(CONFIG_MK7) += $(call cc-option,-march=athlon,-march=i686 $(align)-functions=4)
52cflags-$(CONFIG_MK8) += $(call cc-option,-march=k8,$(call cc-option,-march=athlon,-march=i686 $(align)-functions=4))
53cflags-$(CONFIG_MCRUSOE) += -march=i686 $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
54cflags-$(CONFIG_MEFFICEON) += -march=i686 $(call cc-option,-mtune=pentium3) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
55cflags-$(CONFIG_MWINCHIPC6) += $(call cc-option,-march=winchip-c6,-march=i586)
56cflags-$(CONFIG_MWINCHIP2) += $(call cc-option,-march=winchip2,-march=i586)
57cflags-$(CONFIG_MWINCHIP3D) += $(call cc-option,-march=winchip2,-march=i586)
58cflags-$(CONFIG_MCYRIXIII) += $(call cc-option,-march=c3,-march=i486) $(align)-functions=0 $(align)-jumps=0 $(align)-loops=0
59cflags-$(CONFIG_MVIAC3_2) += $(call cc-option,-march=c3-2,-march=i686)
60
61# AMD Elan support
62cflags-$(CONFIG_X86_ELAN) += -march=i486
63
Kianusch Sayah Karadji47137412005-05-05 16:16:17 -070064# Geode GX1 support
65cflags-$(CONFIG_MGEODEGX1) += $(call cc-option,-march=pentium-mmx,-march=i486)
Linus Torvalds1da177e2005-04-16 15:20:36 -070066
67# -mregparm=3 works ok on gcc-3.0 and later
68#
69GCC_VERSION := $(call cc-version)
70cflags-$(CONFIG_REGPARM) += $(shell if [ $(GCC_VERSION) -ge 0300 ] ; then echo "-mregparm=3"; fi ;)
71
72# Disable unit-at-a-time mode, it makes gcc use a lot more stack
73# due to the lack of sharing of stacklots.
74CFLAGS += $(call cc-option,-fno-unit-at-a-time)
75
76CFLAGS += $(cflags-y)
77
78# Default subarch .c files
79mcore-y := mach-default
80
81# Voyager subarch support
82mflags-$(CONFIG_X86_VOYAGER) := -Iinclude/asm-i386/mach-voyager
83mcore-$(CONFIG_X86_VOYAGER) := mach-voyager
84
85# VISWS subarch support
86mflags-$(CONFIG_X86_VISWS) := -Iinclude/asm-i386/mach-visws
87mcore-$(CONFIG_X86_VISWS) := mach-visws
88
89# NUMAQ subarch support
90mflags-$(CONFIG_X86_NUMAQ) := -Iinclude/asm-i386/mach-numaq
91mcore-$(CONFIG_X86_NUMAQ) := mach-default
92
93# BIGSMP subarch support
94mflags-$(CONFIG_X86_BIGSMP) := -Iinclude/asm-i386/mach-bigsmp
95mcore-$(CONFIG_X86_BIGSMP) := mach-default
96
97#Summit subarch support
98mflags-$(CONFIG_X86_SUMMIT) := -Iinclude/asm-i386/mach-summit
99mcore-$(CONFIG_X86_SUMMIT) := mach-default
100
101# generic subarchitecture
102mflags-$(CONFIG_X86_GENERICARCH) := -Iinclude/asm-i386/mach-generic
103mcore-$(CONFIG_X86_GENERICARCH) := mach-default
104core-$(CONFIG_X86_GENERICARCH) += arch/i386/mach-generic/
105
106# ES7000 subarch support
107mflags-$(CONFIG_X86_ES7000) := -Iinclude/asm-i386/mach-es7000
108mcore-$(CONFIG_X86_ES7000) := mach-default
109core-$(CONFIG_X86_ES7000) := arch/i386/mach-es7000/
110
111# default subarch .h files
112mflags-y += -Iinclude/asm-i386/mach-default
113
114head-y := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
115
116libs-y += arch/i386/lib/
117core-y += arch/i386/kernel/ \
118 arch/i386/mm/ \
119 arch/i386/$(mcore-y)/ \
120 arch/i386/crypto/
121drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/
122drivers-$(CONFIG_PCI) += arch/i386/pci/
123# must be linked after kernel/
124drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/
125drivers-$(CONFIG_PM) += arch/i386/power/
126
127CFLAGS += $(mflags-y)
128AFLAGS += $(mflags-y)
129
130boot := arch/i386/boot
131
132.PHONY: zImage bzImage compressed zlilo bzlilo \
Sam Ravnborg2cacb3d2005-04-30 16:51:42 -0700133 zdisk bzdisk fdimage fdimage144 fdimage288 install kernel_install
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134
135all: bzImage
136
137# KBUILD_IMAGE specify target image being built
138 KBUILD_IMAGE := $(boot)/bzImage
139zImage zlilo zdisk: KBUILD_IMAGE := arch/i386/boot/zImage
140
141zImage bzImage: vmlinux
142 $(Q)$(MAKE) $(build)=$(boot) $(KBUILD_IMAGE)
143
144compressed: zImage
145
146zlilo bzlilo: vmlinux
147 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zlilo
148
149zdisk bzdisk: vmlinux
150 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) zdisk
151
152fdimage fdimage144 fdimage288: vmlinux
153 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) $@
154
Sam Ravnborg2cacb3d2005-04-30 16:51:42 -0700155install: vmlinux
156install kernel_install:
157 $(Q)$(MAKE) $(build)=$(boot) BOOTIMAGE=$(KBUILD_IMAGE) install
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158
Linus Torvalds1da177e2005-04-16 15:20:36 -0700159archclean:
160 $(Q)$(MAKE) $(clean)=arch/i386/boot
161
162define archhelp
163 echo '* bzImage - Compressed kernel image (arch/$(ARCH)/boot/bzImage)'
164 echo ' install - Install kernel using'
165 echo ' (your) ~/bin/installkernel or'
166 echo ' (distribution) /sbin/installkernel or'
167 echo ' install to $$(INSTALL_PATH) and run lilo'
168 echo ' bzdisk - Create a boot floppy in /dev/fd0'
169 echo ' fdimage - Create a boot floppy image'
170endef
171
172CLEAN_FILES += arch/$(ARCH)/boot/fdimage arch/$(ARCH)/boot/mtools.conf