dmi: check both the AC and ID flags at the same time
[syslinux.git] / efi / Makefile
blob00fab6180bf6d3586636725358e6d6c7e1717acc
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 CC_FOR_BUILD ?= $(CC)
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)) \
34 $(LIBEFI)
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.
44 ifndef HEXDATE
45 HEXDATE := $(shell $(PERL) $(SRC)/../now.pl $(SRCS))
46 endif
47 ifndef DATE
48 DATE := $(shell sh $(SRC)/../gen-id.sh $(VERSION) $(HEXDATE))
49 endif
50 CFLAGS += -DDATE_STR='"$(DATE)"'
52 $(OBJ)/$(ARCH):
53 mkdir -p $@
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
67 # cp $^ $@
69 wrapper: wrapper.c
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 $@
77 all: $(BTARGET)
79 codepage.o: ../codepage/cp865.cp
80 cp $(objdir)/../codepage/cp865.cp codepage.cp
81 $(CC) $(SFLAGS) -c -o $@ $(core)/codepage.S
83 install:
84 install -m 755 $(BTARGET) $(INSTALLROOT)$(AUXDIR)
86 strip:
88 tidy dist:
89 rm -f *.so *.o wrapper
90 find . \( -name \*.o -o -name \*.a -o -name .\*.d -o -name \*.tmp \) -print0 | \
91 xargs -0r rm -f
92 $(topdir)/efi/clean-gnu-efi.sh $(EFI_SUBARCH) $(objdir)
94 clean: tidy
96 spotless: clean
97 rm -f $(BTARGET)