1 # Force i386-only instructions
7 CFLAGS += -fomit-frame-pointer
12 CFLAGS += -fstrength-reduce
15 # Code size reduction. gcc3 needs a different syntax to gcc2 if you
16 # want to avoid spurious warnings.
19 GCC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
20 GCC_MAJOR := $(firstword $(GCC_VERSION))
22 CFLAGS += -malign-jumps=1 -malign-loops=1 -malign-functions=1
24 CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
28 # Code size reduction. This is almost always a win. The kernel uses
32 CFLAGS += -mpreferred-stack-boundary=2
35 # Code size reduction. Use regparm for all functions - C functions
36 # called from assembly (or vice versa) need __asmcall now
40 # Code size reduction. Use -mrtd (same __asmcall requirements as above)
45 # Code size reduction. This is the logical complement to -mregparm=3.
46 # It doesn't currently buy us anything, but if anything ever tries to
47 # return small structures, let's be prepared
49 CFLAGS += -freg-struct-return
51 # Force 32-bit code even on an x86-64 machine
55 ifeq ($(HOST_OS),FreeBSD)
56 LDFLAGS += -m elf_i386_fbsd
57 else ifeq ($(HOST_OS),OpenBSD)
58 LDFLAGS += -m elf_i386_obsd
60 LDFLAGS += -m elf_i386
63 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
65 CFLAGS += -fshort-wchar
67 # We need to undefine the default macro "i386" when compiling .S
68 # files, otherwise ".arch i386" translates to ".arch 1"...
72 # Define version string for lkrnprefix.S
74 CFLAGS_lkrnprefix += -DVERSION="\"$(VERSION)\""
76 # Locations of utilities
78 ISOLINUX_BIN_LIST := \
80 /usr/lib/syslinux/isolinux.bin \
81 /usr/lib/syslinux/bios/isolinux.bin \
82 /usr/share/syslinux/isolinux.bin \
83 /usr/share/syslinux/bios/isolinux.bin \
84 /usr/local/share/syslinux/isolinux.bin \
85 /usr/local/share/syslinux/bios/isolinux.bin \
86 /usr/lib/ISOLINUX/isolinux.bin
87 ISOLINUX_BIN = $(firstword $(wildcard $(ISOLINUX_BIN_LIST)))
89 # i386-specific directories containing source files
91 SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
92 SRCDIRS += arch/i386/firmware/pcbios
93 SRCDIRS += arch/i386/image
94 SRCDIRS += arch/i386/interface/pcbios
95 SRCDIRS += arch/i386/interface/pxe
96 SRCDIRS += arch/i386/interface/pxeparent
97 SRCDIRS += arch/i386/interface/syslinux
98 SRCDIRS += arch/i386/interface/vmware
99 SRCDIRS += arch/i386/hci/commands
101 # Include common x86 Makefile
103 MAKEDEPS += arch/x86/Makefile
104 include arch/x86/Makefile
106 # Include platform-specific Makefile
108 MAKEDEPS += arch/i386/Makefile.$(PLATFORM)
109 include arch/i386/Makefile.$(PLATFORM)