Linux 2.4.0-test7-pre6
[davej-history.git] / arch / i386 / Makefile
blob7735399cb7eb1bfc8e0186d17dbcdaf2c976d71f
2 # i386/Makefile
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" and "archdep" for cleaning up and making dependencies for
7 # this architecture
9 # This file is subject to the terms and conditions of the GNU General Public
10 # License. See the file "COPYING" in the main directory of this archive
11 # for more details.
13 # Copyright (C) 1994 by Linus Torvalds
15 # 19990713 Artur Skawina <skawina@geocities.com>
16 # Added '-march' and '-mpreferred-stack-boundary' support
19 LD=$(CROSS_COMPILE)ld -m elf_i386
20 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
21 LDFLAGS=-e stext
22 LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS)
24 CFLAGS += -pipe
26 # only work around strength reduction bug(s) on older gcc versions
27 CFLAGS += $(shell if ! $(CC) -march=i486 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-fno-strength-reduce"; fi)
29 # prevent gcc from keeping the stack 16 byte aligned
30 CFLAGS += $(shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi)
32 ifdef CONFIG_M386
33 CFLAGS += $(shell if $(CC) -march=i386 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i386"; else echo "-m386"; fi)
34 endif
36 ifdef CONFIG_M486
37 CFLAGS += $(shell if $(CC) -march=i486 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i486"; else echo "-m486"; fi)
38 endif
40 ifdef CONFIG_M586
41 CFLAGS += $(shell if $(CC) -march=i586 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i586"; fi)
42 endif
44 ifdef CONFIG_M586TSC
45 CFLAGS += $(shell if $(CC) -march=i586 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i586"; fi)
46 endif
48 ifdef CONFIG_M586MMX
49 CFLAGS += $(shell if $(CC) -march=i586 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i586"; fi)
50 endif
52 ifdef CONFIG_M686
53 CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi)
54 endif
56 ifdef CONFIG_M686FXSR
57 CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi)
58 endif
60 ifdef CONFIG_MK6
61 CFLAGS += $(shell if $(CC) -march=k6 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=k6"; fi)
62 endif
64 ifdef CONFIG_MK7
65 CFLAGS += $(shell if $(CC) -march=athlon -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=athlon"; else if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686 -malign-functions=4"; fi fi)
66 endif
68 ifdef CONFIG_MCRUSOE
69 CFLAGS += $(shell if $(CC) -march=i586 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i586"; fi)
70 endif
72 ifdef CONFIG_MWINCHIPC6
73 CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi)
74 endif
76 ifdef CONFIG_MWINCHIP2
77 CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi)
78 endif
80 ifdef CONFIG_MWINCHIP3D
81 CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi)
82 endif
84 HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
86 SUBDIRS += arch/i386/kernel arch/i386/mm arch/i386/lib
87 CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES)
88 LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a
90 ifdef CONFIG_MATH_EMULATION
91 SUBDIRS += arch/i386/math-emu
92 DRIVERS += arch/i386/math-emu/math.a
93 endif
95 arch/i386/kernel: dummy
96 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel
98 arch/i386/mm: dummy
99 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm
101 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
103 vmlinux: arch/i386/vmlinux.lds
105 FORCE: ;
107 .PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \
108 clean archclean archmrproper archdep
110 zImage: vmlinux
111 @$(MAKEBOOT) zImage
113 bzImage: vmlinux
114 @$(MAKEBOOT) bzImage
116 compressed: zImage
118 zlilo: vmlinux
119 @$(MAKEBOOT) BOOTIMAGE=zImage zlilo
121 tmp:
122 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
123 bzlilo: vmlinux
124 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
126 zdisk: vmlinux
127 @$(MAKEBOOT) BOOTIMAGE=zImage zdisk
129 bzdisk: vmlinux
130 @$(MAKEBOOT) BOOTIMAGE=bzImage zdisk
132 install: vmlinux
133 @$(MAKEBOOT) BOOTIMAGE=bzImage install
135 archclean:
136 @$(MAKEBOOT) clean
138 archmrproper:
140 archdep:
141 @$(MAKEBOOT) dep