[syslinux:elflink] core: Split core console code into separate libs
syslinux-bot for Matt Fleming
matt.fleming at intel.com
Sat Dec 17 21:19:38 PST 2011
Commit-ID: 8589c986e0ff312221260f8c1b3f5463ceb691c8
Gitweb: http://www.syslinux.org/commit/8589c986e0ff312221260f8c1b3f5463ceb691c8
Author: Matt Fleming <matt.fleming at intel.com>
AuthorDate: Fri, 4 Nov 2011 15:02:14 +0000
Committer: Matt Fleming <matt.fleming at intel.com>
CommitDate: Fri, 2 Dec 2011 12:13:30 +0000
core: Split core console code into separate libs
When the console code was written in asm ldlinux.asm, isolinux.asm and
pxelinux.asm simply included the correct console I/O files (rawcon.inc
and plaincon.inc) but now that these files are implemented in C we
need another way to link against the correct functions.
Create separate libraries for linking ldlinux, isolinux and pxelinux
against.
Signed-off-by: Matt Fleming <matt.fleming at intel.com>
---
core/Makefile | 29 +++++++++++++++++++++++++----
1 files changed, 25 insertions(+), 4 deletions(-)
diff --git a/core/Makefile b/core/Makefile
index 95424dc..5288da6 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -49,10 +49,13 @@ ALLSRC = $(NASMSRC) $(NASMHDR) $(CSRC) $(SSRC) $(CHDR) $(OTHERSRC)
COBJ := $(patsubst %.c,%.o,$(CSRC))
SOBJ := $(patsubst %.S,%.o,$(SSRC))
+# Don't include console objects
+COBJS = $(filter-out rawcon.o plaincon.o,$(COBJ))
+
LIB = libcom32.a
LIBS = $(LIB) --whole-archive $(com32)/lib/libcom32min.a
LIBDEP = $(filter-out -% %start%,$(LIBS))
-LIBOBJS = $(COBJ) $(SOBJ)
+LIBOBJS = $(COBJS) $(SOBJ)
NASMDEBUG = -g -F dwarf
NASMOPT += $(NASMDEBUG)
@@ -92,13 +95,31 @@ kwdhash.gen: keywords genhash.pl
-DHEXDATE="$(HEXDATE)" \
-l $(@:.o=.lsr) -o $@ -MP -MD .$@.d $<
-%.elf: %.o $(LIBDEP) syslinux.ld
- $(LD) $(LDFLAGS) -s -Bsymbolic -pie -E --hash-style=gnu -T syslinux.ld -M -o $@ $< \
- --start-group $(LIBS) --end-group \
+AUXLIBS = libisolinux.a libisolinux-debug.a libldlinux.a libpxelinux.a
+
+%.elf: %.o $(LIBDEP) syslinux.ld $(AUXLIBS)
+ $(LD) $(LDFLAGS) -Bsymbolic -pie -E --hash-style=gnu -T syslinux.ld -M -o $@ $< \
+ --start-group $(LIBS) lib$(patsubst %.elf,%.a,$@) --end-group \
> $(@:.elf=.map)
$(OBJDUMP) -h $@ > $(@:.elf=.sec)
$(PERL) lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
+libisolinux.a: rawcon.o
+ rm -f $@
+ $(AR) cq $@ $^
+ $(RANLIB) $@
+
+libisolinux-debug.a: libisolinux.a
+ cp $^ $@
+
+libpxelinux.a: libisolinux.a
+ cp $^ $@
+
+libldlinux.a: plaincon.o
+ rm -f $@
+ $(AR) cq $@ $^
+ $(RANLIB) $@
+
$(LIB): $(LIBOBJS)
rm -f $@
$(AR) cq $@ $^
More information about the Syslinux-commits
mailing list