Move files out of root into core, dos, and utils
authorH. Peter Anvin <hpa@zytor.com>
Thu, 29 May 2008 22:11:38 +0000 (15:11 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Thu, 29 May 2008 22:11:38 +0000 (15:11 -0700)
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.

88 files changed:
.gitignore
Makefile
checkov.pl [deleted file]
com32/Makefile
com32/lib/Makefile
com32/libutil/Makefile
com32/menu/Makefile
com32/modules/Makefile
com32/samples/Makefile
core/Makefile [new file with mode: 0644]
core/abort.inc [moved from abort.inc with 100% similarity]
core/adv.inc [moved from adv.inc with 100% similarity]
core/bcopy32.inc [moved from bcopy32.inc with 100% similarity]
core/bios.inc [moved from bios.inc with 100% similarity]
core/bootsect.inc [moved from bootsect.inc with 100% similarity]
core/cache.inc [moved from cache.inc with 100% similarity]
core/checksumiso.pl [moved from checksumiso.pl with 100% similarity]
core/cleanup.inc [moved from cleanup.inc with 100% similarity]
core/cmdline.inc [moved from cmdline.inc with 100% similarity]
core/com32.inc [moved from com32.inc with 100% similarity]
core/comboot.inc [moved from comboot.inc with 100% similarity]
core/config.inc [moved from config.inc with 98% similarity]
core/configinit.inc [moved from configinit.inc with 100% similarity]
core/conio.inc [moved from conio.inc with 100% similarity]
core/cpuinit.inc [moved from cpuinit.inc with 100% similarity]
core/dnsresolv.inc [moved from dnsresolv.inc with 100% similarity]
core/ext2_fs.inc [moved from ext2_fs.inc with 100% similarity]
core/extlinux.asm [moved from extlinux.asm with 100% similarity]
core/font.inc [moved from font.inc with 100% similarity]
core/genhash.pl [moved from genhash.pl with 100% similarity]
core/getc.inc [moved from getc.inc with 100% similarity]
core/graphics.inc [moved from graphics.inc with 100% similarity]
core/head.inc [moved from head.inc with 97% similarity]
core/highmem.inc [moved from highmem.inc with 100% similarity]
core/init.inc [moved from init.inc with 100% similarity]
core/isolinux-debug.asm [moved from isolinux-debug.asm with 100% similarity]
core/isolinux.asm [moved from isolinux.asm with 100% similarity]
core/kernel.inc [moved from kernel.inc with 100% similarity]
core/keywords [moved from keywords with 100% similarity]
core/keywords.inc [moved from keywords.inc with 100% similarity]
core/layout.inc [moved from layout.inc with 100% similarity]
core/ldlinux.asm [moved from ldlinux.asm with 100% similarity]
core/loadhigh.inc [moved from loadhigh.inc with 100% similarity]
core/localboot.inc [moved from localboot.inc with 100% similarity]
core/lstadjust.pl [moved from lstadjust.pl with 100% similarity]
core/macros.inc [moved from macros.inc with 100% similarity]
core/now.pl [moved from now.pl with 100% similarity]
core/parsecmd.inc [moved from parsecmd.inc with 100% similarity]
core/parseconfig.inc [moved from parseconfig.inc with 100% similarity]
core/plaincon.inc [moved from plaincon.inc with 100% similarity]
core/pxe.inc [moved from pxe.inc with 100% similarity]
core/pxelinux.asm [moved from pxelinux.asm with 100% similarity]
core/rawcon.inc [moved from rawcon.inc with 100% similarity]
core/regdump.inc [moved from regdump.inc with 100% similarity]
core/rllpack.inc [moved from rllpack.inc with 100% similarity]
core/runkernel.inc [moved from runkernel.inc with 100% similarity]
core/stack.inc [moved from stack.inc with 100% similarity]
core/strcpy.inc [moved from strcpy.inc with 100% similarity]
core/strecpy.inc [moved from strecpy.inc with 100% similarity]
core/syslinux.ld [moved from syslinux.ld with 100% similarity]
core/tracers.inc [moved from tracers.inc with 100% similarity]
core/ui.inc [moved from ui.inc with 100% similarity]
core/writehex.inc [moved from writehex.inc with 100% similarity]
core/writestr.inc [moved from writestr.inc with 100% similarity]
dos/Makefile
dos/copybs.asm [moved from copybs.asm with 100% similarity]
extlinux/Makefile
gpxe/Makefile [new file with mode: 0644]
gpxe/src/Config
linux/Makefile [moved from unix/Makefile with 91% similarity]
linux/syslinux.c [moved from unix/syslinux.c with 100% similarity]
mbr/Makefile
memdisk/Makefile
memdump/Makefile
menu/Makefile
mtools/Makefile
sample/Makefile
utils/Makefile [new file with mode: 0644]
utils/bin2hex.pl [moved from bin2hex.pl with 100% similarity, mode: 0644]
utils/gethostip.c [moved from gethostip.c with 100% similarity]
utils/keytab-lilo [moved from keytab-lilo.pl with 100% similarity]
utils/lss16toppm [moved from lss16toppm with 100% similarity]
utils/md5pass [moved from md5pass with 100% similarity]
utils/mkdiskimage.in [moved from mkdiskimage.in with 100% similarity, mode: 0644]
utils/ppmtolss16 [moved from ppmtolss16 with 100% similarity]
utils/sha1pass [moved from sha1pass with 100% similarity]
utils/syslinux2ansi [moved from syslinux2ansi.pl with 100% similarity]
win32/Makefile

index cd35dd2..46ed808 100644 (file)
 *.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
index e1b7191..d522cad 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -20,6 +20,8 @@ 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)
 
@@ -27,7 +29,6 @@ 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,7 +151,6 @@ 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)
@@ -254,36 +158,29 @@ local-clean:
 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
diff --git a/checkov.pl b/checkov.pl
deleted file mode 100644 (file)
index c7f018c..0000000
+++ /dev/null
@@ -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);
-}
index 32d7356..bfb8e3a 100644 (file)
@@ -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
index adc3660..c2c8036 100644 (file)
@@ -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
index 01de06a..4ae9af4 100644 (file)
@@ -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
index 8d7b69f..17d6f5f 100644 (file)
@@ -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
index 9890228..d67f997 100644 (file)
@@ -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
index 77feb58..bad0676 100644 (file)
@@ -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
diff --git a/core/Makefile b/core/Makefile
new file mode 100644 (file)
index 0000000..de39aca
--- /dev/null
@@ -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
similarity index 100%
rename from abort.inc
rename to core/abort.inc
similarity index 100%
rename from adv.inc
rename to core/adv.inc
similarity index 100%
rename from bcopy32.inc
rename to core/bcopy32.inc
similarity index 100%
rename from bios.inc
rename to core/bios.inc
similarity index 100%
rename from bootsect.inc
rename to core/bootsect.inc
similarity index 100%
rename from cache.inc
rename to core/cache.inc
similarity index 100%
rename from checksumiso.pl
rename to core/checksumiso.pl
similarity index 100%
rename from cleanup.inc
rename to core/cleanup.inc
similarity index 100%
rename from cmdline.inc
rename to core/cmdline.inc
similarity index 100%
rename from com32.inc
rename to core/com32.inc
similarity index 100%
rename from comboot.inc
rename to core/comboot.inc
similarity index 98%
rename from config.inc
rename to core/config.inc
index f0f59ce..f696f29 100644 (file)
@@ -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
 
 ;
similarity index 100%
rename from configinit.inc
rename to core/configinit.inc
similarity index 100%
rename from conio.inc
rename to core/conio.inc
similarity index 100%
rename from cpuinit.inc
rename to core/cpuinit.inc
similarity index 100%
rename from dnsresolv.inc
rename to core/dnsresolv.inc
similarity index 100%
rename from ext2_fs.inc
rename to core/ext2_fs.inc
similarity index 100%
rename from extlinux.asm
rename to core/extlinux.asm
similarity index 100%
rename from font.inc
rename to core/font.inc
similarity index 100%
rename from genhash.pl
rename to core/genhash.pl
similarity index 100%
rename from getc.inc
rename to core/getc.inc
similarity index 100%
rename from graphics.inc
rename to core/graphics.inc
similarity index 97%
rename from head.inc
rename to core/head.inc
index 928f07f..37f1b36 100644 (file)
--- a/head.inc
@@ -18,6 +18,7 @@
 ;
 
 %ifndef _HEAD_INC
+%define _HEAD_INC
 
 %include "macros.inc"
 %include "config.inc"
similarity index 100%
rename from highmem.inc
rename to core/highmem.inc
similarity index 100%
rename from init.inc
rename to core/init.inc
similarity index 100%
rename from isolinux-debug.asm
rename to core/isolinux-debug.asm
similarity index 100%
rename from isolinux.asm
rename to core/isolinux.asm
similarity index 100%
rename from kernel.inc
rename to core/kernel.inc
similarity index 100%
rename from keywords
rename to core/keywords
similarity index 100%
rename from keywords.inc
rename to core/keywords.inc
similarity index 100%
rename from layout.inc
rename to core/layout.inc
similarity index 100%
rename from ldlinux.asm
rename to core/ldlinux.asm
similarity index 100%
rename from loadhigh.inc
rename to core/loadhigh.inc
similarity index 100%
rename from localboot.inc
rename to core/localboot.inc
similarity index 100%
rename from lstadjust.pl
rename to core/lstadjust.pl
similarity index 100%
rename from macros.inc
rename to core/macros.inc
similarity index 100%
rename from now.pl
rename to core/now.pl
similarity index 100%
rename from parsecmd.inc
rename to core/parsecmd.inc
similarity index 100%
rename from parseconfig.inc
rename to core/parseconfig.inc
similarity index 100%
rename from plaincon.inc
rename to core/plaincon.inc
similarity index 100%
rename from pxe.inc
rename to core/pxe.inc
similarity index 100%
rename from pxelinux.asm
rename to core/pxelinux.asm
similarity index 100%
rename from rawcon.inc
rename to core/rawcon.inc
similarity index 100%
rename from regdump.inc
rename to core/regdump.inc
similarity index 100%
rename from rllpack.inc
rename to core/rllpack.inc
similarity index 100%
rename from runkernel.inc
rename to core/runkernel.inc
similarity index 100%
rename from stack.inc
rename to core/stack.inc
similarity index 100%
rename from strcpy.inc
rename to core/strcpy.inc
similarity index 100%
rename from strecpy.inc
rename to core/strecpy.inc
similarity index 100%
rename from syslinux.ld
rename to core/syslinux.ld
similarity index 100%
rename from tracers.inc
rename to core/tracers.inc
similarity index 100%
rename from ui.inc
rename to core/ui.inc
similarity index 100%
rename from writehex.inc
rename to core/writehex.inc
similarity index 100%
rename from writestr.inc
rename to core/writestr.inc
index 04550da..85df150 100644 (file)
@@ -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
similarity index 100%
rename from copybs.asm
rename to dos/copybs.asm
index 88d4d1a..dec8739 100644 (file)
@@ -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
diff --git a/gpxe/Makefile b/gpxe/Makefile
new file mode 100644 (file)
index 0000000..2868cbc
--- /dev/null
@@ -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 $@
index 210718d..d4ed234 100644 (file)
@@ -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
similarity index 91%
rename from unix/Makefile
rename to linux/Makefile
index 07f97d6..678dc9b 100644 (file)
@@ -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
similarity index 100%
rename from unix/syslinux.c
rename to linux/syslinux.c
index 76a47e0..7aa56ea 100644 (file)
@@ -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
index 3c288ca..d30fe85 100644 (file)
@@ -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
index 60c4229..3f19533 100644 (file)
@@ -30,7 +30,7 @@ TARGETS = memdump.com
 
 all: $(TARGETS)
 
-tidy:
+tidy dist:
        -rm -f *.o *.i *.s *.a .*.d *.elf
 
 clean: tidy
index 58c0e2f..04d2e22 100644 (file)
@@ -74,7 +74,7 @@ libmenu/libmenu.a: $(LIBMENU)
        $(AR) cq $@ $^
        $(RANLIB) $@
 
-tidy:
+tidy dist:
        rm -f *.o *.lo *.a *.lst *.elf
 
 libclean:
index a53e378..d3cdf81 100644 (file)
@@ -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
index d2a00f9..d10b5ed 100644 (file)
@@ -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
diff --git a/utils/Makefile b/utils/Makefile
new file mode 100644 (file)
index 0000000..0c5a363
--- /dev/null
@@ -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
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from bin2hex.pl
rename to utils/bin2hex.pl
similarity index 100%
rename from gethostip.c
rename to utils/gethostip.c
similarity index 100%
rename from keytab-lilo.pl
rename to utils/keytab-lilo
similarity index 100%
rename from lss16toppm
rename to utils/lss16toppm
similarity index 100%
rename from md5pass
rename to utils/md5pass
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from mkdiskimage.in
rename to utils/mkdiskimage.in
similarity index 100%
rename from ppmtolss16
rename to utils/ppmtolss16
similarity index 100%
rename from sha1pass
rename to utils/sha1pass
similarity index 100%
rename from syslinux2ansi.pl
rename to utils/syslinux2ansi
index ed0ad0a..9976615 100644 (file)
@@ -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