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