From: Matt Fleming Date: Fri, 4 Nov 2011 15:02:14 +0000 (+0000) Subject: core: Split core console code into separate libs X-Git-Tag: syslinux-5.00-pre1~31 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=8589c986e0ff312221260f8c1b3f5463ceb691c8;p=platform%2Fupstream%2Fsyslinux.git 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 --- 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 $@ $^