Import 2.3.12pre3
[davej-history.git] / arch / i386 / Makefile
blobd8c7f5e11b68fca112dda8ca6fd931de34e55fd9
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 CPP=$(CC) -E
21 OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S
22 LDFLAGS=-e stext
23 LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS)
25 CFLAGS_PIPE := -pipe
26 CFLAGS_NSR := -fno-strength-reduce
27 CFLAGS := $(CFLAGS) $(CFLAGS_PIPE) $(CFLAGS_NSR)
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 := $(CFLAGS) -m386 -DCPU=386
34 AFLAGS := $(AFLAGS) -DCPU=386
35 endif
37 ifdef CONFIG_M486
38 CFLAGS := $(CFLAGS) -m486 -DCPU=486
39 CFLAGS += $(shell if $(CC) -march=i486 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i486"; fi)
40 AFLAGS := $(AFLAGS) -DCPU=486
41 endif
43 ifdef CONFIG_M586
44 CFLAGS := $(CFLAGS) -DCPU=586
45 CFLAGS += $(shell if $(CC) -march=i586 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i586"; fi)
46 AFLAGS := $(AFLAGS) -DCPU=586
47 endif
49 ifdef CONFIG_M586TSC
50 CFLAGS := $(CFLAGS) -DCPU=586
51 CFLAGS += $(shell if $(CC) -march=i586 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i586"; fi)
52 AFLAGS := $(AFLAGS) -DCPU=586
53 endif
55 ifdef CONFIG_M686
56 CFLAGS := $(CFLAGS) -DCPU=686
57 CFLAGS += $(shell if $(CC) -march=i686 -S -o /dev/null -xc /dev/null >/dev/null 2>&1; then echo "-march=i686"; fi)
58 AFLAGS := $(AFLAGS) -DCPU=686
59 endif
61 HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o
63 SUBDIRS := $(SUBDIRS) arch/i386/kernel arch/i386/mm arch/i386/lib
64 CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES)
65 LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a
67 ifdef CONFIG_MATH_EMULATION
68 SUBDIRS := $(SUBDIRS) arch/i386/math-emu
69 DRIVERS := $(DRIVERS) arch/i386/math-emu/math.a
70 endif
72 arch/i386/kernel: dummy
73 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel
75 arch/i386/mm: dummy
76 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm
78 MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot
80 vmlinux: arch/i386/vmlinux.lds
82 arch/i386/vmlinux.lds: arch/i386/vmlinux.lds.S FORCE
83 gcc -E -C -P -I$(HPATH) -imacros $(HPATH)/asm-i386/page_offset.h -Ui386 arch/i386/vmlinux.lds.S >arch/i386/vmlinux.lds
85 FORCE: ;
87 zImage: vmlinux
88 @$(MAKEBOOT) zImage
90 bzImage: vmlinux
91 @$(MAKEBOOT) bzImage
93 compressed: zImage
95 zlilo: vmlinux
96 @$(MAKEBOOT) BOOTIMAGE=zImage zlilo
98 bzlilo: vmlinux
99 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo
101 zdisk: vmlinux
102 @$(MAKEBOOT) BOOTIMAGE=zImage zdisk
104 bzdisk: vmlinux
105 @$(MAKEBOOT) BOOTIMAGE=bzImage zdisk
107 install: vmlinux
108 @$(MAKEBOOT) BOOTIMAGE=bzImage install
110 archclean:
111 @$(MAKEBOOT) clean
113 archmrproper:
115 archdep:
116 @$(MAKEBOOT) dep