syslinux/Makefile
<<
>>
Prefs
   1## -----------------------------------------------------------------------
   2##
   3##   Copyright 1998-2009 H. Peter Anvin - All Rights Reserved
   4##   Copyright 2009-2010 Intel Corporation; author: H. Peter Anvin
   5##
   6##   This program is free software; you can redistribute it and/or modify
   7##   it under the terms of the GNU General Public License as published by
   8##   the Free Software Foundation, Inc., 53 Temple Place Ste 330,
   9##   Boston MA 02111-1307, USA; either version 2 of the License, or
  10##   (at your option) any later version; incorporated herein by reference.
  11##
  12## -----------------------------------------------------------------------
  13
  14#
  15# Main Makefile for SYSLINUX
  16#
  17topdir = .
  18include $(topdir)/MCONFIG
  19-include $(topdir)/version.mk
  20
  21#
  22# The BTARGET refers to objects that are derived from ldlinux.asm; we
  23# like to keep those uniform for debugging reasons; however, distributors
  24# want to recompile the installers (ITARGET).
  25#
  26# BOBJECTS and IOBJECTS are the same thing, except used for
  27# installation, so they include objects that may be in subdirectories
  28# with their own Makefiles.  Finally, there is a list of those
  29# directories.
  30#
  31
  32# List of module objects that should be installed for all derivatives
  33MODULES = memdisk/memdisk memdump/memdump.com modules/*.com \
  34        com32/menu/*.c32 com32/modules/*.c32 com32/mboot/*.c32 \
  35        com32/hdt/*.c32 com32/rosh/*.c32 com32/gfxboot/*.c32 \
  36        com32/sysdump/*.c32 com32/lua/src/*.c32
  37
  38# syslinux.exe is BTARGET so as to not require everyone to have the
  39# mingw suite installed
  40BTARGET  = version.gen version.h version.mk
  41BOBJECTS = $(BTARGET) \
  42        mbr/*.bin \
  43        core/pxelinux.0 core/isolinux.bin core/isolinux-debug.bin \
  44        gpxe/gpxelinux.0 dos/syslinux.com \
  45        win32/syslinux.exe win64/syslinux64.exe \
  46        dosutil/*.com dosutil/*.sys \
  47        $(MODULES)
  48
  49# BSUBDIRs build the on-target binary components.
  50# ISUBDIRs build the installer (host) components.
  51#
  52# Note: libinstaller is both a BSUBDIR and an ISUBDIR.  It contains
  53# files that depend only on the B phase, but may have to be regenerated
  54# for "make installer".
  55BSUBDIRS = codepage com32 lzo core memdisk modules mbr memdump gpxe sample \
  56           diag libinstaller dos win32 win64 dosutil
  57ITARGET  =
  58IOBJECTS = $(ITARGET) \
  59        utils/gethostip utils/isohybrid utils/mkdiskimage \
  60        mtools/syslinux linux/syslinux extlinux/extlinux
  61ISUBDIRS = libinstaller mtools linux extlinux utils
  62
  63# Things to install in /usr/bin
  64INSTALL_BIN   = mtools/syslinux
  65# Things to install in /sbin
  66INSTALL_SBIN  = extlinux/extlinux
  67# Things to install in /usr/lib/syslinux
  68INSTALL_AUX   = core/pxelinux.0 gpxe/gpxelinux.0 gpxe/gpxelinuxk.0 \
  69                core/isolinux.bin core/isolinux-debug.bin \
  70                dos/syslinux.com \
  71                mbr/*.bin $(MODULES)
  72INSTALL_AUX_OPT = win32/syslinux.exe win64/syslinux64.exe
  73INSTALL_DIAG  = diag/mbr/handoff.bin \
  74                diag/geodsp/geodsp1s.img.xz diag/geodsp/geodspms.img.xz
  75
  76# These directories manage their own installables
  77INSTALLSUBDIRS = com32 utils dosutil
  78
  79# Things to install in /boot/extlinux
  80EXTBOOTINSTALL = $(MODULES)
  81
  82# Things to install in /tftpboot
  83NETINSTALLABLE = core/pxelinux.0 gpxe/gpxelinux.0 \
  84                 $(MODULES)
  85
  86all:
  87        $(MAKE) all-local
  88        set -e ; for i in $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
  89        -ls -l $(BOBJECTS) $(IOBJECTS)
  90
  91all-local: $(BTARGET) $(ITARGET)
  92
  93installer:
  94        $(MAKE) installer-local
  95        set -e ; for i in $(ISUBDIRS); do $(MAKE) -C $$i all ; done
  96        -ls -l $(BOBJECTS) $(IOBJECTS)
  97
  98installer-local: $(ITARGET) $(BINFILES)
  99
 100version.gen: version version.pl
 101        $(PERL) version.pl $< $@ '%define < @'
 102version.h: version version.pl
 103        $(PERL) version.pl $< $@ '#define < @'
 104version.mk: version version.pl
 105        $(PERL) version.pl $< $@ '< := @'
 106
 107local-install: installer
 108        mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
 109        install -m 755 -c $(INSTALL_BIN) $(INSTALLROOT)$(BINDIR)
 110        mkdir -m 755 -p $(INSTALLROOT)$(SBINDIR)
 111        install -m 755 -c $(INSTALL_SBIN) $(INSTALLROOT)$(SBINDIR)
 112        mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR)
 113        install -m 644 -c $(INSTALL_AUX) $(INSTALLROOT)$(AUXDIR)
 114        -install -m 644 -c $(INSTALL_AUX_OPT) $(INSTALLROOT)$(AUXDIR)
 115        mkdir -m 755 -p $(INSTALLROOT)$(DIAGDIR)
 116        install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)
 117        mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man1
 118        install -m 644 -c man/*.1 $(INSTALLROOT)$(MANDIR)/man1
 119        : mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man8
 120        : install -m 644 -c man/*.8 $(INSTALLROOT)$(MANDIR)/man8
 121
 122install: local-install
 123        set -e ; for i in $(INSTALLSUBDIRS) ; do $(MAKE) -C $$i $@ ; done
 124
 125netinstall: installer
 126        mkdir -p $(INSTALLROOT)$(TFTPBOOT)
 127        install -m 644 $(NETINSTALLABLE) $(INSTALLROOT)$(TFTPBOOT)
 128
 129extbootinstall: installer
 130        mkdir -m 755 -p $(INSTALLROOT)$(EXTLINUXDIR)
 131        install -m 644 $(EXTBOOTINSTALL) $(INSTALLROOT)$(EXTLINUXDIR)
 132
 133install-all: install netinstall extbootinstall
 134
 135local-tidy:
 136        rm -f *.o *.elf *_bin.c stupid.* patch.offset
 137        rm -f *.lsr *.lst *.map *.sec *.tmp
 138        rm -f $(OBSOLETE)
 139
 140tidy: local-tidy
 141        set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
 142
 143local-clean:
 144        rm -f $(ITARGET)
 145
 146clean: local-tidy local-clean
 147        set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
 148
 149local-dist:
 150        find . \( -name '*~' -o -name '#*' -o -name core \
 151                -o -name '.*.d' -o -name .depend \) -type f -print0 \
 152        | xargs -0rt rm -f
 153
 154dist: local-dist local-tidy
 155        set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
 156
 157local-spotless:
 158        rm -f $(BTARGET) .depend *.so.*
 159
 160spotless: local-clean local-dist local-spotless
 161        set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
 162
 163# Shortcut to build linux/syslinux using klibc
 164klibc:
 165        $(MAKE) clean
 166        $(MAKE) CC=klcc ITARGET= ISUBDIRS='linux extlinux' BSUBDIRS=
 167
 168# Hook to add private Makefile targets for the maintainer.
 169-include Makefile.private
 170
lxr.linux.no kindly hosted by Redpill Linpro AS, provider of Linux consulting and operations services since 1995.