Adding upstream version 6.02~pre7+dfsg.
[syslinux-debian/hramrach.git] / com32 / elflink / ldlinux / Makefile
blobd948da4345905ab7fb65cbf909fd86dfd87a23e0
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 2011-2013 Intel Corporation - All Rights Reserved
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)/elf.mk
16 CFLAGS += -I$(topdir)/core/elflink -I$(topdir)/core/include -I$(topdir)/com32/lib -fvisibility=hidden
17 LIBS = --whole-archive $(objdir)/com32/lib/libcom32min.a
19 OBJS = ldlinux.o cli.o readconfig.o refstr.o colors.o getadv.o adv.o \
20 execute.o chainboot.o kernel.o get_key.o advwrite.o setadv.o \
21 loadhigh.o msg.o
23 BTARGET = $(LDLINUX)
25 ifdef EFI_BUILD
26 %.e$(BITS): %.elf
27 $(OBJCOPY) --strip-debug --strip-unneeded $< $@
28 SONAME = $(patsubst %.elf,%.e$(BITS),$(@F))
29 else
30 SONAME = $(patsubst %.elf,%.c32,$(@F))
31 endif
33 all: $(BTARGET) ldlinux_lnx.a
35 ldlinux.elf : $(OBJS)
36 $(LD) $(LDFLAGS) -soname $(SONAME) -o $@ $^ $(LIBS)
38 LNXCFLAGS += -D__export='__attribute__((visibility("default")))'
39 LNXLIBOBJS = get_key.lo
40 ldlinux_lnx.a: $(LNXLIBOBJS)
41 rm -f $@
42 $(AR) cq $@ $(LNXLIBOBJS)
43 $(RANLIB) $@
45 tidy dist:
46 rm -f *.o *.lo *.a *.lst .*.d
48 clean: tidy
49 rm -f *.lss *.lnx *.com
51 spotless: clean
52 rm -f *~ \#* $(BTARGET)
54 install: all
55 mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR)
56 install -m 644 $(BTARGET) $(INSTALLROOT)$(AUXDIR)
59 -include .*.d