aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-06-27 19:15:00 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-06-27 19:15:00 -0700
commit6c9b3fcb03f5597954e00ef3303c769baf1336a6 (patch)
tree688c44db2524d32783321e6b8dd4908282319a38
parent34763a8075ac5f9a7f5ea3d3e420d1efc67c4441 (diff)
downloadlwip-6c9b3fcb03f5597954e00ef3303c769baf1336a6.tar.gz
lwip-6c9b3fcb03f5597954e00ef3303c769baf1336a6.tar.xz
lwip-6c9b3fcb03f5597954e00ef3303c769baf1336a6.zip
Build _bin.c files in libinstaller; clean up B/I separation
Clean up the BSUBDIR/ISUBDIR separation further. Build _bin.c files, which are an intermediate stage toward building the installers, in the libinstaller directory, since that directory is used by all the installers anyway. That also lets us get bin2c.pl out of the root.
-rw-r--r--Makefile18
-rw-r--r--core/Makefile35
-rw-r--r--dos/Makefile6
-rw-r--r--extlinux/Makefile8
-rw-r--r--libinstaller/Makefile35
-rwxr-xr-x[-rw-r--r--]libinstaller/bin2c.pl (renamed from bin2c.pl)0
-rw-r--r--linux/Makefile8
-rw-r--r--mbr/Makefile7
-rw-r--r--mtools/Makefile8
-rw-r--r--win32/Makefile11
10 files changed, 75 insertions, 61 deletions
diff --git a/Makefile b/Makefile
index 2be53894..1a073b27 100644
--- a/Makefile
+++ b/Makefile
@@ -37,15 +37,19 @@ BOBJECTS = $(BTARGET) \
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
@@ -71,7 +75,6 @@ NETINSTALLABLE = core/pxelinux.0 gpxe/gpxelinux.0 memdisk/memdisk \
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)
@@ -79,7 +82,6 @@ all:
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)
diff --git a/core/Makefile b/core/Makefile
index ccbb0556..9700ea23 100644
--- a/core/Makefile
+++ b/core/Makefile
@@ -50,17 +50,11 @@ VERSION := $(shell cat ../version)
# 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)
@@ -80,19 +74,7 @@ ifndef DATE
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
@@ -133,18 +115,6 @@ extlinux.bss: extlinux.bin
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
@@ -165,7 +135,6 @@ tidy dist:
rm -f $(OBSOLETE)
clean: tidy
- rm -f $(ITARGET)
spotless: clean
rm -f $(BTARGET) *_bin.c .depend
diff --git a/dos/Makefile b/dos/Makefile
index 85df1509..29c1137b 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -25,7 +25,9 @@ LIBGCC := $(shell $(CC) --print-libgcc)
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 \
@@ -33,7 +35,7 @@ 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
diff --git a/extlinux/Makefile b/extlinux/Makefile
index dec87396..ec212d68 100644
--- a/extlinux/Makefile
+++ b/extlinux/Makefile
@@ -12,13 +12,15 @@ INCLUDES = -I. -I.. -I../libinstaller
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
diff --git a/libinstaller/Makefile b/libinstaller/Makefile
new file mode 100644
index 00000000..ef3711dd
--- /dev/null
+++ b/libinstaller/Makefile
@@ -0,0 +1,35 @@
+# _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
diff --git a/bin2c.pl b/libinstaller/bin2c.pl
index 5a60ca9e..5a60ca9e 100644..100755
--- a/bin2c.pl
+++ b/libinstaller/bin2c.pl
diff --git a/linux/Makefile b/linux/Makefile
index 678dc9be..e354171b 100644
--- a/linux/Makefile
+++ b/linux/Makefile
@@ -12,13 +12,15 @@ INCLUDES = -I. -I.. -I../libinstaller
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
diff --git a/mbr/Makefile b/mbr/Makefile
index 07e0d94a..d479265c 100644
--- a/mbr/Makefile
+++ b/mbr/Makefile
@@ -30,15 +30,12 @@ PERL = perl
.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 $@ $<
@@ -56,7 +53,7 @@ gptmbr.bin: gptmbr.elf checksize.pl
$(PERL) checksize.pl gptmbr.bin 424
tidy dist:
- rm -f *.o *.elf *.lst *_bin.c
+ rm -f *.o *.elf *.lst
clean: tidy
diff --git a/mtools/Makefile b/mtools/Makefile
index d3cdf81e..9e9e5114 100644
--- a/mtools/Makefile
+++ b/mtools/Makefile
@@ -12,14 +12,16 @@ INCLUDES = -I. -I.. -I../libfat -I../libinstaller
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
diff --git a/win32/Makefile b/win32/Makefile
index 99766151..fe94d1e4 100644
--- a/win32/Makefile
+++ b/win32/Makefile
@@ -47,12 +47,15 @@ WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) -o hello.exe hello.
.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