1# 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" and "archdep" for cleaning up and making dependencies for 7# this architecture 8# 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. 12# 13# Copyright (C) 1994 by Linus Torvalds 14# 15# 19990713 Artur Skawina <skawina@geocities.com> 16# Added '-march' and '-mpreferred-stack-boundary' support 17# 18 19LD=$(CROSS_COMPILE)ld -m elf_i386 20OBJCOPY=$(CROSS_COMPILE)objcopy -O binary -R .note -R .comment -S 21LDFLAGS=-e stext 22LINKFLAGS =-T $(TOPDIR)/arch/i386/vmlinux.lds $(LDFLAGS) 23 24CFLAGS += -pipe 25 26check_gcc = $(shell if $(CC) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi) 27 28# prevent gcc from keeping the stack 16 byte aligned 29CFLAGS += $(call check_gcc,-mpreferred-stack-boundary=2,) 30 31ifdef CONFIG_M386 32CFLAGS += -march=i386 33endif 34 35ifdef CONFIG_M486 36CFLAGS += -march=i486 37endif 38 39ifdef CONFIG_M586 40CFLAGS += -march=i586 41endif 42 43ifdef CONFIG_M586TSC 44CFLAGS += -march=i586 45endif 46 47ifdef CONFIG_M586MMX 48CFLAGS += -march=i586 49endif 50 51ifdef CONFIG_M686 52CFLAGS += -march=i686 53endif 54 55ifdef CONFIG_MPENTIUMIII 56CFLAGS += -march=i686 57endif 58 59ifdef CONFIG_MPENTIUM4 60CFLAGS += -march=i686 61endif 62 63ifdef CONFIG_MK6 64CFLAGS += $(call check_gcc,-march=k6,-march=i586) 65endif 66 67ifdef CONFIG_MK7 68CFLAGS += $(call check_gcc,-march=athlon,-march=i686 -malign-functions=4) 69endif 70 71ifdef CONFIG_MCRUSOE 72CFLAGS += -march=i686 73CFLAGS += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0) 74endif 75 76ifdef CONFIG_MWINCHIPC6 77CFLAGS += -march=i586 78endif 79 80ifdef CONFIG_MWINCHIP2 81CFLAGS += -march=i586 82endif 83 84ifdef CONFIG_MWINCHIP3D 85CFLAGS += -march=i586 86endif 87 88ifdef CONFIG_MCYRIXIII 89CFLAGS += $(call check_gcc,-march=c3,-march=i486) 90CFLAGS += $(call check_gcc,-falign-functions=0 -falign-jumps=0 -falign-loops=0,-malign-functions=0 -malign-jumps=0 -malign-loops=0) 91endif 92 93ifdef CONFIG_MVIAC3_2 94CFLAGS += $(call check_gcc,-march=c3-2,-march=i686) 95endif 96 97# Disable unit-at-a-time mode, it makes gcc use a lot more stack 98# due to the lack of sharing of stacklots. 99CFLAGS += $(call check_gcc,-fno-unit-at-a-time,) 100 101HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o 102 103SUBDIRS += arch/i386/kernel arch/i386/mm arch/i386/lib 104 105CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES) 106LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a 107 108ifdef CONFIG_MATH_EMULATION 109SUBDIRS += arch/i386/math-emu 110DRIVERS += arch/i386/math-emu/math.o 111endif 112 113arch/i386/kernel: dummy 114 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel 115 116arch/i386/mm: dummy 117 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm 118 119MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot 120 121vmlinux: arch/i386/vmlinux.lds 122 123FORCE: ; 124 125.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ 126 clean archclean archmrproper archdep 127 128zImage: vmlinux 129 @$(MAKEBOOT) zImage 130 131bzImage: vmlinux 132 @$(MAKEBOOT) bzImage 133 134compressed: zImage 135 136zlilo: vmlinux 137 @$(MAKEBOOT) BOOTIMAGE=zImage zlilo 138 139tmp: 140 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo 141bzlilo: vmlinux 142 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo 143 144zdisk: vmlinux 145 @$(MAKEBOOT) BOOTIMAGE=zImage zdisk 146 147bzdisk: vmlinux 148 @$(MAKEBOOT) BOOTIMAGE=bzImage zdisk 149 150install: vmlinux 151 @$(MAKEBOOT) BOOTIMAGE=bzImage install 152 153archclean: 154 @$(MAKEBOOT) clean 155 156archmrproper: 157 158archdep: 159 @$(MAKEBOOT) dep 160

