CC = gcc
INCLUDE =
CFLAGS = -Wall -O2 -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
+PIC = -fPIC
LDFLAGS = -O2 -s
AR = ar
RANLIB = ranlib
.c.o:
$(CC) $(INCLUDE) $(CFLAGS) -c $<
+# libsyslinux.so
+LIB_SONAME = libsyslinux.so.2
+LIB_SO = libsyslinux.so.$(VERSION)
+
#
# The BTARGET refers to objects that are derived from ldlinux.asm; we
# like to keep those uniform for debugging reasons; however, distributors
pxelinux.asm mbr.asm isolinux.asm isolinux-debug.asm
SOURCES = $(CSRC) *.h $(NASMSRC) *.inc
BTARGET = kwdhash.gen version.gen ldlinux.bss ldlinux.sys ldlinux.bin \
- pxelinux.0 mbr.bin isolinux.bin isolinux-debug.bin libsyslinux.a
+ pxelinux.0 mbr.bin isolinux.bin isolinux-debug.bin \
+ libsyslinux.a $(LIB_SO)
ITARGET = syslinux.com syslinux syslinux-nomtools copybs.com gethostip \
mkdiskimage
DOCS = COPYING NEWS README TODO *.doc sample com32
INSTALL_AUX = pxelinux.0 isolinux.bin isolinux-debug.bin \
syslinux.com copybs.com memdisk/memdisk
# Things to install in /usr/lib
-INSTALL_LIB = libsyslinux.a
+INSTALL_LIB = $(LIB_SO) libsyslinux.a
# Things to install in /usr/include
INSTALL_INC = syslinux.h
$(AR) cq $@ $^
$(RANLIB) $@
+$(LIB_SO): bootsect_bin.o ldlinux_bin.o syslxmod.o
+ $(CC) $(LDFLAGS) -shared -Wl,-soname,$(LIB_SONAME) -o $@ $^
+
syslinux: syslinux.o libsyslinux.a
$(CC) $(LDFLAGS) -o $@ $^
$(CC) $(LDFLAGS) -o $@ $^
syslxmod.o: syslxmod.c patch.offset
- $(CC) $(INCLUDE) $(CFLAGS) -DPATCH_OFFSET=`cat patch.offset` \
+ $(CC) $(INCLUDE) $(CFLAGS) $(PIC) -DPATCH_OFFSET=`cat patch.offset` \
-c -o $@ $<
gethostip.o: gethostip.c
mkdir -m 755 -p $(INSTALLROOT)$(LIBDIR) $(INSTALLDIR)$(INCDIR)
install -m 644 -c $(INSTALL_LIB) $(INSTALLROOT)$(LIBDIR)
install -m 644 -c $(INSTALL_INC) $(INSTALLROOT)$(INCDIR)
+ cd $(INSTALLROOT)$(LIBDIR) && ln -sf $(LIB_SO) libsyslinux.so
+ ldconfig
install-all: install install-all
done
local-spotless:
- rm -f $(BTARGET) .depend
+ rm -f $(BTARGET) .depend *.so.*
spotless: local-clean dist local-spotless
$(MAKE) -C sample spotless
* MEMDISK: Fix installing the E820 memory map. Calling
INT 15h AX=0E820h with MEMDISK 2.03 loaded would give a
completely corrupt memory map.
+ * SYSLINUX: Make libsyslinux a dynamic library, so that it can
+ be updated separately from client programs. The whole idea,
+ after all, is to enable alternate programs to become
+ syslinux installers.
Changes in 2.03:
* Actually support comment lines in the configuration file.