core/pxelinux.0 core/isolinux.bin core/isolinux-debug.bin \
gpxe/gpxelinux.0 dos/syslinux.com win32/syslinux.exe \
memdisk/memdisk memdump/memdump.com
-# BESUBDIRS and IESUBDIRS are "early", i.e. before the root; BSUBDIRS
-# and ISUBDIRS are "late", after the root.
-BESUBDIRS =
-BSUBDIRS = codepage core memdisk com32 mbr memdump gpxe sample dos win32
+
+# BSUBDIRs build the on-target binary components.
+# ISUBDIRs build the installer (host) components.
+#
+# Note: libinstaller is both a BSUBDIR and an ISUBDIR. It contains
+# files that depend only on the B phase, but may have to be regenerated
+# for "make installer".
+BSUBDIRS = codepage core memdisk com32 mbr memdump gpxe sample \
+ libinstaller dos win32
ITARGET =
IOBJECTS = $(ITARGET) dos/copybs.com utils/gethostip utils/mkdiskimage \
mtools/syslinux linux/syslinux extlinux/extlinux
-IESUBDIRS =
-ISUBDIRS = mtools linux extlinux utils
+ISUBDIRS = libinstaller mtools linux extlinux utils
# Things to install in /usr/bin
INSTALL_BIN = mtools/syslinux
memdump/memdump.com com32/menu/*.c32 com32/modules/*.c32
all:
- set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) ; do $(MAKE) -C $$i $@ ; done
$(MAKE) all-local
set -e ; for i in $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
-ls -l $(BOBJECTS) $(IOBJECTS)
all-local: $(BTARGET) $(ITARGET)
installer:
- set -e ; for i in $(IESUBDIRS); do $(MAKE) -C $$i all ; done
$(MAKE) installer-local
set -e ; for i in $(ISUBDIRS); do $(MAKE) -C $$i all ; done
-ls -l $(BOBJECTS) $(IOBJECTS)
# filenames by other users.
CODEPAGE = cp865
-# _bin.c files required by both BTARGET and ITARGET installers
-BINFILES = bootsect_bin.c ldlinux_bin.c \
- extlinux_bss_bin.c extlinux_sys_bin.c
-
-# syslinux.exe is BTARGET so as to not require everyone to have the
-# mingw suite installed
+# The targets to build in this directory...
BTARGET = kwdhash.gen \
ldlinux.bss ldlinux.sys ldlinux.bin \
pxelinux.0 isolinux.bin isolinux-debug.bin \
extlinux.bin extlinux.bss extlinux.sys
-ITARGET =
# All primary source files for the main syslinux files
NASMSRC = $(wildcard *.asm)
DATE := $(HEXDATE)
endif
-#
-# NOTE: If you don't have the mingw compiler suite installed, you probably
-# want to remove win32 from this list; otherwise you're going to get an
-# error every time you try to build.
-#
-
-all: all-local
-
-all-local: $(BTARGET) $(BINFILES)
-
-installer: installer-local
-
-installer-local: $(ITARGET) $(BINFILES)
+all: $(BTARGET)
kwdhash.gen: keywords genhash.pl
$(PERL) genhash.pl < keywords > kwdhash.gen
extlinux.sys: extlinux.bin
dd if=$< of=$@ bs=512 skip=1
-bootsect_bin.c: ldlinux.bss ../bin2c.pl
- $(PERL) ../bin2c.pl syslinux_bootsect < $< > $@
-
-ldlinux_bin.c: ldlinux.sys ../bin2c.pl
- $(PERL) ../bin2c.pl syslinux_ldlinux < $< > $@
-
-extlinux_bss_bin.c: extlinux.bss ../bin2c.pl
- $(PERL) ../bin2c.pl extlinux_bootsect < $< > $@
-
-extlinux_sys_bin.c: extlinux.sys ../bin2c.pl
- $(PERL) ../bin2c.pl extlinux_image 512 < $< > $@
-
# NASM prior to 2.03 wouldn't auto-generate this dependency...
ldlinux.o: codepage.cp
rm -f $(OBSOLETE)
clean: tidy
- rm -f $(ITARGET)
spotless: clean
rm -f $(BTARGET) *_bin.c .depend
SRCS = syslinux.c \
../libinstaller/syslxmod.c \
- ../core/bootsect_bin.c ../core/ldlinux_bin.c ../mbr/mbr_bin.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinux_bin.c \
+ ../libinstaller/mbr_bin.c \
$(wildcard ../libfat/*.c)
OBJS = crt0.o $(patsubst %.c,%.o,$(notdir $(SRCS)))
LIBOBJS = conio.o memcpy.o memset.o skipatou.o atou.o malloc.o free.o \
.SUFFIXES: .c .o .i .s .S .elf .com .asm .lst
-VPATH = .:../libfat:../libinstaller:../core:../mbr
+VPATH = .:../libfat:../libinstaller
TARGETS = syslinux.com copybs.com
CFLAGS = -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
LDFLAGS = $(LDHASH) # -s
-SRCS = main.c ../libinstaller/setadv.c \
- ../core/extlinux_bss_bin.c ../core/extlinux_sys_bin.c
+SRCS = main.c \
+ ../libinstaller/setadv.c \
+ ../libinstaller/extlinux_bss_bin.c \
+ ../libinstaller/extlinux_sys_bin.c
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
.SUFFIXES: .c .o .i .s .S
-VPATH = .:../libinstaller:../core
+VPATH = .:../libinstaller
all: installer
--- /dev/null
+# _bin.c files required by both BTARGET and ITARGET installers
+BINFILES = bootsect_bin.c ldlinux_bin.c \
+ extlinux_bss_bin.c extlinux_sys_bin.c \
+ mbr_bin.c gptmbr_bin.c
+
+PERL = perl
+
+all: $(BINFILES)
+
+bootsect_bin.c: ../core/ldlinux.bss bin2c.pl
+ $(PERL) bin2c.pl syslinux_bootsect < $< > $@
+
+ldlinux_bin.c: ../core/ldlinux.sys bin2c.pl
+ $(PERL) bin2c.pl syslinux_ldlinux < $< > $@
+
+extlinux_bss_bin.c: ../core/extlinux.bss bin2c.pl
+ $(PERL) bin2c.pl extlinux_bootsect < $< > $@
+
+extlinux_sys_bin.c: ../core/extlinux.sys bin2c.pl
+ $(PERL) bin2c.pl extlinux_image 512 < $< > $@
+
+mbr_bin.c: ../mbr/mbr.bin bin2c.pl
+ $(PERL) bin2c.pl syslinux_mbr < $< > $@
+
+gptmbr_bin.c: ../mbr/gptmbr.bin bin2c.pl
+ $(PERL) bin2c.pl syslinux_gptmbr < $< > $@
+
+tidy:
+ rm -f $(BINFILES)
+
+clean: tidy
+
+dist: tidy
+
+spotless: clean
CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
LDFLAGS = $(LDHASH) -s
-SRCS = syslinux.c ../libinstaller/syslxmod.c \
- ../core/bootsect_bin.c ../core/ldlinux_bin.c
+SRCS = syslinux.c \
+ ../libinstaller/syslxmod.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinux_bin.c
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
.SUFFIXES: .c .o .i .s .S
-VPATH = .:../libinstaller:../core
+VPATH = .:../libinstaller
all: installer
.SUFFIXES: .S .s .o .elf
-all: mbr.bin mbr_bin.c gptmbr.bin gptmbr_bin.c
+all: mbr.bin gptmbr.bin
.PRECIOUS: %.o
%.o: %.S
$(CC) $(SFLAGS) -Wa,-a=$*.lst -c -o $@ $<
-%_bin.c: %.bin ../bin2c.pl
- $(PERL) ../bin2c.pl syslinux_$* < $< > $@
-
mbr.elf: mbr.o mbr.ld
$(LD) $(LDFLAGS) -T mbr.ld -e _start -o $@ $<
$(PERL) checksize.pl gptmbr.bin 424
tidy dist:
- rm -f *.o *.elf *.lst *_bin.c
+ rm -f *.o *.elf *.lst
clean: tidy
CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
LDFLAGS = $(LDHASH) -s
-SRCS = syslinux.c ../libinstaller/syslxmod.c \
- ../core/bootsect_bin.c ../core/ldlinux_bin.c \
+SRCS = syslinux.c \
+ ../libinstaller/syslxmod.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinux_bin.c \
$(wildcard ../libfat/*.c)
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
.SUFFIXES: .c .o .i .s .S
-VPATH = .:../libfat:../libinstaller:../core
+VPATH = .:../libfat:../libinstaller
all: installer
.SUFFIXES: .c .o .i .s .S
-SRCS = syslinux.c ../libinstaller/syslxmod.c \
- ../core/bootsect_bin.c ../core/ldlinux_bin.c \
- ../mbr/mbr_bin.c $(wildcard ../libfat/*.c)
+SRCS = syslinux.c \
+ ../libinstaller/syslxmod.c \
+ ../libinstaller/bootsect_bin.c \
+ ../libinstaller/ldlinux_bin.c \
+ ../libinstaller/mbr_bin.c \
+ $(wildcard ../libfat/*.c)
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
-VPATH = .:../libfat:../libinstaller:../core:../mbr
+VPATH = .:../libfat:../libinstaller
TARGETS = syslinux.exe