1 ## -----------------------------------------------------------------------
3 ## Copyright 1998-2008 H. Peter Anvin - All Rights Reserved
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
21 TMPFILE
= $(shell mktemp
/tmp
/gcc_ok.XXXXXX
)
25 gcc_ok
= $(shell tmpf
=$(TMPFILE
); if
$(CC
) $(1) dummy.c
-o
$$tmpf 2>/dev
/null
; \
26 then echo
'$(1)'; else echo
'$(2)'; fi
; rm -f
$$tmpf)
29 LDHASH
:= $(call gcc_ok
,-Wl
$(comma
)--hash-style
=both
,)
31 OSTYPE
= $(shell uname
-msr
)
33 CFLAGS
= -W
-Wall
-Os
-fomit-frame-pointer
-D_FILE_OFFSET_BITS
=64
35 LDFLAGS
= -O2
-s
$(LDHASH
)
48 AUXDIR
= $(LIBDIR
)/syslinux
55 VERSION
= $(shell cat version
)
58 $(CC
) $(INCLUDE
) $(CFLAGS
) -c
$<
61 # The BTARGET refers to objects that are derived from ldlinux.asm; we
62 # like to keep those uniform for debugging reasons; however, distributors
63 # want to recompile the installers (ITARGET).
65 # BOBJECTS and IOBJECTS are the same thing, except used for
66 # installation, so they include objects that may be in subdirectories
67 # with their own Makefiles. Finally, there is a list of those
71 # syslinux.exe is BTARGET so as to not require everyone to have the
72 # mingw suite installed
73 BTARGET
= version.gen version.h
74 BOBJECTS
= $(BTARGET
) \
75 mbr
/mbr.bin mbr
/gptmbr.bin \
76 core
/pxelinux
.0 core
/isolinux.bin core
/isolinux-debug.bin \
77 gpxe
/gpxelinux
.0 dos
/syslinux.com win32
/syslinux.exe \
78 memdisk
/memdisk memdump
/memdump.com
79 # BESUBDIRS and IESUBDIRS are "early", i.e. before the root; BSUBDIRS
80 # and ISUBDIRS are "late", after the root.
82 BSUBDIRS
= memdisk memdump gpxe dos win32
84 IOBJECTS
= $(ITARGET
) dos
/copybs.com utils
/gethostip utils
/mkdiskimage \
85 mtools
/syslinux linux
/syslinux extlinux
/extlinux
87 ISUBDIRS
= mtools linux extlinux utils com32 sample
89 # Things to install in /usr/bin
90 INSTALL_BIN
= mtools
/syslinux utils
/gethostip utils
/ppmtolss16 \
91 utils
/lss16toppm utils
/sha1pass utils
/md5pass
92 # Things to install in /sbin
93 INSTALL_SBIN
= extlinux
/extlinux
94 # Things to install in /usr/lib/syslinux
95 INSTALL_AUX
= core
/pxelinux
.0 gpxe
/gpxelinux
.0 core
/isolinux.bin \
96 core
/isolinux-debug.bin \
97 dos
/syslinux.com dos
/copybs.com memdisk
/memdisk mbr
/mbr.bin
98 INSTALL_AUX_OPT
= win32
/syslinux.exe
101 set
-e
; for i in
$(BESUBDIRS
) $(IESUBDIRS
) ; do
$(MAKE
) -C
$$i $@
; done
103 set
-e
; for i in
$(BSUBDIRS
) $(ISUBDIRS
) ; do
$(MAKE
) -C
$$i $@
; done
104 -ls
-l
$(BOBJECTS
) $(IOBJECTS
)
106 all-local
: $(BTARGET
) $(ITARGET
)
109 set
-e
; for i in
$(IESUBDIRS
); do
$(MAKE
) -C
$$i all ; done
110 $(MAKE
) installer-local
111 set
-e
; for i in
$(ISUBDIRS
); do
$(MAKE
) -C
$$i all ; done
112 -ls
-l
$(BOBJECTS
) $(IOBJECTS
)
114 installer-local
: $(ITARGET
) $(BINFILES
)
116 version.gen
: version version.pl
117 $(PERL
) version.pl
$< $@
'%define'
119 version.h
: version version.pl
120 $(PERL
) version.pl
$< $@
'#define'
123 mkdir
-m
755 -p
$(INSTALLROOT
)$(BINDIR
)
124 install -m
755 -c
$(INSTALL_BIN
) $(INSTALLROOT
)$(BINDIR
)
125 mkdir
-m
755 -p
$(INSTALLROOT
)$(SBINDIR
)
126 install -m
755 -c
$(INSTALL_SBIN
) $(INSTALLROOT
)$(SBINDIR
)
127 mkdir
-m
755 -p
$(INSTALLROOT
)$(AUXDIR
)
128 install -m
644 -c
$(INSTALL_AUX
) $(INSTALLROOT
)$(AUXDIR
)
129 -install -m
644 -c
$(INSTALL_AUX_OPT
) $(INSTALLROOT
)$(AUXDIR
)
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
134 $(MAKE
) -C com32
install
136 install-lib
: installer
138 install-all
: install install-lib
140 NETINSTALLABLE
= pxelinux
.0 gpxelinux
.0 memdisk
/memdisk memdump
/memdump.com \
141 com32
/menu
/*.c32 com32
/modules
/*.c32
143 netinstall
: installer
144 mkdir
-p
$(INSTALLROOT
)$(TFTPBOOT
)
145 install -m
644 $(NETINSTALLABLE
) $(INSTALLROOT
)$(TFTPBOOT
)
148 rm -f
*.o
*.elf
*_bin.c stupid.
* patch.offset
149 rm -f
*.lsr
*.lst
*.map
*.sec
153 set
-e
; for i in
$(BESUBDIRS
) $(IESUBDIRS
) $(BSUBDIRS
) $(ISUBDIRS
) ; do
$(MAKE
) -C
$$i $@
; done
158 clean: local-tidy local-clean
159 set
-e
; for i in
$(BESUBDIRS
) $(IESUBDIRS
) $(BSUBDIRS
) $(ISUBDIRS
) ; do
$(MAKE
) -C
$$i $@
; done
162 find . \
( -name
'*~' -o
-name
'#*' -o
-name core \
163 -o
-name
'.*.d' -o
-name .depend \
) -type f
-print0 \
166 dist: local-dist local-tidy
167 set
-e
; for i in
$(BESUBDIRS
) $(IESUBDIRS
) $(BSUBDIRS
) $(ISUBDIRS
) ; do
$(MAKE
) -C
$$i $@
; done
170 rm -f
$(BTARGET
) .depend
*.so.
*
172 spotless
: local-clean local-dist local-spotless
173 set
-e
; for i in
$(BESUBDIRS
) $(IESUBDIRS
) $(BSUBDIRS
) $(ISUBDIRS
) ; do
$(MAKE
) -C
$$i $@
; done
178 $(MAKE
) -C memdisk depend
180 # Shortcut to build linux/syslinux using klibc
183 $(MAKE
) CC
=klcc ITARGET
= ISUBDIRS
='linux extlinux' BSUBDIRS
=
185 # Hook to add private Makefile targets for the maintainer.
186 -include Makefile.private