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
17 CORE_CSRC
:= $(wildcard $(core
)/*.c
$(core
)/*/*.c
$(core
)/*/*/*.c
)
18 CORE_COBJ
:= $(subst $(core
),$(OBJ
)/..
/core
/,$(patsubst %.c
,%.o
,$(CORE_CSRC
)))
20 # We don't want to include any of the networking stack or the thread
21 # code since it will be implemented completely differently for EFI.
22 FILTERED_OBJS
:= $(subst $(core
),$(OBJ
)/..
/core
/,$(patsubst %.c
,%.o
, \
23 $(wildcard $(core
)/legacynet
/*.c
) \
24 $(wildcard $(core
)/fs
/pxe
/*.c
) \
25 $(wildcard $(core
)/thread
/*.c
)))
27 # Don't include console objects
28 CORE_OBJS
= $(filter-out %hello.o
%rawcon.o
%plaincon.o
%strcasecmp.o
%bios.o \
29 %diskio_bios.o
%ldlinux-c.o
%isolinux-c.o
%pxelinux-c.o \
30 %localboot.o
%pxeboot.o \
31 $(FILTERED_OBJS
),$(CORE_COBJ
) $(CORE_SOBJ
))
33 CORE_OBJS
+= $(addprefix $(OBJ
)/..
/core
/, \
34 fs
/pxe
/pxe.o fs
/pxe
/tftp.o fs
/pxe
/urlparse.o fs
/pxe
/dhcp_option.o \
35 fs
/pxe
/ftp.o fs
/pxe
/ftp_readdir.o fs
/pxe
/http.o fs
/pxe
/http_readdir.o
)
37 LIB_OBJS
= $(addprefix $(objdir
)/com32
/lib
/,$(CORELIBOBJS
))
39 CSRC
= $(wildcard $(SRC
)/*.c
)
40 OBJS
= $(subst $(SRC
)/,,$(filter-out %wrapper.o
, $(patsubst %.c
,%.o
,$(CSRC
))))
42 OBJS
+= $(objdir
)/core
/codepage.o
44 # The targets to build in this directory
45 BTARGET
= syslinux.efi
47 syslinux.so
: $(OBJS
) $(CORE_OBJS
) $(LIB_OBJS
)
48 $(LD
) $(LDFLAGS
) --strip-debug
-o
$@
$^
-lgnuefi
-lefi
50 # We need to rename the .hash section because the EFI firmware
51 # linker really doesn't like it.
52 # $(OBJCOPY) --rename-section .gnu.hash=.sdata,load,data,alloc $^ $@
53 #syslinux.so: syslinux1.so
60 # Build the wrapper app and wrap our .so to produce a .efi
61 syslinux.efi
: syslinux.so wrapper
62 $(OBJ
)/wrapper syslinux.so
$@
66 codepage.o
: ..
/codepage
/cp865.cp
67 cp
$(objdir
)/..
/codepage
/cp865.cp codepage.cp
68 $(CC
) $(SFLAGS
) -c
-o
$@
$(core
)/codepage.S
71 install -m
755 $(BTARGET
) $(INSTALLROOT
)$(AUXDIR
)
76 rm -f
*.so
*.o wrapper
77 find . \
( -name \
*.o
-o
-name \
*.a
-o
-name .\
*.d
-o
-name \
*.tmp \
) -print0 | \