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
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
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
22 LINKFLAGS
=-T
$(TOPDIR
)/arch
/i386
/vmlinux.lds
$(LDFLAGS
)
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
)
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
)
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
)
41 CFLAGS
+= $(shell if
$(CC
) -march
=i586
-S
-o
/dev
/null
-xc
/dev
/null
>/dev
/null
2>&1; then echo
"-march=i586"; fi
)
45 CFLAGS
+= $(shell if
$(CC
) -march
=i586
-S
-o
/dev
/null
-xc
/dev
/null
>/dev
/null
2>&1; then echo
"-march=i586"; fi
)
49 CFLAGS
+= $(shell if
$(CC
) -march
=i586
-S
-o
/dev
/null
-xc
/dev
/null
>/dev
/null
2>&1; then echo
"-march=i586"; fi
)
53 CFLAGS
+= $(shell if
$(CC
) -march
=i686
-S
-o
/dev
/null
-xc
/dev
/null
>/dev
/null
2>&1; then echo
"-march=i686"; fi
)
57 CFLAGS
+= $(shell if
$(CC
) -march
=i686
-S
-o
/dev
/null
-xc
/dev
/null
>/dev
/null
2>&1; then echo
"-march=i686"; fi
)
61 CFLAGS
+= $(shell if
$(CC
) -march
=k6
-S
-o
/dev
/null
-xc
/dev
/null
>/dev
/null
2>&1; then echo
"-march=k6"; fi
)
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
)
69 CFLAGS
+= $(shell if
$(CC
) -march
=i586
-S
-o
/dev
/null
-xc
/dev
/null
>/dev
/null
2>&1; then echo
"-march=i586"; fi
)
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
)
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
)
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
)
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
95 arch
/i386
/kernel
: dummy
96 $(MAKE
) linuxsubdirs SUBDIRS
=arch
/i386
/kernel
99 $(MAKE
) linuxsubdirs SUBDIRS
=arch
/i386
/mm
101 MAKEBOOT
= $(MAKE
) -C arch
/$(ARCH
)/boot
103 vmlinux
: arch
/i386
/vmlinux.lds
107 .PHONY
: zImage bzImage compressed zlilo bzlilo zdisk bzdisk
install \
108 clean archclean archmrproper archdep
119 @
$(MAKEBOOT
) BOOTIMAGE
=zImage zlilo
122 @
$(MAKEBOOT
) BOOTIMAGE
=bzImage zlilo
124 @
$(MAKEBOOT
) BOOTIMAGE
=bzImage zlilo
127 @
$(MAKEBOOT
) BOOTIMAGE
=zImage zdisk
130 @
$(MAKEBOOT
) BOOTIMAGE
=bzImage zdisk
133 @
$(MAKEBOOT
) BOOTIMAGE
=bzImage
install