1 ## -----------------------------------------------------------------------
3 ## Copyright 2011 Intel Corporation; author: Matt Fleming
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 include $(MAKEDIR
)/lib.mk
15 include $(MAKEDIR
)/efi.mk
19 # Upstream gnu-efi has old-style function definitions.
20 CFLAGS
+= -Wno-strict-prototypes
22 CORE_CSRC
:= $(sort $(shell find
'$(core)' -name
'*.c' -print))
23 CORE_COBJ
:= $(subst $(core
),$(OBJ
)/..
/core
,$(patsubst %.c
,%.o
,$(CORE_CSRC
)))
25 # We don't want to include any of the networking stack or the thread
26 # code since it will be implemented completely differently for EFI.
27 FILTERED_OBJS
:= $(OBJ
)/..
/core
/bios
/% \
28 $(patsubst $(core
)/%,$(OBJ
)/..
/core
/%/%,\
29 $(shell find
'$(core)' -type d
-name tests
))
31 CORE_OBJS
= $(filter-out $(FILTERED_OBJS
),$(CORE_COBJ
))
33 LIB_OBJS
= $(addprefix $(objdir
)/com32
/lib
/,$(CORELIBOBJS
)) \
36 CSRC
= $(sort $(wildcard $(SRC
)/*.c
))
37 OBJS
= $(subst $(SRC
)/,,$(filter-out %wrapper.o
, $(patsubst %.c
,%.o
,$(CSRC
))))
39 OBJS
+= $(objdir
)/core
/codepage.o
$(ARCH
)/linux.o
41 # The DATE is set on the make command line when building binaries for
42 # official release. Otherwise, substitute a hex string that is pretty much
43 # guaranteed to be unique to be unique from build to build.
45 HEXDATE
:= $(shell $(PERL
) $(SRC
)/..
/now.pl
$(SRCS
))
48 DATE
:= $(shell sh
$(SRC
)/..
/gen-id.sh
$(VERSION
) $(HEXDATE
))
50 CFLAGS
+= -DDATE_STR
='"$(DATE)"'
55 $(OBJS
): |
$(OBJ
)/$(ARCH
)
57 # The targets to build in this directory
58 BTARGET
= syslinux.efi
60 syslinux.so
: $(OBJS
) $(CORE_OBJS
) $(LIB_OBJS
)
61 $(LD
) $(LDFLAGS
) --strip-debug
-o
$@
$^
-lgnuefi
-lefi
63 # We need to rename the .hash section because the EFI firmware
64 # linker really doesn't like it.
65 # $(OBJCOPY) --rename-section .gnu.hash=.sdata,load,data,alloc $^ $@
66 #syslinux.so: syslinux1.so
70 $(CC_FOR_BUILD
) $^
-o
$@
73 # Build the wrapper app and wrap our .so to produce a .efi
74 syslinux.efi
: syslinux.so wrapper
75 $(OBJ
)/wrapper syslinux.so
$@
79 codepage.o
: ..
/codepage
/cp865.cp
80 cp
$(objdir
)/..
/codepage
/cp865.cp codepage.cp
81 $(CC
) $(SFLAGS
) -c
-o
$@
$(core
)/codepage.S
84 install -m
755 $(BTARGET
) $(INSTALLROOT
)$(AUXDIR
)
89 rm -f
*.so
*.o wrapper
90 find . \
( -name \
*.o
-o
-name \
*.a
-o
-name .\
*.d
-o
-name \
*.tmp \
) -print0 | \
92 $(topdir
)/efi
/clean-gnu-efi.sh
$(EFI_SUBARCH
) $(objdir
)