1 include $(MAKEDIR
)/syslinux.mk
3 com32
= $(topdir
)/com32
6 # Support IA32 and x86_64 platforms with one build
7 # Set up architecture specifics; for cross compilation, set ARCH as apt
8 # gnuefi sets up architecture specifics in ia32 or x86_64 sub directories
9 # set up the LIBDIR and EFIINC for building for the appropriate architecture
10 GCCOPT
:= $(call gcc_ok
,-fno-stack-protector
,)
11 EFIINC
= $(objdir
)/include/efi
12 LIBDIR
= $(objdir
)/lib
15 ARCHOPT
= -m32
-march
=i386
19 ARCHOPT
= -m64
-march
=x86-64
23 output
= $(shell $(topdir
)/efi
/check-gnu-efi.sh
$(EFI_SUBARCH
) $(objdir
))
25 $(error Failed to build gnu-efi for
$(EFI_SUBARCH
))
29 FORMAT
=efi-app-
$(EFI_SUBARCH
)
31 CFLAGS
= -I
$(EFIINC
) -I
$(EFIINC
)/$(EFI_SUBARCH
) \
32 -DEFI_FUNCTION_WRAPPER
-fPIC
-fshort-wchar
-ffreestanding \
33 -Wall
-I
$(com32
)/include -I
$(com32
)/include/sys \
34 -I
$(core
)/include -I
$(core
)/ $(ARCHOPT
) \
35 -I
$(com32
)/lib
/ -I
$(com32
)/libutil
/include -std
=gnu99 \
36 -DELF_DEBUG
-DSYSLINUX_EFI
-I
$(objdir
) \
37 $(GCCWARN
) -D__COM32__
-mno-red-zone \
38 -DLDLINUX
=\"$(LDLINUX
)\" -fvisibility
=hidden \
39 -Wno-unused-parameter
$(GCCOPT
)
41 CRT0
:= $(LIBDIR
)/crt0-efi-
$(EFI_SUBARCH
).o
42 LDSCRIPT
:= $(LIBDIR
)/elf_
$(EFI_SUBARCH
)_efi.lds
44 LDFLAGS
= -T
$(SRC
)/$(ARCH
)/syslinux.
ld -Bsymbolic
-pie
-nostdlib
-znocombreloc \
45 -L
$(LIBDIR
) --hash-style
=gnu
-m elf_
$(ARCH
) $(CRT0
) -E
47 SFLAGS
= $(GCCOPT
) $(GCCWARN
) $(ARCHOPT
) \
48 -fomit-frame-pointer
-D__COM32__ \
49 -nostdinc
-iwithprefix
include \
50 -I
$(com32
)/libutil
/include -I
$(com32
)/include -I
$(com32
)/include/sys
$(GPLINCLUDE
)
52 %.o
: %.S
# Cancel old rule
58 $(CC
) $(SFLAGS
) -c
-o
$@
$<
62 $(CC
) $(CFLAGS
) -c
-o
$@
$<
65 # $(OBJCOPY) -j .text -j .sdata -j .data -j .dynamic -j .dynsym -j .rel \
66 # -j .rela -j .reloc --target=$(FORMAT) $*.so $@