aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatt Fleming <matt.fleming@intel.com>2011-11-04 15:02:14 +0000
committerMatt Fleming <matt.fleming@intel.com>2011-12-02 12:13:30 +0000
commit8589c986e0ff312221260f8c1b3f5463ceb691c8 (patch)
tree5a7f79a1f53bd65b6e0a530557ef0ba06d70416a
parenta7d0d5a5a61ee37ce1f45a9cd08e7ac1c78a4c11 (diff)
downloadsyslinux-8589c986e0ff312221260f8c1b3f5463ceb691c8.tar.gz
syslinux-8589c986e0ff312221260f8c1b3f5463ceb691c8.tar.xz
syslinux-8589c986e0ff312221260f8c1b3f5463ceb691c8.zip
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@intel.com>
-rw-r--r--core/Makefile29
1 files changed, 25 insertions, 4 deletions
diff --git a/core/Makefile b/core/Makefile
index 95424dc7..5288da69 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 $@ $^