[contrib] Allow Network Protocol header to display in rom-o-matic
[gpxe.git] / src / arch / i386 / Makefile
blob4f686949336e540571ffab47cb5c3f53a38d1b65
1 # Force i386-only instructions
3 CFLAGS += -march=i386
5 # Code size reduction.
7 CFLAGS += -fomit-frame-pointer
9 # Code size reduction.
11 ifeq ($(CCTYPE),gcc)
12 CFLAGS += -fstrength-reduce
13 endif
15 # Code size reduction. gcc3 needs a different syntax to gcc2 if you
16 # want to avoid spurious warnings.
18 ifeq ($(CCTYPE),gcc)
19 GCC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
20 GCC_MAJOR := $(firstword $(GCC_VERSION))
21 ifeq ($(GCC_MAJOR),2)
22 CFLAGS += -malign-jumps=1 -malign-loops=1 -malign-functions=1
23 else
24 CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
25 endif # gcc2
26 endif # gcc
28 # Code size reduction. This is almost always a win. The kernel uses
29 # it, too.
31 ifeq ($(CCTYPE),gcc)
32 CFLAGS += -mpreferred-stack-boundary=2
33 endif
35 # Code size reduction. Use regparm for all functions - C functions
36 # called from assembly (or vice versa) need __asmcall now
38 CFLAGS += -mregparm=3
40 # Code size reduction. Use -mrtd (same __asmcall requirements as above)
41 ifeq ($(CCTYPE),gcc)
42 CFLAGS += -mrtd
43 endif
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
53 CFLAGS += -m32
54 ASFLAGS += --32
55 ifeq ($(HOST_OS),FreeBSD)
56 LDFLAGS += -m elf_i386_fbsd
57 else
58 LDFLAGS += -m elf_i386
59 endif
61 # EFI requires -fshort-wchar, and nothing else currently uses wchar_t
63 CFLAGS += -fshort-wchar
65 # We need to undefine the default macro "i386" when compiling .S
66 # files, otherwise ".arch i386" translates to ".arch 1"...
68 CFLAGS += -Ui386
70 # Locations of utilities
72 ISOLINUX_BIN_LIST := \
73 $(ISOLINUX_BIN) \
74 /usr/lib/syslinux/isolinux.bin \
75 /usr/share/syslinux/isolinux.bin
76 ISOLINUX_BIN = $(firstword $(wildcard $(ISOLINUX_BIN_LIST)))
78 # i386-specific directories containing source files
80 SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
81 SRCDIRS += arch/i386/firmware/pcbios
82 SRCDIRS += arch/i386/image
83 SRCDIRS += arch/i386/drivers
84 SRCDIRS += arch/i386/drivers/net
85 SRCDIRS += arch/i386/interface/pcbios
86 SRCDIRS += arch/i386/interface/pxe
87 SRCDIRS += arch/i386/interface/pxeparent
88 SRCDIRS += arch/i386/interface/syslinux
89 SRCDIRS += arch/i386/hci/commands
91 # The various xxx_loader.c files are #included into core/loader.c and
92 # should not be compiled directly.
94 NON_AUTO_SRCS += arch/i386/core/aout_loader.c
95 NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
96 NON_AUTO_SRCS += arch/i386/core/wince_loader.c
98 # Include common x86 Makefile
100 MAKEDEPS += arch/x86/Makefile
101 include arch/x86/Makefile
103 # Include platform-specific Makefile
105 MAKEDEPS += arch/i386/Makefile.$(PLATFORM)
106 include arch/i386/Makefile.$(PLATFORM)
108 # Some suffixes (e.g. %.fd0) are generated directly from other
109 # finished files (e.g. %.dsk), rather than having their own prefix.
111 # rule to write disk images to /dev/fd0
112 NON_AUTO_MEDIA += fd0
113 %fd0 : %dsk
114 $(QM)$(ECHO) " [DD] $@"
115 $(Q)dd if=$< bs=512 conv=sync of=/dev/fd0
116 $(Q)sync
118 # Add NON_AUTO_MEDIA to the media list, so that they show up in the
119 # output of "make"
121 MEDIA += $(NON_AUTO_MEDIA)