2008-10-07 22:46:43 +01:00
|
|
|
# Force i386-only instructions
|
|
|
|
|
#
|
|
|
|
|
CFLAGS += -march=i386
|
|
|
|
|
|
|
|
|
|
# Code size reduction.
|
|
|
|
|
#
|
2009-03-10 17:50:01 +00:00
|
|
|
CFLAGS += -fomit-frame-pointer
|
|
|
|
|
|
|
|
|
|
# Code size reduction.
|
|
|
|
|
#
|
|
|
|
|
ifeq ($(CCTYPE),gcc)
|
|
|
|
|
CFLAGS += -fstrength-reduce
|
|
|
|
|
endif
|
2008-10-07 22:46:43 +01:00
|
|
|
|
|
|
|
|
# Code size reduction. gcc3 needs a different syntax to gcc2 if you
|
|
|
|
|
# want to avoid spurious warnings.
|
|
|
|
|
#
|
2009-03-10 17:50:01 +00:00
|
|
|
ifeq ($(CCTYPE),gcc)
|
2008-10-07 22:46:43 +01:00
|
|
|
GCC_VERSION := $(subst ., ,$(shell $(CC) -dumpversion))
|
|
|
|
|
GCC_MAJOR := $(firstword $(GCC_VERSION))
|
|
|
|
|
ifeq ($(GCC_MAJOR),2)
|
|
|
|
|
CFLAGS += -malign-jumps=1 -malign-loops=1 -malign-functions=1
|
|
|
|
|
else
|
|
|
|
|
CFLAGS += -falign-jumps=1 -falign-loops=1 -falign-functions=1
|
2009-03-10 17:50:01 +00:00
|
|
|
endif # gcc2
|
|
|
|
|
endif # gcc
|
2008-10-07 22:46:43 +01:00
|
|
|
|
2009-03-10 17:50:01 +00:00
|
|
|
# Code size reduction. This is almost always a win. The kernel uses
|
|
|
|
|
# it, too.
|
2008-10-07 22:46:43 +01:00
|
|
|
#
|
2009-03-10 17:50:01 +00:00
|
|
|
ifeq ($(CCTYPE),gcc)
|
2008-10-07 22:46:43 +01:00
|
|
|
CFLAGS += -mpreferred-stack-boundary=2
|
2009-03-10 17:50:01 +00:00
|
|
|
endif
|
2008-10-07 22:46:43 +01:00
|
|
|
|
|
|
|
|
# Code size reduction. Use regparm for all functions - C functions
|
2008-11-18 16:18:32 -08:00
|
|
|
# called from assembly (or vice versa) need __asmcall now
|
2008-10-07 22:46:43 +01:00
|
|
|
#
|
|
|
|
|
CFLAGS += -mregparm=3
|
|
|
|
|
|
2008-11-18 16:18:32 -08:00
|
|
|
# Code size reduction. Use -mrtd (same __asmcall requirements as above)
|
2009-03-10 17:50:01 +00:00
|
|
|
ifeq ($(CCTYPE),gcc)
|
2008-10-07 22:46:43 +01:00
|
|
|
CFLAGS += -mrtd
|
2009-03-10 17:50:01 +00:00
|
|
|
endif
|
2008-10-07 22:46:43 +01:00
|
|
|
|
|
|
|
|
# Code size reduction. This is the logical complement to -mregparm=3.
|
|
|
|
|
# It doesn't currently buy us anything, but if anything ever tries to
|
|
|
|
|
# return small structures, let's be prepared
|
|
|
|
|
#
|
|
|
|
|
CFLAGS += -freg-struct-return
|
|
|
|
|
|
|
|
|
|
# Force 32-bit code even on an x86-64 machine
|
|
|
|
|
#
|
|
|
|
|
CFLAGS += -m32
|
2008-10-17 18:24:04 +01:00
|
|
|
ASFLAGS += --32
|
|
|
|
|
ifeq ($(HOST_OS),FreeBSD)
|
|
|
|
|
LDFLAGS += -m elf_i386_fbsd
|
|
|
|
|
else
|
|
|
|
|
LDFLAGS += -m elf_i386
|
|
|
|
|
endif
|
2008-10-07 22:46:43 +01:00
|
|
|
|
|
|
|
|
# EFI requires -fshort-wchar, and nothing else currently uses wchar_t
|
|
|
|
|
#
|
|
|
|
|
CFLAGS += -fshort-wchar
|
|
|
|
|
|
|
|
|
|
# We need to undefine the default macro "i386" when compiling .S
|
|
|
|
|
# files, otherwise ".arch i386" translates to ".arch 1"...
|
|
|
|
|
#
|
|
|
|
|
CFLAGS += -Ui386
|
|
|
|
|
|
2007-01-14 11:52:22 +00:00
|
|
|
# Locations of utilities
|
|
|
|
|
#
|
2010-03-29 02:12:06 +02:00
|
|
|
ISOLINUX_BIN_LIST := \
|
|
|
|
|
$(ISOLINUX_BIN) \
|
|
|
|
|
/usr/lib/syslinux/isolinux.bin \
|
2010-11-02 23:19:15 +00:00
|
|
|
/usr/share/syslinux/isolinux.bin \
|
|
|
|
|
/usr/local/share/syslinux/isolinux.bin
|
2010-03-29 02:12:06 +02:00
|
|
|
ISOLINUX_BIN = $(firstword $(wildcard $(ISOLINUX_BIN_LIST)))
|
2007-01-14 11:52:22 +00:00
|
|
|
|
2005-04-08 15:01:17 +00:00
|
|
|
# i386-specific directories containing source files
|
|
|
|
|
#
|
|
|
|
|
SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
|
2005-05-18 11:11:57 +00:00
|
|
|
SRCDIRS += arch/i386/firmware/pcbios
|
2005-05-17 13:34:25 +00:00
|
|
|
SRCDIRS += arch/i386/image
|
2006-05-13 11:35:29 +00:00
|
|
|
SRCDIRS += arch/i386/interface/pcbios
|
2006-08-02 23:08:10 +00:00
|
|
|
SRCDIRS += arch/i386/interface/pxe
|
2009-12-08 03:38:50 -05:00
|
|
|
SRCDIRS += arch/i386/interface/pxeparent
|
2008-08-28 23:52:19 +01:00
|
|
|
SRCDIRS += arch/i386/interface/syslinux
|
2012-02-28 17:48:46 +00:00
|
|
|
SRCDIRS += arch/i386/interface/vmware
|
2009-06-28 20:50:23 +01:00
|
|
|
SRCDIRS += arch/i386/hci/commands
|
2005-04-08 15:01:17 +00:00
|
|
|
|
2008-11-18 14:30:37 -08:00
|
|
|
# Include common x86 Makefile
|
|
|
|
|
#
|
|
|
|
|
MAKEDEPS += arch/x86/Makefile
|
|
|
|
|
include arch/x86/Makefile
|
|
|
|
|
|
2008-10-10 02:14:22 +01:00
|
|
|
# Include platform-specific Makefile
|
2005-04-08 15:01:17 +00:00
|
|
|
#
|
2008-10-10 02:14:22 +01:00
|
|
|
MAKEDEPS += arch/i386/Makefile.$(PLATFORM)
|
|
|
|
|
include arch/i386/Makefile.$(PLATFORM)
|