2008-10-07 23:46:43 +02:00
|
|
|
# Force i386-only instructions
|
|
|
|
#
|
|
|
|
CFLAGS += -march=i386
|
|
|
|
|
|
|
|
# Code size reduction.
|
|
|
|
#
|
2009-03-10 18:50:01 +01:00
|
|
|
CFLAGS += -fomit-frame-pointer
|
|
|
|
|
|
|
|
# Code size reduction.
|
|
|
|
#
|
|
|
|
ifeq ($(CCTYPE),gcc)
|
|
|
|
CFLAGS += -fstrength-reduce
|
|
|
|
endif
|
2008-10-07 23:46:43 +02:00
|
|
|
|
|
|
|
# Code size reduction. gcc3 needs a different syntax to gcc2 if you
|
|
|
|
# want to avoid spurious warnings.
|
|
|
|
#
|
2009-03-10 18:50:01 +01:00
|
|
|
ifeq ($(CCTYPE),gcc)
|
2008-10-07 23:46:43 +02: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 18:50:01 +01:00
|
|
|
endif # gcc2
|
|
|
|
endif # gcc
|
2008-10-07 23:46:43 +02:00
|
|
|
|
2009-03-10 18:50:01 +01:00
|
|
|
# Code size reduction. This is almost always a win. The kernel uses
|
|
|
|
# it, too.
|
2008-10-07 23:46:43 +02:00
|
|
|
#
|
2009-03-10 18:50:01 +01:00
|
|
|
ifeq ($(CCTYPE),gcc)
|
2008-10-07 23:46:43 +02:00
|
|
|
CFLAGS += -mpreferred-stack-boundary=2
|
2009-03-10 18:50:01 +01:00
|
|
|
endif
|
2008-10-07 23:46:43 +02:00
|
|
|
|
|
|
|
# Code size reduction. Use regparm for all functions - C functions
|
2008-11-19 01:18:32 +01:00
|
|
|
# called from assembly (or vice versa) need __asmcall now
|
2008-10-07 23:46:43 +02:00
|
|
|
#
|
|
|
|
CFLAGS += -mregparm=3
|
|
|
|
|
2008-11-19 01:18:32 +01:00
|
|
|
# Code size reduction. Use -mrtd (same __asmcall requirements as above)
|
2009-03-10 18:50:01 +01:00
|
|
|
ifeq ($(CCTYPE),gcc)
|
2008-10-07 23:46:43 +02:00
|
|
|
CFLAGS += -mrtd
|
2009-03-10 18:50:01 +01:00
|
|
|
endif
|
2008-10-07 23:46:43 +02: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 19:24:04 +02:00
|
|
|
ASFLAGS += --32
|
|
|
|
ifeq ($(HOST_OS),FreeBSD)
|
|
|
|
LDFLAGS += -m elf_i386_fbsd
|
|
|
|
else
|
|
|
|
LDFLAGS += -m elf_i386
|
|
|
|
endif
|
2008-10-07 23:46:43 +02: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 12:52:22 +01:00
|
|
|
# Locations of utilities
|
|
|
|
#
|
2010-03-29 02:12:06 +02:00
|
|
|
ISOLINUX_BIN_LIST := \
|
|
|
|
$(ISOLINUX_BIN) \
|
|
|
|
/usr/lib/syslinux/isolinux.bin \
|
2010-11-03 00:19:15 +01: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 12:52:22 +01:00
|
|
|
|
2005-04-08 17:01:17 +02:00
|
|
|
# i386-specific directories containing source files
|
|
|
|
#
|
|
|
|
SRCDIRS += arch/i386/core arch/i386/transitions arch/i386/prefix
|
2005-05-18 13:11:57 +02:00
|
|
|
SRCDIRS += arch/i386/firmware/pcbios
|
2005-05-17 15:34:25 +02:00
|
|
|
SRCDIRS += arch/i386/image
|
2006-05-13 13:35:29 +02:00
|
|
|
SRCDIRS += arch/i386/interface/pcbios
|
2006-08-03 01:08:10 +02:00
|
|
|
SRCDIRS += arch/i386/interface/pxe
|
2009-12-08 09:38:50 +01:00
|
|
|
SRCDIRS += arch/i386/interface/pxeparent
|
2008-08-29 00:52:19 +02:00
|
|
|
SRCDIRS += arch/i386/interface/syslinux
|
2009-06-28 21:50:23 +02:00
|
|
|
SRCDIRS += arch/i386/hci/commands
|
2005-04-08 17:01:17 +02:00
|
|
|
|
|
|
|
# The various xxx_loader.c files are #included into core/loader.c and
|
|
|
|
# should not be compiled directly.
|
|
|
|
#
|
|
|
|
NON_AUTO_SRCS += arch/i386/core/aout_loader.c
|
|
|
|
NON_AUTO_SRCS += arch/i386/core/freebsd_loader.c
|
|
|
|
NON_AUTO_SRCS += arch/i386/core/wince_loader.c
|
|
|
|
|
2008-11-18 23:30:37 +01:00
|
|
|
# Include common x86 Makefile
|
|
|
|
#
|
|
|
|
MAKEDEPS += arch/x86/Makefile
|
|
|
|
include arch/x86/Makefile
|
|
|
|
|
2008-10-10 03:14:22 +02:00
|
|
|
# Include platform-specific Makefile
|
2005-04-08 17:01:17 +02:00
|
|
|
#
|
2008-10-10 03:14:22 +02:00
|
|
|
MAKEDEPS += arch/i386/Makefile.$(PLATFORM)
|
|
|
|
include arch/i386/Makefile.$(PLATFORM)
|