Harmonizing package dependencies.
[syslinux-debian/hramrach.git] / efi / Makefile
blob11ea9c2dbdaf7cd639557ae6bb27b461f87fe67d
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 # Don't include console objects
21 CORE_OBJS = $(filter-out %hello.o %rawcon.o %plaincon.o %strcasecmp.o %bios.o \
22 %diskio_bios.o %ldlinux-c.o %isolinux-c.o %pxelinux-c.o,$(CORE_COBJ))
24 LIB_OBJS = $(addprefix $(objdir)/com32/lib/,$(CORELIBOBJS))
26 CSRC = $(wildcard $(SRC)/*.c)
27 OBJS = $(subst $(SRC)/,,$(filter-out %wrapper.o, $(patsubst %.c,%.o,$(CSRC))))
29 OBJS += $(objdir)/core/codepage.o
31 # The targets to build in this directory
32 BTARGET = syslinux.efi
34 syslinux.so: $(OBJS) $(CORE_OBJS) $(LIB_OBJS)
35 $(LD) $(LDFLAGS) -o $@ $^ -lgnuefi -lefi
37 # We need to rename the .hash section because the EFI firmware
38 # linker really doesn't like it.
39 # $(OBJCOPY) --rename-section .gnu.hash=.sdata,load,data,alloc $^ $@
40 #syslinux.so: syslinux1.so
41 # cp $^ $@
43 wrapper: wrapper.c
44 $(CC) $^ -o $@
47 # Build the wrapper app and wrap our .so to produce a .efi
48 syslinux.efi: syslinux.so wrapper
49 $(OBJ)/wrapper syslinux.so $@
51 all: $(BTARGET)
53 codepage.o: ../codepage/cp865.cp
54 cp $(objdir)/../codepage/cp865.cp codepage.cp
55 $(CC) $(SFLAGS) -c -o $@ $(core)/codepage.S
57 installer: syslinux.efi
59 install: all
60 mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR)/efi$(BITS)
61 install -m 755 $(BTARGET) $(INSTALLROOT)$(AUXDIR)/efi$(BITS)
63 strip:
65 tidy dist:
66 rm -f *.so *.o wrapper
67 find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
68 xargs -0r rm -f
70 clean: tidy
72 spotless: clean
73 rm -f $(BTARGET)