lwip/undiif: split arphdr._hwlen_protolen
[syslinux.git] / Makefile
blobbe3425b83ebeec0850b67628ae3f6bc23f581d69
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.
12 ## -----------------------------------------------------------------------
15 # Main Makefile for SYSLINUX
17 topdir = .
18 MAKEDIR = $(topdir)/mk
19 include $(MAKEDIR)/syslinux.mk
20 -include $(topdir)/version.mk
23 # The BTARGET refers to objects that are derived from ldlinux.asm; we
24 # like to keep those uniform for debugging reasons; however, distributors
25 # want to recompile the installers (ITARGET).
27 # BOBJECTS and IOBJECTS are the same thing, except used for
28 # installation, so they include objects that may be in subdirectories
29 # with their own Makefiles. Finally, there is a list of those
30 # directories.
33 MODULES = memdisk/memdisk memdump/memdump.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 com32/chain/*.c32 \
37 com32/lib/*.c32 com32/libutil/*.c32 com32/gpllib/*.c32 \
38 com32/elflink/ldlinux/*.c32 com32/cmenu/libmenu/*.c32
40 # List of module objects that should be installed for all derivatives
41 INSTALLABLE_MODULES = $(MODULES)
43 # syslinux.exe is BTARGET so as to not require everyone to have the
44 # mingw suite installed
45 BTARGET = version.gen version.h version.mk
46 BOBJECTS = $(BTARGET) \
47 mbr/*.bin \
48 core/pxelinux.0 core/lpxelinux.0 \
49 core/isolinux.bin core/isolinux-debug.bin \
50 gpxe/gpxelinux.0 dos/syslinux.com \
51 win32/syslinux.exe win64/syslinux64.exe \
52 dosutil/*.com dosutil/*.sys \
53 $(MODULES)
55 # BSUBDIRs build the on-target binary components.
56 # ISUBDIRs build the installer (host) components.
58 # Note: libinstaller is both a BSUBDIR and an ISUBDIR. It contains
59 # files that depend only on the B phase, but may have to be regenerated
60 # for "make installer".
61 BSUBDIRS = codepage com32 lzo core memdisk mbr memdump gpxe sample \
62 diag libinstaller dos win32 win64 dosutil txt
63 ITARGET =
64 IOBJECTS = $(ITARGET) \
65 utils/gethostip utils/isohybrid utils/mkdiskimage \
66 mtools/syslinux linux/syslinux extlinux/extlinux
67 ISUBDIRS = libinstaller mtools linux extlinux utils
69 # Things to install in /usr/bin
70 INSTALL_BIN = mtools/syslinux
71 # Things to install in /sbin
72 INSTALL_SBIN = extlinux/extlinux
73 # Things to install in /usr/lib/syslinux
74 INSTALL_AUX = core/pxelinux.0 gpxe/gpxelinux.0 gpxe/gpxelinuxk.0 \
75 core/isolinux.bin core/isolinux-debug.bin \
76 dos/syslinux.com core/lpxelinux.0 \
77 mbr/*.bin $(INSTALLABLE_MODULES)
78 INSTALL_AUX_OPT = win32/syslinux.exe win64/syslinux64.exe
79 INSTALL_DIAG = diag/mbr/handoff.bin \
80 diag/geodsp/geodsp1s.img.xz diag/geodsp/geodspms.img.xz
82 # These directories manage their own installables
83 INSTALLSUBDIRS = com32 utils dosutil
85 # Things to install in /boot/extlinux
86 EXTBOOTINSTALL = $(INSTALLABLE_MODULES)
88 # Things to install in /tftpboot
89 NETINSTALLABLE = core/pxelinux.0 gpxe/gpxelinux.0 core/lpxelinux.0 \
90 $(INSTALLABLE_MODULES)
92 all:
93 $(MAKE) all-local
94 set -e ; for i in $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
95 -ls -l $(BOBJECTS) $(IOBJECTS)
97 all-local: $(BTARGET) $(ITARGET)
99 installer:
100 $(MAKE) installer-local
101 set -e ; for i in $(ISUBDIRS); do $(MAKE) -C $$i all ; done
102 -ls -l $(BOBJECTS) $(IOBJECTS)
104 installer-local: $(ITARGET) $(BINFILES)
106 strip:
107 $(MAKE) strip-local
108 set -e ; for i in $(ISUBDIRS); do $(MAKE) -C $$i strip ; done
109 -ls -l $(BOBJECTS) $(IOBJECTS)
111 strip-local:
113 version.gen: version version.pl
114 $(PERL) version.pl $< $@ '%define < @'
115 version.h: version version.pl
116 $(PERL) version.pl $< $@ '#define < @'
117 version.mk: version version.pl
118 $(PERL) version.pl $< $@ '< := @'
120 local-install: installer
121 mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
122 install -m 755 -c $(INSTALL_BIN) $(INSTALLROOT)$(BINDIR)
123 mkdir -m 755 -p $(INSTALLROOT)$(SBINDIR)
124 install -m 755 -c $(INSTALL_SBIN) $(INSTALLROOT)$(SBINDIR)
125 mkdir -m 755 -p $(INSTALLROOT)$(AUXDIR)
126 install -m 644 -c $(INSTALL_AUX) $(INSTALLROOT)$(AUXDIR)
127 -install -m 644 -c $(INSTALL_AUX_OPT) $(INSTALLROOT)$(AUXDIR)
128 mkdir -m 755 -p $(INSTALLROOT)$(DIAGDIR)
129 install -m 644 -c $(INSTALL_DIAG) $(INSTALLROOT)$(DIAGDIR)
130 mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man1
131 install -m 644 -c man/*.1 $(INSTALLROOT)$(MANDIR)/man1
132 : mkdir -m 755 -p $(INSTALLROOT)$(MANDIR)/man8
133 : install -m 644 -c man/*.8 $(INSTALLROOT)$(MANDIR)/man8
135 install: local-install
136 set -e ; for i in $(INSTALLSUBDIRS) ; do $(MAKE) -C $$i $@ ; done
138 netinstall: installer
139 mkdir -p $(INSTALLROOT)$(TFTPBOOT)
140 install -m 644 $(NETINSTALLABLE) $(INSTALLROOT)$(TFTPBOOT)
142 extbootinstall: installer
143 mkdir -m 755 -p $(INSTALLROOT)$(EXTLINUXDIR)
144 install -m 644 $(EXTBOOTINSTALL) $(INSTALLROOT)$(EXTLINUXDIR)
146 install-all: install netinstall extbootinstall
148 local-tidy:
149 rm -f *.o *.elf *_bin.c stupid.* patch.offset
150 rm -f *.lsr *.lst *.map *.sec *.tmp
151 rm -f $(OBSOLETE)
153 tidy: local-tidy
154 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
156 local-clean:
157 rm -f $(ITARGET)
159 clean: local-tidy local-clean
160 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
162 local-dist:
163 find . \( -name '*~' -o -name '#*' -o -name core \
164 -o -name '.*.d' -o -name .depend \) -type f -print0 \
165 | xargs -0rt rm -f
167 dist: local-dist local-tidy
168 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
170 local-spotless:
171 rm -f $(BTARGET) .depend *.so.*
173 spotless: local-clean local-dist local-spotless
174 set -e ; for i in $(BESUBDIRS) $(IESUBDIRS) $(BSUBDIRS) $(ISUBDIRS) ; do $(MAKE) -C $$i $@ ; done
176 # Shortcut to build linux/syslinux using klibc
177 klibc:
178 $(MAKE) clean
179 $(MAKE) CC=klcc ITARGET= ISUBDIRS='linux extlinux' BSUBDIRS=
181 # Hook to add private Makefile targets for the maintainer.
182 -include Makefile.private