1## ----------------------------------------------------------------------- 2## 3## Copyright 1998-2009 H. Peter Anvin - All Rights Reserved 4## Copyright 2009 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 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/mbr.bin mbr/altmbr.bin mbr/gptmbr.bin \ 43 mbr/mbr_c.bin mbr/altmbr_c.bin mbr/gptmbr_c.bin \ 44 mbr/mbr_f.bin mbr/altmbr_f.bin mbr/gptmbr_f.bin \ 45 core/pxelinux.0 core/isolinux.bin core/isolinux-debug.bin \ 46 gpxe/gpxelinux.0 dos/syslinux.com win32/syslinux.exe \ 47 dosutil/*.com dosutil/*.sys \ 48 $(MODULES) 49 50# BSUBDIRs build the on-target binary components. 51# ISUBDIRs build the installer (host) components. 52# 53# Note: libinstaller is both a BSUBDIR and an ISUBDIR. It contains 54# files that depend only on the B phase, but may have to be regenerated 55# for "make installer". 56BSUBDIRS = codepage core memdisk modules com32 mbr memdump gpxe sample \ 57 libinstaller dos win32 dosutil 58ITARGET = 59IOBJECTS = $(ITARGET) \ 60 utils/gethostip utils/isohybrid utils/mkdiskimage \ 61 mtools/syslinux linux/syslinux extlinux/extlinux 62ISUBDIRS = libinstaller mtools linux extlinux utils 63 64# Things to install in /usr/bin 65INSTALL_BIN = mtools/syslinux 66# Things to install in /sbin 67INSTALL_SBIN = extlinux/extlinux 68# Things to install in /usr/lib/syslinux 69INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 core/isolinux.bin \ 70 core/isolinux-debug.bin \ 71 dos/syslinux.com win32/syslinux.exe \ 72 mbr/*.bin $(MODULES) 73INSTALL_AUX_OPT = win32/syslinux.exe 74 75# These directories manage their own installables 76INSTALLSUBDIRS = com32 utils dosutil 77 78# Things to install in /boot/extlinux 79EXTBOOTINSTALL = $(MODULES) 80 81# Things to install in /tftpboot 82NETINSTALLABLE = core/pxelinux.0 gpxe/gpxelinux.0 \ 83 $(MODULES) 84 85all: 86 $(MAKE) all-local 87 set -e ; for i in $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done 88 -ls -l $(BOBJECTS) $(IOBJECTS) 89 90all-local: $(BTARGET) $(ITARGET) 91 92installer: 93 $(MAKE) installer-local 94 set -e ; for i in $(ISUBDIRS); do $(MAKE) -C $$i all ; done 95 -ls -l $(BOBJECTS) $(IOBJECTS) 96 97installer-local: $(ITARGET) $(BINFILES) 98 99version.gen: version version.pl 100 $(PERL) version.pl $< $@ '%define < @' 101version.h: version version.pl 102 $(PERL) version.pl $< $@ '#define < @' 103version.mk: version version.pl 104 $(PERL) version.pl $< $@ '< := @' 105 106local-install: installer 107 mkdir -m 755 -p $(INSTALLROOT)$(BINDIR) 108 install -m 755 -c $(INSTALL_BIN) $(INSTALLROOT)$(BINDIR) 109 mkdir -m 755 -p $(INSTALLROOT)$(SBINDIR) 110 install -m 755 -c $(INSTALL_SBIN) $(INSTALLROOT)$(SBINDIR) 111 mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR) 112 install -m 644 -c $(INSTALL_AUX) $(INSTALLROOT)$(AUXDIR) 113 -install -m 644 -c $(INSTALL_AUX_OPT) $(INSTALLROOT)$(AUXDIR) 114 mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man1 115 install -m 644 -c man/*.1 $(INSTALLROOT)$(MANDIR)/man1 116 : mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man8 117 : install -m 644 -c man/*.8 $(INSTALLROOT)$(MANDIR)/man8 118 119install: local-install 120 set -e ; for i in $(INSTALLSUBDIRS) ; do $(MAKE) -C $$i $@ ; done 121 122netinstall: installer 123 mkdir -p $(INSTALLROOT)$(TFTPBOOT) 124 install -m 644 $(NETINSTALLABLE) $(INSTALLROOT)$(TFTPBOOT) 125 126extbootinstall: installer 127 mkdir -m 755 -p $(INSTALLROOT)$(EXTLINUXDIR) 128 install -m 644 $(EXTBOOTINSTALL) $(INSTALLROOT)$(EXTLINUXDIR) 129 130install-all: install netinstall extbootinstall 131 132local-tidy: 133 rm -f *.o *.elf *_bin.c stupid.* patch.offset 134 rm -f *.lsr *.lst *.map *.sec *.tmp 135 rm -f $(OBSOLETE) 136 137tidy: local-tidy 138 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done 139 140local-clean: 141 rm -f $(ITARGET) 142 143clean: local-tidy local-clean 144 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done 145 146local-dist: 147 find . \( -name '*~' -o -name '#*' -o -name core \ 148 -o -name '.*.d' -o -name .depend \) -type f -print0 \ 149 | xargs -0rt rm -f 150 151dist: local-dist local-tidy 152 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done 153 154local-spotless: 155 rm -f $(BTARGET) .depend *.so.* 156 157spotless: local-clean local-dist local-spotless 158 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done 159 160# Shortcut to build linux/syslinux using klibc 161klibc: 162 $(MAKE) clean 163 $(MAKE) CC=klcc ITARGET= ISUBDIRS='linux extlinux' BSUBDIRS= 164 165# Hook to add private Makefile targets for the maintainer. 166-include Makefile.private 167

