Adding upstream version 6.00+dfgs.
[syslinux-debian/hramrach.git] / efi / Makefile
blob20034301e41c0d2570ad78338ecbbc80296e43f7
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 2011 Intel Corporation; author: Matt Fleming
4 ##
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 ## -----------------------------------------------------------------------
13 VPATH = $(SRC)
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 $(FILTERED_OBJS),$(CORE_COBJ) $(CORE_SOBJ))
32 CORE_OBJS += $(addprefix $(OBJ)/../core/, \
33 fs/pxe/pxe.o fs/pxe/tftp.o fs/pxe/urlparse.o fs/pxe/dhcp_option.o \
34 fs/pxe/ftp.o fs/pxe/ftp_readdir.o fs/pxe/http.o fs/pxe/http_readdir.o)
36 LIB_OBJS = $(addprefix $(objdir)/com32/lib/,$(CORELIBOBJS))
38 CSRC = $(wildcard $(SRC)/*.c)
39 OBJS = $(subst $(SRC)/,,$(filter-out %wrapper.o, $(patsubst %.c,%.o,$(CSRC))))
41 OBJS += $(objdir)/core/codepage.o
43 # The targets to build in this directory
44 BTARGET = syslinux.efi
46 syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
47 $(LD) $(LDFLAGS) --strip-debug -o $@ $^ -lgnuefi -lefi
49 # We need to rename the .hash section because the EFI firmware
50 # linker really doesn't like it.
51 # $(OBJCOPY) --rename-section .gnu.hash=.sdata,load,data,alloc $^ $@
52 #syslinux.so: syslinux1.so
53 # cp $^ $@
55 wrapper: wrapper.c
56 $(CC) $^ -o $@
59 # Build the wrapper app and wrap our .so to produce a .efi
60 syslinux.efi: syslinux.so wrapper
61 $(OBJ)/wrapper syslinux.so $@
63 all: $(BTARGET)
65 codepage.o: ../codepage/cp865.cp
66 cp $(objdir)/../codepage/cp865.cp codepage.cp
67 $(CC) $(SFLAGS) -c -o $@ $(core)/codepage.S
69 installer: syslinux.efi
71 install: all
72 install -m 755 $(BTARGET) $(INSTALLROOT)$(AUXDIR)
74 strip:
76 tidy dist:
77 rm -f *.so *.o wrapper
78 find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
79 xargs -0r rm -f
81 clean: tidy
83 spotless: clean
84 rm -f $(BTARGET)