1 # Force i386-only instructions
7 CFLAGS += -fstrength-reduce -fomit-frame-pointer
9 # Code size reduction. gcc3 needs a different syntax to gcc2 if you
10 # want to avoid spurious warnings.
12 GCC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
13 GCC_MAJOR := $(firstword $(GCC_VERSION))
15 CFLAGS += -malign-jumps=1 -malign-loops=1 -malign-functions=1
17 CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
20 # Code size reduction. This is almost always a win. The kernel uses it, too.
22 CFLAGS += -mpreferred-stack-boundary=2
24 # Code size reduction. Use regparm for all functions - C functions
25 # called from assembly (or vice versa) need __cdecl now
29 # Code size reduction. Use -mrtd (same __cdecl requirements as above)
32 # Code size reduction. This is the logical complement to -mregparm=3.
33 # It doesn't currently buy us anything, but if anything ever tries to
34 # return small structures, let's be prepared
36 CFLAGS += -freg-struct-return
38 # Force 32-bit code even on an x86-64 machine
42 ifeq ($(HOST_OS),FreeBSD)
43 LDFLAGS += -m elf_i386_fbsd
45 LDFLAGS += -m elf_i386
48 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
50 CFLAGS += -fshort-wchar
52 # We need to undefine the default macro "i386" when compiling .S
53 # files, otherwise ".arch i386" translates to ".arch 1"...
57 # Locations of utilities
59 ISOLINUX_BIN = /usr/lib/syslinux/isolinux.bin
61 # i386-specific directories containing source files
63 SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
64 SRCDIRS += arch/i386/firmware/pcbios
65 SRCDIRS += arch/i386/image
66 SRCDIRS += arch/i386/drivers
67 SRCDIRS += arch/i386/drivers/net
68 SRCDIRS += arch/i386/interface/pcbios
69 SRCDIRS += arch/i386/interface/pxe
70 SRCDIRS += arch/i386/interface/syslinux
71 SRCDIRS += arch/i386/interface/efi
73 # The various xxx_loader.c files are #included into core/loader.c and
74 # should not be compiled directly.
76 NON_AUTO_SRCS += arch/i386/core/aout_loader.c
77 NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
78 NON_AUTO_SRCS += arch/i386/core/wince_loader.c
80 # unnrv2b.S is used to generate a 16-bit as well as a 32-bit object.
82 OBJS_unnrv2b = unnrv2b unnrv2b16
83 CFLAGS_unnrv2b16 = -DCODE16
85 # Include platform-specific Makefile
87 MAKEDEPS += arch/i386/Makefile.$(PLATFORM)
88 include arch/i386/Makefile.$(PLATFORM)
90 # Some suffixes (e.g. %.fd0) are generated directly from other
91 # finished files (e.g. %.dsk), rather than having their own prefix.
93 # rule to write disk images to /dev/fd0
96 $(QM)$(ECHO) " [DD] $@"
97 $(Q)dd if=$< bs=512 conv=sync of=/dev/fd0
100 # rule to create padded disk images
101 NON_AUTO_MEDIA += pdsk
103 $(QM)$(ECHO) " [DSKPAD] $@"
105 $(Q)$(PERL) ./util/dskpad.pl $@
107 # Add NON_AUTO_MEDIA to the media list, so that they show up in the
110 MEDIA += $(NON_AUTO_MEDIA)