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 LDFLAGS += -m elf_i386
44 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
46 CFLAGS += -fshort-wchar
48 # We need to undefine the default macro "i386" when compiling .S
49 # files, otherwise ".arch i386" translates to ".arch 1"...
53 # Locations of utilities
55 ISOLINUX_BIN = /usr/lib/syslinux/isolinux.bin
57 # i386-specific directories containing source files
59 SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
60 SRCDIRS += arch/i386/firmware/pcbios
61 SRCDIRS += arch/i386/image
62 SRCDIRS += arch/i386/drivers
63 SRCDIRS += arch/i386/drivers/net
64 SRCDIRS += arch/i386/interface/pcbios
65 SRCDIRS += arch/i386/interface/pxe
66 SRCDIRS += arch/i386/interface/syslinux
68 # The various xxx_loader.c files are #included into core/loader.c and
69 # should not be compiled directly.
71 NON_AUTO_SRCS += arch/i386/core/aout_loader.c
72 NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
73 NON_AUTO_SRCS += arch/i386/core/wince_loader.c
75 # unnrv2b.S is used to generate a 16-bit as well as a 32-bit object.
77 OBJS_unnrv2b = unnrv2b unnrv2b16
78 CFLAGS_unnrv2b16 = -DCODE16
80 # Include platform-specific Makefile
82 MAKEDEPS += arch/i386/Makefile.$(PLATFORM)
83 include arch/i386/Makefile.$(PLATFORM)
85 # Some suffixes (e.g. %.fd0) are generated directly from other
86 # finished files (e.g. %.dsk), rather than having their own prefix.
88 # rule to write disk images to /dev/fd0
91 dd if=$< bs=512 conv=sync of=/dev/fd0
94 # rule to create padded disk images
95 NON_AUTO_MEDIA += pdsk
98 $(PERL) ./util/dskpad.pl $@
100 # Add NON_AUTO_MEDIA to the media list, so that they show up in the
103 MEDIA += $(NON_AUTO_MEDIA)