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 97HEAD := arch/i386/kernel/head.o arch/i386/kernel/init_task.o 98 99SUBDIRS += arch/i386/kernel arch/i386/mm arch/i386/lib 100 101CORE_FILES := arch/i386/kernel/kernel.o arch/i386/mm/mm.o $(CORE_FILES) 102LIBS := $(TOPDIR)/arch/i386/lib/lib.a $(LIBS) $(TOPDIR)/arch/i386/lib/lib.a 103 104ifdef CONFIG_MATH_EMULATION 105SUBDIRS += arch/i386/math-emu 106DRIVERS += arch/i386/math-emu/math.o 107endif 108 109arch/i386/kernel: dummy 110 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/kernel 111 112arch/i386/mm: dummy 113 $(MAKE) linuxsubdirs SUBDIRS=arch/i386/mm 114 115MAKEBOOT = $(MAKE) -C arch/$(ARCH)/boot 116 117vmlinux: arch/i386/vmlinux.lds 118 119FORCE: ; 120 121.PHONY: zImage bzImage compressed zlilo bzlilo zdisk bzdisk install \ 122 clean archclean archmrproper archdep 123 124zImage: vmlinux 125 @$(MAKEBOOT) zImage 126 127bzImage: vmlinux 128 @$(MAKEBOOT) bzImage 129 130compressed: zImage 131 132zlilo: vmlinux 133 @$(MAKEBOOT) BOOTIMAGE=zImage zlilo 134 135tmp: 136 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo 137bzlilo: vmlinux 138 @$(MAKEBOOT) BOOTIMAGE=bzImage zlilo 139 140zdisk: vmlinux 141 @$(MAKEBOOT) BOOTIMAGE=zImage zdisk 142 143bzdisk: vmlinux 144 @$(MAKEBOOT) BOOTIMAGE=bzImage zdisk 145 146install: vmlinux 147 @$(MAKEBOOT) BOOTIMAGE=bzImage install 148 149archclean: 150 @$(MAKEBOOT) clean 151 152archmrproper: 153 154archdep: 155 @$(MAKEBOOT) dep 156

