1 ## -*- makefile -*- ------------------------------------------------------
3 ## Copyright 2001-2008 H. Peter Anvin - All Rights Reserved
5 ## This program is free software; you can redistribute it and/or modify
6 ## it under the terms of the GNU General Public License as published by
7 ## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
8 ## Boston MA 02111-1307, USA; either version 2 of the License, or
9 ## (at your option) any later version; incorporated herein by reference.
11 ## -----------------------------------------------------------------------
14 ## Make configuration for embedded directories
17 include $(MAKEDIR
)/syslinux.mk
19 # Support IA32 and x86_64 platforms with one build
20 # Set up architecture specifics; for cross compilation, set ARCH as apt
21 # Initialize GCCOPT to null to begin with. Without this, make generates
22 # recursive error for GCCOPT
25 GCCOPT
:= $(call gcc_ok
,-m32
)
26 GCCOPT
+= $(call gcc_ok
,-march
=i386
)
27 GCCOPT
+= $(call gcc_ok
,-mpreferred-stack-boundary
=2,)
28 GCCOPT
+= $(call gcc_ok
,-mincoming-stack-boundary
=2,)
31 GCCOPT
:= $(call gcc_ok
,-m64
)
32 GCCOPT
+= $(call gcc_ok
,-march
=x86-64
)
33 #let preferred-stack-boundary and incoming-stack-boundary be default(=4)
34 # Somewhere down the line ld barfs requiring -fPIC
35 GCCOPT
+= $(call gcc_ok
,-fPIC
)
37 GCCOPT
+= $(call gcc_ok
,-ffreestanding
,)
38 GCCOPT
+= $(call gcc_ok
,-fno-stack-protector
,)
39 GCCOPT
+= $(call gcc_ok
,-fwrapv
,)
40 GCCOPT
+= $(call gcc_ok
,-freg-struct-return
,)
42 GCCOPT
+= -Os
-fomit-frame-pointer
-msoft-float
44 GCCOPT
+= -Os
-fomit-frame-pointer
-mregparm
=3 -DREGPARM
=3 \
47 GCCOPT
+= $(call gcc_ok
,-fno-exceptions
,)
48 GCCOPT
+= $(call gcc_ok
,-fno-asynchronous-unwind-tables
,)
49 GCCOPT
+= $(call gcc_ok
,-fno-strict-aliasing
,)
50 GCCOPT
+= $(call gcc_ok
,-falign-functions
=0,-malign-functions
=0)
51 GCCOPT
+= $(call gcc_ok
,-falign-jumps
=0,-malign-jumps
=0)
52 GCCOPT
+= $(call gcc_ok
,-falign-labels
=0,-malign-labels
=0)
53 GCCOPT
+= $(call gcc_ok
,-falign-loops
=0,-malign-loops
=0)
54 GCCOPT
+= $(call gcc_ok
,-fvisibility
=hidden
)
56 LIBGCC
:= $(shell $(CC
) $(GCCOPT
) --print-libgcc
)
60 # Note: use += for CFLAGS and SFLAGS in case something is set in MCONFIG.local
61 CFLAGS
+= $(GCCOPT
) -g
$(GCCWARN
) -Wno-sign-compare
$(OPTFLAGS
) $(INCLUDES
)
62 SFLAGS
+= $(CFLAGS
) -D__ASSEMBLY__
64 .SUFFIXES
: .c .o .S .s .i .elf .com .bin .asm .lst .c32 .lss
67 $(CC
) $(MAKEDEPS
) $(CFLAGS
) -c
-o
$@
$<
69 $(CC
) $(MAKEDEPS
) $(CFLAGS
) -E
-o
$@
$<
71 $(CC
) $(MAKEDEPS
) $(CFLAGS
) -S
-o
$@
$<
73 $(CC
) $(MAKEDEPS
) $(SFLAGS
) -Wa
,-a
=$*.lst
-c
-o
$@
$<
75 $(CC
) $(MAKEDEPS
) $(SFLAGS
) -E
-o
$@
$<