Browse files

Move files out of root into core, dos, and utils

Move source files out of the root directory; the root is a mess and
has become virtually unmaintainable.  The Syslinux core now lives in
core/; the Linux and generic utilities has moved into utils/, and
copybs.com has moved into dos/; it had to go somewhere, and it seemed
as good a place as any.
  • Loading branch information...
1 parent 3ec40a0 commit b536209dfb7bd50c37061735fe10d2c19a97d26d H. Peter Anvin committed May 29, 2008
Showing with 354 additions and 252 deletions.
  1. +6 −4 .gitignore
  2. +26 −129 Makefile
  3. +0 −80 checkov.pl
  4. +1 −1 com32/Makefile
  5. +1 −1 com32/lib/Makefile
  6. +1 −1 com32/libutil/Makefile
  7. +1 −1 com32/menu/Makefile
  8. +1 −1 com32/modules/Makefile
  9. +1 −1 com32/samples/Makefile
  10. +174 −0 core/Makefile
  11. 0 { → core}/abort.inc
  12. 0 { → core}/adv.inc
  13. 0 { → core}/bcopy32.inc
  14. 0 { → core}/bios.inc
  15. 0 { → core}/bootsect.inc
  16. 0 { → core}/cache.inc
  17. 0 { → core}/checksumiso.pl
  18. 0 { → core}/cleanup.inc
  19. 0 { → core}/cmdline.inc
  20. 0 { → core}/com32.inc
  21. 0 { → core}/comboot.inc
  22. +1 −1 { → core}/config.inc
  23. 0 { → core}/configinit.inc
  24. 0 { → core}/conio.inc
  25. 0 { → core}/cpuinit.inc
  26. 0 { → core}/dnsresolv.inc
  27. 0 { → core}/ext2_fs.inc
  28. 0 { → core}/extlinux.asm
  29. 0 { → core}/font.inc
  30. 0 { → core}/genhash.pl
  31. 0 { → core}/getc.inc
  32. 0 { → core}/graphics.inc
  33. +1 −0 { → core}/head.inc
  34. 0 { → core}/highmem.inc
  35. 0 { → core}/init.inc
  36. 0 { → core}/isolinux-debug.asm
  37. 0 { → core}/isolinux.asm
  38. 0 { → core}/kernel.inc
  39. 0 { → core}/keywords
  40. 0 { → core}/keywords.inc
  41. 0 { → core}/layout.inc
  42. 0 { → core}/ldlinux.asm
  43. 0 { → core}/loadhigh.inc
  44. 0 { → core}/localboot.inc
  45. 0 { → core}/lstadjust.pl
  46. 0 { → core}/macros.inc
  47. 0 { → core}/now.pl
  48. 0 { → core}/parsecmd.inc
  49. 0 { → core}/parseconfig.inc
  50. 0 { → core}/plaincon.inc
  51. 0 { → core}/pxe.inc
  52. 0 { → core}/pxelinux.asm
  53. 0 { → core}/rawcon.inc
  54. 0 { → core}/regdump.inc
  55. 0 { → core}/rllpack.inc
  56. 0 { → core}/runkernel.inc
  57. 0 { → core}/stack.inc
  58. 0 { → core}/strcpy.inc
  59. 0 { → core}/strecpy.inc
  60. 0 { → core}/syslinux.ld
  61. 0 { → core}/tracers.inc
  62. 0 { → core}/ui.inc
  63. 0 { → core}/writehex.inc
  64. 0 { → core}/writestr.inc
  65. +13 −8 dos/Makefile
  66. 0 { → dos}/copybs.asm
  67. +3 −3 extlinux/Makefile
  68. +37 −0 gpxe/Makefile
  69. +1 −1 gpxe/src/Config
  70. +3 −3 {unix → linux}/Makefile
  71. 0 {unix → linux}/syslinux.c
  72. +11 −5 mbr/Makefile
  73. +1 −1 memdisk/Makefile
  74. +1 −1 memdump/Makefile
  75. +1 −1 menu/Makefile
  76. +4 −3 mtools/Makefile
  77. +2 −2 sample/Makefile
  78. +58 −0 utils/Makefile
  79. 0 { → utils}/bin2hex.pl
  80. 0 { → utils}/gethostip.c
  81. 0 keytab-lilo.pl → utils/keytab-lilo
  82. 0 { → utils}/lss16toppm
  83. 0 { → utils}/md5pass
  84. 0 { → utils}/mkdiskimage.in
  85. 0 { → utils}/ppmtolss16
  86. 0 { → utils}/sha1pass
  87. 0 syslinux2ansi.pl → utils/syslinux2ansi
  88. +5 −4 win32/Makefile
View
10 .gitignore
@@ -21,15 +21,17 @@
*.sys
*_bin.c
*~
+\#*
+.\#*
.depend
com32/lib/sys/vesa/alphatbl.c
extlinux/extlinux
-gethostip
memdisk/memdisk
-mkdiskimage
mtools/syslinux
release
sample/syslogo.lss
-unix/syslinux
-unix/syslinux-nomtools
+linux/syslinux
+linux/syslinux-nomtools
+utils/gethostip
+utils/mkdiskimage
version.h
View
155 Makefile
@@ -20,14 +20,15 @@ MAKE += -r
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+CC = gcc
+
gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) dummy.c -o $$tmpf 2>/dev/null; \
then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
comma := ,
LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
OSTYPE = $(shell uname -msr)
-CC = gcc
INCLUDE =
CFLAGS = -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
PIC = -fPIC
@@ -66,71 +67,43 @@ VERSION = $(shell cat version)
# with their own Makefiles. Finally, there is a list of those
# directories.
#
-CSRC = gethostip.c
-NASMSRC = $(wildcard *.asm)
-SOURCES = $(CSRC) *.h $(NASMSRC) *.inc
-
-# _bin.c files required by both BTARGET and ITARGET installers
-BINFILES = bootsect_bin.c ldlinux_bin.c mbr_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
-BTARGET = kwdhash.gen version.gen version.h \
- ldlinux.bss ldlinux.sys ldlinux.bin \
- pxelinux.0 gpxelinux.0 isolinux.bin isolinux-debug.bin \
- extlinux.bin extlinux.bss extlinux.sys
-BOBJECTS = $(BTARGET) mbr/mbr.bin dos/syslinux.com win32/syslinux.exe \
+BTARGET = version.gen version.h
+BOBJECTS = $(BTARGET) \
+ mbr/mbr.bin mbr/gptmbr.bin \
+ 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 = mbr
-BSUBDIRS = memdisk memdump dos win32
-ITARGET = copybs.com gethostip mkdiskimage
-IOBJECTS = $(ITARGET) mtools/syslinux unix/syslinux extlinux/extlinux
+BESUBDIRS = mbr core
+BSUBDIRS = memdisk memdump gpxe dos win32
+ITARGET =
+IOBJECTS = $(ITARGET) dos/copybs.com utils/gethostip utils/mkdiskimage \
+ mtools/syslinux linux/syslinux extlinux/extlinux
IESUBDIRS =
-ISUBDIRS = mtools unix extlinux sample com32
-DOCS = COPYING NEWS README TODO BUGS *.doc sample menu com32
-OTHER = Makefile bin2c.pl now.pl genhash.pl keywords findpatch.pl \
- keytab-lilo.pl version version.pl sys2ansi.pl \
- ppmtolss16 lss16toppm memdisk bin2hex.pl mkdiskimage.in \
- sha1pass md5pass
-OBSOLETE = pxelinux.bin
+ISUBDIRS = mtools linux extlinux utils com32 sample
# Things to install in /usr/bin
-INSTALL_BIN = mtools/syslinux gethostip ppmtolss16 lss16toppm \
- sha1pass md5pass
+INSTALL_BIN = mtools/syslinux utils/gethostip utils/ppmtolss16 \
+ utils/lss16toppm utils/sha1pass utils/md5pass
# Things to install in /sbin
INSTALL_SBIN = extlinux/extlinux
# Things to install in /usr/lib/syslinux
-INSTALL_AUX = pxelinux.0 gpxelinux.0 isolinux.bin isolinux-debug.bin \
- dos/syslinux.com copybs.com memdisk/memdisk mbr/mbr.bin
+INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 core/isolinux.bin \
+ core/isolinux-debug.bin \
+ dos/syslinux.com dos/copybs.com memdisk/memdisk mbr/mbr.bin
INSTALL_AUX_OPT = win32/syslinux.exe
-# The DATE is set on the make command line when building binaries for
-# official release. Otherwise, substitute a hex string that is pretty much
-# guaranteed to be unique to be unique from build to build.
-ifndef HEXDATE
-HEXDATE := $(shell $(PERL) now.pl ldlinux.asm pxelinux.asm isolinux.asm)
-endif
-ifndef DATE
-DATE := $(HEXDATE)
-endif
-MAKE += DATE=$(DATE) HEXDATE=$(HEXDATE)
-
-#
-# 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:
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) $(BINFILES)
+all-local: $(BTARGET) $(ITARGET)
installer:
set -e ; for i in $(IESUBDIRS); do $(MAKE) -C $$i all ; done
@@ -146,74 +119,6 @@ version.gen: version version.pl
version.h: version version.pl
$(PERL) version.pl $< $@ '#define'
-kwdhash.gen: keywords genhash.pl
- $(PERL) genhash.pl < keywords > kwdhash.gen
-
-.PRECIOUS: %.elf
-
-# Standard rule for {isolinux,isolinux-debug}.bin
-iso%.bin: iso%.elf
- $(OBJCOPY) -O binary $< $@
- $(PERL) checksumiso.pl $@
-
-# Standard rule for {ldlinux,pxelinux,extlinux}.bin
-%.bin: %.elf
- $(OBJCOPY) -O binary $< $@
-
-%.o: %.asm kwdhash.gen version.gen
- $(NASM) $(NASMOPT) -f elf -F stabs -DDATE_STR="'$(DATE)'" \
- -DHEXDATE="$(HEXDATE)" \
- -l $(@:.o=.lsr) -o $@ $<
-
-%.elf: %.o syslinux.ld
- $(LD) -m elf_i386 -T syslinux.ld -M -o $@ $< > $(@:.elf=.map)
- $(OBJDUMP) -h $@ > $(@:.elf=.sec)
- $(PERL) lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
-
-pxelinux.0: pxelinux.bin
- cp -f $< $@
-
-gpxelinux.0: pxelinux.0
- $(MAKE) -C gpxe/src bin/undionly.kpxe
- cp -f gpxe/src/bin/undionly.kpxe $@
-
-ldlinux.bss: ldlinux.bin
- dd if=$< of=$@ bs=512 count=1
-
-ldlinux.sys: ldlinux.bin
- dd if=$< of=$@ bs=512 skip=1
-
-extlinux.bss: extlinux.bin
- dd if=$< of=$@ bs=512 count=1
-
-extlinux.sys: extlinux.bin
- dd if=$< of=$@ bs=512 skip=1
-
-mbr_bin.c: mbr/mbr.bin bin2c.pl
- $(PERL) bin2c.pl syslinux_mbr < $< > $@
-
-copybs.com: copybs.asm
- $(NASM) $(NASMOPT) -f bin -l copybs.lst -o copybs.com copybs.asm
-
-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 < $< > $@
-
-gethostip: gethostip.o
- $(CC) $(LDFLAGS) -o $@ $^
-
-mkdiskimage: mkdiskimage.in mbr/mbr.bin bin2hex.pl
- $(PERL) bin2hex.pl < mbr/mbr.bin | cat mkdiskimage.in - > $@
- chmod a+x $@
-
install: installer
mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
install -m 755 -c $(INSTALL_BIN) $(INSTALLROOT)$(BINDIR)
@@ -246,44 +151,36 @@ local-tidy:
tidy: local-tidy
set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
- $(MAKE) -C gpxe/src veryclean
local-clean:
rm -f $(ITARGET)
clean: local-tidy local-clean
set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
-dist: tidy
+local-dist:
find . \( -name '*~' -o -name '#*' -o -name core \
-o -name '.*.d' -o -name .depend \) -type f -print0 \
| xargs -0rt rm -f
+dist: local-dist local-tidy
+ set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
+
local-spotless:
rm -f $(BTARGET) .depend *.so.*
-spotless: local-clean dist local-spotless
+spotless: local-clean local-dist local-spotless
set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
-.depend:
- rm -f .depend
- for csrc in $(CSRC) ; do $(CC) $(INCLUDE) -MM $$csrc >> .depend ; done
- for nsrc in $(NASMSRC) ; do $(NASM) -DDEPEND $(NINCLUDE) -o `echo $$nsrc | sed -e 's/\.asm/\.o/'` -M $$nsrc >> .depend ; done
-
local-depend:
- rm -f .depend
- $(MAKE) .depend
depend: local-depend
$(MAKE) -C memdisk depend
-# Shortcut to build unix/syslinux using klibc
+# Shortcut to build linux/syslinux using klibc
klibc:
$(MAKE) clean
- $(MAKE) CC=klcc ITARGET= ISUBDIRS='unix extlinux' BSUBDIRS=
+ $(MAKE) CC=klcc ITARGET= ISUBDIRS='linux extlinux' BSUBDIRS=
# Hook to add private Makefile targets for the maintainer.
-include Makefile.private
-
-# Include dependencies file
-include .depend
View
80 checkov.pl
@@ -1,80 +0,0 @@
-#!/usr/bin/perl
-#
-# checkov.pl
-#
-# Check NASM map output for overflow
-#
-# This assumes that a section for which start != vstart, both
-# ranges need to be checked for overflow (true for SYSLINUX)
-#
-
-($in, $target) = @ARGV;
-
-sub overlap($$$$) {
- my($s1,$e1,$s2,$e2) = @_;
-
- return 1 if ( $s2 < $e1 && $e2 > $s1 );
- return 1 if ( $s1 < $e2 && $e1 > $s2 );
-
- return 0;
-}
-
-open(IN, '<', $in) or die "$0: Cannot open input file: $in\n";
-
-$section = undef;
-while ( $line = <IN> ) {
- if ( $line =~ /^-/ ) {
- if ( $line =~ /^\-\-\-\- Section (\S+) / ) {
- $section = $1;
- } else {
- $section = undef;
- }
- } elsif ( defined($section) ) {
- if ( $line =~ /^length\:\s*(\S+)/ ) {
- $length{$section} = hex $1;
- } elsif ( $line =~ /^start\:\s*(\S+)/ ) {
- $start{$section} = hex $1;
- } elsif ( $line =~ /^vstart\:\s*(\S+)/ ) {
- $vstart{$section} = hex $1;
- }
- }
-}
-close(IN);
-
-$err = 0;
-
-foreach $s ( keys(%start) ) {
- $sstart = $start{$s};
- $svstart = $vstart{$s};
- $send = $sstart + $length{$s};
- $svend = $svstart + $length{$s};
-
- if ( $send > 0x10000 || $svend > 0x10000 ) {
- print STDERR "$target: 16-bit overflow on section $s\n";
- $err++;
- }
-
- foreach $o ( keys(%start) ) {
- next if ( $s ge $o );
-
- $ostart = $start{$o};
- $ovstart = $vstart{$o};
- $oend = $ostart + $length{$o};
- $ovend = $ovstart + $length{$o};
-
- if ( overlap($sstart, $send, $ostart, $oend) ||
- overlap($svstart, $svend, $ostart, $oend) ||
- overlap($sstart, $send, $ovstart, $ovend) ||
- overlap($svstart, $svend, $ovstart, $ovend) ) {
- print STDERR "$target: section $s overlaps section $o\n";
- $err++;
- }
- }
-}
-
-if ( $err ) {
- unlink($target);
- exit(1);
-} else {
- exit(0);
-}
View
2 com32/Makefile
@@ -1,4 +1,4 @@
SUBDIRS = lib libutil modules menu samples
-all tidy clean spotless install:
+all tidy dist clean spotless install:
set -e; for d in $(SUBDIRS); do $(MAKE) -C $$d $@; done
View
2 com32/lib/Makefile
@@ -107,7 +107,7 @@ libcom32.a : $(LIBOBJS)
$(AR) cq $@ $^
$(RANLIB) $@
-tidy:
+tidy dist:
rm -f sys/vesa/alphatbl.c
find . -name \*.o -print | xargs -r rm -f
find . -name .\*.d -print | xargs -r rm -f
View
2 com32/libutil/Makefile
@@ -104,7 +104,7 @@ libutil_lnx.a: $(LNXLIBOBJS)
%.c32: %.elf
$(OBJCOPY) -O binary $< $@
-tidy:
+tidy dist:
rm -f *.o *.lo *.lst *.elf .*.d
clean: tidy
View
2 com32/menu/Makefile
@@ -92,7 +92,7 @@ menu.elf : menu.o $(COMMONOBJS) $(LIBS)
vesamenu.elf : vesamenu.o $(COMMONOBJS) $(LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-tidy:
+tidy dist:
rm -f *.o *.lo *.a *.lst *.elf .*.d
clean: tidy
View
2 com32/modules/Makefile
@@ -98,7 +98,7 @@ dmitest.elf : dmitest.o dmi_utils.o dmi.o $(LIBS)
ethersel.elf : ethersel.o $(LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-tidy:
+tidy dist:
rm -f *.o *.lo *.a *.lst *.elf .*.d
clean: tidy
View
2 com32/samples/Makefile
@@ -78,7 +78,7 @@ all: hello.c32 cat.c32 resolv.c32 vesainfo.c32 serialinfo.c32 \
%.c32: %.elf
$(OBJCOPY) -O binary $< $@
-tidy:
+tidy dist:
rm -f *.o *.lo *.a *.lst *.elf .*.d
clean: tidy
View
174 core/Makefile
@@ -0,0 +1,174 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+#
+# Makefile for the SYSLINUX core
+#
+
+# No builtin rules
+MAKEFLAGS += -r
+MAKE += -r
+
+CC = gcc
+
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) dummy.c -o $$tmpf 2>/dev/null; \
+ then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
+
+M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) \
+ $(call gcc_ok,-fno-stack-protector,) \
+ $(call gcc_ok,-fno-top-level-reorder,$(call gcc_ok,-fno-unit-at-a-time))
+
+LD = ld
+LDFLAGS = -m elf_i386
+OBJCOPY = objcopy
+OBJDUMP = objdump
+
+OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
+INCLUDES =
+CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -msoft-float $(OPTFLAGS) $(INCLUDES)
+
+NASM = nasm
+NASMOPT = -O9999
+NINCLUDE =
+
+PERL = perl
+
+VERSION := $(shell cat ../version)
+
+# _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
+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)
+NASMHDR = $(wildcard *.inc)
+CSRC = $(wildcard *.c)
+CHDR = $(wildcard *.h)
+OTHERSRC = keywords
+ALLSRC = $(NASMSRC) $(NASMHDR) $(CSRC) $(CHDR) $(OTHERSRC)
+
+# The DATE is set on the make command line when building binaries for
+# official release. Otherwise, substitute a hex string that is pretty much
+# guaranteed to be unique to be unique from build to build.
+ifndef HEXDATE
+HEXDATE := $(shell $(PERL) now.pl $(SRCS))
+endif
+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)
+
+kwdhash.gen: keywords genhash.pl
+ $(PERL) genhash.pl < keywords > kwdhash.gen
+
+.PRECIOUS: %.elf
+
+# Standard rule for {isolinux,isolinux-debug}.bin
+iso%.bin: iso%.elf
+ $(OBJCOPY) -O binary $< $@
+ $(PERL) checksumiso.pl $@
+
+# Standard rule for {ldlinux,pxelinux,extlinux}.bin
+%.bin: %.elf
+ $(OBJCOPY) -O binary $< $@
+
+%.o: %.asm kwdhash.gen ../version.gen
+ $(NASM) $(NASMOPT) -f elf -F stabs -DDATE_STR="'$(DATE)'" \
+ -DHEXDATE="$(HEXDATE)" \
+ -l $(@:.o=.lsr) -o $@ $<
+
+%.elf: %.o syslinux.ld
+ $(LD) $(LDFLAGS) -T syslinux.ld -M -o $@ $< > $(@:.elf=.map)
+ $(OBJDUMP) -h $@ > $(@:.elf=.sec)
+ $(PERL) lstadjust.pl $(@:.elf=.lsr) $(@:.elf=.sec) $(@:.elf=.lst)
+
+pxelinux.0: pxelinux.bin
+ cp -f $< $@
+
+ldlinux.bss: ldlinux.bin
+ dd if=$< of=$@ bs=512 count=1
+
+ldlinux.sys: ldlinux.bin
+ dd if=$< of=$@ bs=512 skip=1
+
+extlinux.bss: extlinux.bin
+ dd if=$< of=$@ bs=512 count=1
+
+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 < $< > $@
+
+install: installer
+
+install-lib: installer
+
+install-all: install install-lib
+
+netinstall: installer
+
+tidy dist:
+ rm -f *.o *.elf *_bin.c stupid.* patch.offset
+ rm -f *.lsr *.lst *.map *.sec
+ rm -f $(OBSOLETE)
+
+clean: tidy
+ rm -f $(ITARGET)
+
+spotless: clean
+ rm -f $(BTARGET) .depend *.so.*
+
+.depend:
+ rm -f .depend
+ for csrc in $(CSRC) ; do $(CC) $(INCLUDE) -MM $$csrc >> .depend ; done
+ for nsrc in $(NASMSRC) ; do $(NASM) -DDEPEND $(NINCLUDE) -o `echo $$nsrc | sed -e 's/\.asm/\.o/'` -M $$nsrc >> .depend ; done
+
+local-depend:
+ rm -f .depend
+ $(MAKE) .depend
+
+depend: local-depend
+
+# Include dependencies file
+include .depend
View
0 abort.inc → core/abort.inc
File renamed without changes.
View
0 adv.inc → core/adv.inc
File renamed without changes.
View
0 bcopy32.inc → core/bcopy32.inc
File renamed without changes.
View
0 bios.inc → core/bios.inc
File renamed without changes.
View
0 bootsect.inc → core/bootsect.inc
File renamed without changes.
View
0 cache.inc → core/cache.inc
File renamed without changes.
View
0 checksumiso.pl → core/checksumiso.pl
File renamed without changes.
View
0 cleanup.inc → core/cleanup.inc
File renamed without changes.
View
0 cmdline.inc → core/cmdline.inc
File renamed without changes.
View
0 com32.inc → core/com32.inc
File renamed without changes.
View
0 comboot.inc → core/comboot.inc
File renamed without changes.
View
2 config.inc → core/config.inc
@@ -47,7 +47,7 @@ MAX_FKEYS equ 12 ; Number of F-key help files
; Version number definitinons
;
%ifndef DEPEND ; Generated file
-%include "version.gen"
+%include "../version.gen"
%endif
;
View
0 configinit.inc → core/configinit.inc
File renamed without changes.
View
0 conio.inc → core/conio.inc
File renamed without changes.
View
0 cpuinit.inc → core/cpuinit.inc
File renamed without changes.
View
0 dnsresolv.inc → core/dnsresolv.inc
File renamed without changes.
View
0 ext2_fs.inc → core/ext2_fs.inc
File renamed without changes.
View
0 extlinux.asm → core/extlinux.asm
File renamed without changes.
View
0 font.inc → core/font.inc
File renamed without changes.
View
0 genhash.pl → core/genhash.pl
File renamed without changes.
View
0 getc.inc → core/getc.inc
File renamed without changes.
View
0 graphics.inc → core/graphics.inc
File renamed without changes.
View
1 head.inc → core/head.inc
@@ -18,6 +18,7 @@
;
%ifndef _HEAD_INC
+%define _HEAD_INC
%include "macros.inc"
%include "config.inc"
View
0 highmem.inc → core/highmem.inc
File renamed without changes.
View
0 init.inc → core/init.inc
File renamed without changes.
View
0 isolinux-debug.asm → core/isolinux-debug.asm
File renamed without changes.
View
0 isolinux.asm → core/isolinux.asm
File renamed without changes.
View
0 kernel.inc → core/kernel.inc
File renamed without changes.
View
0 keywords → core/keywords
File renamed without changes.
View
0 keywords.inc → core/keywords.inc
File renamed without changes.
View
0 layout.inc → core/layout.inc
File renamed without changes.
View
0 ldlinux.asm → core/ldlinux.asm
File renamed without changes.
View
0 loadhigh.inc → core/loadhigh.inc
File renamed without changes.
View
0 localboot.inc → core/localboot.inc
File renamed without changes.
View
0 lstadjust.pl → core/lstadjust.pl
File renamed without changes.
View
0 macros.inc → core/macros.inc
File renamed without changes.
View
0 now.pl → core/now.pl
File renamed without changes.
View
0 parsecmd.inc → core/parsecmd.inc
File renamed without changes.
View
0 parseconfig.inc → core/parseconfig.inc
File renamed without changes.
View
0 plaincon.inc → core/plaincon.inc
File renamed without changes.
View
0 pxe.inc → core/pxe.inc
File renamed without changes.
View
0 pxelinux.asm → core/pxelinux.asm
File renamed without changes.
View
0 rawcon.inc → core/rawcon.inc
File renamed without changes.
View
0 regdump.inc → core/regdump.inc
File renamed without changes.
View
0 rllpack.inc → core/rllpack.inc
File renamed without changes.
View
0 runkernel.inc → core/runkernel.inc
File renamed without changes.
View
0 stack.inc → core/stack.inc
File renamed without changes.
View
0 strcpy.inc → core/strcpy.inc
File renamed without changes.
View
0 strecpy.inc → core/strecpy.inc
File renamed without changes.
View
0 syslinux.ld → core/syslinux.ld
File renamed without changes.
View
0 tracers.inc → core/tracers.inc
File renamed without changes.
View
0 ui.inc → core/ui.inc
File renamed without changes.
View
0 writehex.inc → core/writehex.inc
File renamed without changes.
View
0 writestr.inc → core/writestr.inc
File renamed without changes.
View
21 dos/Makefile
@@ -9,35 +9,38 @@ M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) \
$(call gcc_ok,-fno-stack-protector,) \
$(call gcc_ok,-fno-top-level-reorder,$(call gcc_ok,-fno-unit-at-a-time))
-LD = ld -m elf_i386
+NASM = nasm
+NASMOPT = -O9999
+
+LD = ld
+LDFLAGS = -m elf_i386 -T com16.ld
OBJCOPY = objcopy
OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
INCLUDES = -include code16.h -nostdinc -iwithprefix include \
-I. -I.. -I../libfat -I ../libinstaller
CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -msoft-float $(OPTFLAGS) $(INCLUDES)
-LDFLAGS = -T com16.ld
AR = ar
RANLIB = ranlib
LIBGCC := $(shell $(CC) --print-libgcc)
SRCS = syslinux.c \
../libinstaller/syslxmod.c \
- ../bootsect_bin.c ../ldlinux_bin.c ../mbr_bin.c \
+ ../core/bootsect_bin.c ../core/ldlinux_bin.c ../mbr/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 \
argv.o printf.o __divdi3.o __udivmoddi4.o
-.SUFFIXES: .c .o .i .s .S .elf .com
+.SUFFIXES: .c .o .i .s .S .elf .com .asm .lst
-VPATH = .:..:../libfat:../libinstaller
+VPATH = .:../libfat:../libinstaller:../core:../mbr
-TARGETS = syslinux.com
+TARGETS = syslinux.com copybs.com
all: $(TARGETS)
-tidy:
- -rm -f *.o *.i *.s *.a .*.d *.elf
+tidy dist:
+ -rm -f *.o *.i *.s *.a .*.d *.elf *.lst
clean: tidy
@@ -67,5 +70,7 @@ syslinux.com: syslinux.elf
$(CC) -Wp,-MT,$@,-MD,.$@.d $(CFLAGS) -D__ASSEMBLY__ -c -o $@ $<
%.s: %.S
$(CC) $(CFLAGS) -E -o $@ $<
+%.com: %.asm
+ $(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
-include .*.d
View
0 copybs.asm → dos/copybs.asm
File renamed without changes.
View
6 extlinux/Makefile
@@ -13,16 +13,16 @@ CFLAGS = -W -Wall -Wno-sign-compare -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUD
LDFLAGS = $(LDHASH) # -s
SRCS = main.c ../libinstaller/setadv.c \
- ../extlinux_bss_bin.c ../extlinux_sys_bin.c
+ ../core/extlinux_bss_bin.c ../core/extlinux_sys_bin.c
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
.SUFFIXES: .c .o .i .s .S
-VPATH = .:..:../libinstaller
+VPATH = .:../libinstaller:../core
all: installer
-tidy:
+tidy dist:
-rm -f *.o *.i *.s *.a .*.d
clean: tidy
View
37 gpxe/Makefile
@@ -0,0 +1,37 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 2008 H. Peter Anvin - All Rights Reserved
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
+## Boston MA 02110-1301, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+#
+# Makefile for gpxe/gpxelinux.0
+#
+# Very simple, really...
+#
+
+TARGETS = gpxelinux.0
+
+all: $(TARGETS)
+
+tidy:
+
+clean: tidy
+ rm -f $(TARGETS)
+
+dist:
+ $(MAKE) -C src veryclean
+
+spotless: clean dist
+
+installer:
+
+gpxelinux.0: ../core/pxelinux.0
+ $(MAKE) -C src EMBEDDED_IMAGE=../$< bin/undionly.kpxe
+ cp -f src/bin/undionly.kpxe $@
View
2 gpxe/src/Config
@@ -383,4 +383,4 @@ CFLAGS_wd = -DINCLUDE_WD -DWD_DEFAULT_MEM=0xCC000
#
# SYSLINUX: Local addition to build PXELINUX combined image
#
-EMBEDDED_IMAGE = ../../pxelinux.0
+EMBEDDED_IMAGE = ../core/pxelinux.0
View
6 unix/Makefile → linux/Makefile
@@ -13,16 +13,16 @@ CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
LDFLAGS = $(LDHASH) -s
SRCS = syslinux.c ../libinstaller/syslxmod.c \
- ../bootsect_bin.c ../ldlinux_bin.c
+ ../core/bootsect_bin.c ../core/ldlinux_bin.c
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
.SUFFIXES: .c .o .i .s .S
-VPATH = .:..:../libinstaller
+VPATH = .:../libinstaller:../core
all: installer
-tidy:
+tidy dist:
-rm -f *.o *.i *.s *.a .*.d
clean: tidy
View
0 unix/syslinux.c → linux/syslinux.c
File renamed without changes.
View
16 mbr/Makefile
@@ -22,34 +22,40 @@ gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-ffreestanding,) $(call gcc_ok,-fno-stack-protector)
CC = gcc
-LD = ld -m elf_i386
+LD = ld
+LDFLAGS = -m elf_i386
SFLAGS = $(M32) -march=i386
OBJCOPY = objcopy
PERL = perl
.SUFFIXES: .S .s .o .elf
-all: mbr.bin gptmbr.bin
+all: mbr.bin mbr_bin.c gptmbr.bin gptmbr_bin.c
.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) -T mbr.ld -e _start -o $@ $<
+ $(LD) $(LDFLAGS) -T mbr.ld -e _start -o $@ $<
mbr.bin: mbr.elf checksize.pl
$(OBJCOPY) -O binary $< $@
$(PERL) checksize.pl mbr.bin 440
+mbr_bin.c: mbr.bin
+
gptmbr.elf: gptmbr.o mbr.ld
- $(LD) -T mbr.ld -e _start -o $@ $<
+ $(LD) $(LDFLAGS) -T mbr.ld -e _start -o $@ $<
gptmbr.bin: gptmbr.elf checksize.pl
$(OBJCOPY) -O binary $< $@
$(PERL) checksize.pl gptmbr.bin 424
-tidy:
+tidy dist:
rm -f *.o *.elf *.lst
clean: tidy
View
2 memdisk/Makefile
@@ -49,7 +49,7 @@ NASMSRC = memdisk.asm memdisk16.asm
all: memdisk # e820test
# tidy, clean removes everything except the final binary
-tidy:
+tidy dist:
rm -f *.o *.s *.o16 *.s16 *.bin *.lst *.elf e820test
clean: tidy
View
2 memdump/Makefile
@@ -30,7 +30,7 @@ TARGETS = memdump.com
all: $(TARGETS)
-tidy:
+tidy dist:
-rm -f *.o *.i *.s *.a .*.d *.elf
clean: tidy
View
2 menu/Makefile
@@ -74,7 +74,7 @@ libmenu/libmenu.a: $(LIBMENU)
$(AR) cq $@ $^
$(RANLIB) $@
-tidy:
+tidy dist:
rm -f *.o *.lo *.a *.lst *.elf
libclean:
View
7 mtools/Makefile
@@ -12,17 +12,18 @@ INCLUDES = -I. -I.. -I../libfat -I../libinstaller
CFLAGS = -W -Wall -D_FILE_OFFSET_BITS=64 $(OPTFLAGS) $(INCLUDES)
LDFLAGS = $(LDHASH) -s
-SRCS = syslinux.c ../syslxmod.c ../bootsect_bin.c ../ldlinux_bin.c \
+SRCS = syslinux.c ../libinstaller/syslxmod.c \
+ ../core/bootsect_bin.c ../core/ldlinux_bin.c \
$(wildcard ../libfat/*.c)
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
.SUFFIXES: .c .o .i .s .S
-VPATH = .:..:../libfat:../libinstaller
+VPATH = .:../libfat:../libinstaller:../core
all: installer
-tidy:
+tidy dist:
-rm -f *.o *.i *.s *.a .*.d
clean: tidy
View
4 sample/Makefile
@@ -32,7 +32,7 @@ CFLAGS = $(M32) -W -Wall -march=i386 -Os -fomit-frame-pointer -I../com32/inc
SFLAGS = $(M32) -march=i386
LDFLAGS = -s
OBJCOPY = objcopy
-PPMTOLSS16 = ../ppmtolss16
+PPMTOLSS16 = ../utils/ppmtolss16
LIB = liboldcom32.a
GZIPPROG = gzip
PNGTOPNM = pngtopnm
@@ -75,7 +75,7 @@ $(LIB): $(LIBOBJS)
%.ppm.gz: %.png
$(PNGTOPNM) $< | gzip -9 > $@
-tidy:
+tidy dist:
rm -f *.o *.a *.lst *.elf
# Don't specify *.com since mdiskchk.com can't be built using Linux tools
View
58 utils/Makefile
@@ -0,0 +1,58 @@
+## -----------------------------------------------------------------------
+##
+## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+#
+# SYSLINUX utilities
+#
+# No builtin rules
+MAKEFLAGS += -r
+MAKE += -r
+
+TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
+
+CC = gcc
+
+gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) dummy.c -o $$tmpf 2>/dev/null; \
+ then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
+
+comma := ,
+LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
+
+CFLAGS = -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
+LDFLAGS = -O2 -s $(LDHASH)
+LD = ld
+PERL = perl
+
+TARGETS = mkdiskimage gethostip
+ASIS = keytab-lilo lss16toppm md5pass ppmtolss16 sha1pass syslinux2ansi
+
+all: mkdiskimage gethostip
+
+%.o: %.c
+ $(CC) $(CFLAGS) -c -o $@ $<
+
+mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
+ $(PERL) bin2hex.pl < ../mbr/mbr.bin | cat mkdiskimage.in - > $@
+ chmod a+x $@
+
+gethostip: gethostip.o
+ $(CC) $(LDFLAGS) -o $@ $^
+
+tidy dist:
+ rm -f *.o
+
+clean: tidy
+ rm -f $(TARGETS)
+
+spotless: clean
+
+installer: all
View
0 bin2hex.pl → utils/bin2hex.pl 100755 → 100644
File renamed without changes.
View
0 gethostip.c → utils/gethostip.c
File renamed without changes.
View
0 keytab-lilo.pl → utils/keytab-lilo
File renamed without changes.
View
0 lss16toppm → utils/lss16toppm
File renamed without changes.
View
0 md5pass → utils/md5pass
File renamed without changes.
View
0 mkdiskimage.in → utils/mkdiskimage.in 100755 → 100644
File renamed without changes.
View
0 ppmtolss16 → utils/ppmtolss16
File renamed without changes.
View
0 sha1pass → utils/sha1pass
File renamed without changes.
View
0 syslinux2ansi.pl → utils/syslinux2ansi
File renamed without changes.
View
9 win32/Makefile
@@ -47,11 +47,12 @@ WINCC_IS_GOOD := $(shell $(WINCC) $(WINCFLAGS) $(WINLDFLAGS) -o hello.exe hello.
.SUFFIXES: .c .o .i .s .S
-SRCS = syslinux.c ../syslxmod.c ../bootsect_bin.c ../ldlinux_bin.c \
- ../mbr_bin.c $(wildcard ../libfat/*.c)
+SRCS = syslinux.c ../libinstaller/syslxmod.c \
+ ../core/bootsect_bin.c ../core/ldlinux_bin.c \
+ ../mbr/mbr_bin.c $(wildcard ../libfat/*.c)
OBJS = $(patsubst %.c,%.o,$(notdir $(SRCS)))
-VPATH = .:..:../libfat:../libinstaller
+VPATH = .:../libfat:../libinstaller:../core:../mbr
TARGETS = syslinux.exe
@@ -62,7 +63,7 @@ all:
rm -f $(TARGETS)
endif
-tidy:
+tidy dist:
-rm -f *.o *.i *.s *.a .*.d *_bin.c hello.exe
clean: tidy

0 comments on commit b536209

Please sign in to comment.