Merge branch 'master' into fsc
[profile/ivi/syslinux.git] / utils / Makefile
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.
10 ##
11 ## -----------------------------------------------------------------------
12
13 #
14 # SYSLINUX utilities
15 #
16
17 topdir = ..
18 include $(topdir)/MCONFIG
19
20 CFLAGS   = -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
21 LDFLAGS  = -O2 -s
22
23 TARGETS  = mkdiskimage isohybrid gethostip
24 ASIS     = keytab-lilo lss16toppm md5pass ppmtolss16 sha1pass syslinux2ansi \
25            pxelinux-options
26
27 ISOHDPFX = ../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin ../mbr/isohdpfx_c.bin \
28            ../mbr/isohdppx.bin ../mbr/isohdppx_f.bin ../mbr/isohdppx_c.bin
29
30 all: $(TARGETS)
31
32 %.o: %.c
33         $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
34
35 mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
36         $(PERL) bin2hex.pl < ../mbr/mbr.bin | cat mkdiskimage.in - > $@
37         chmod a+x $@
38
39 isohybrid: isohybrid.in $(ISOHDPFX) bin2hex.pl
40         cp -f isohybrid.in $@
41         for f in $(ISOHDPFX) ; do $(PERL) bin2hex.pl < $$f >> $@ ; done
42         chmod a+x $@
43
44 gethostip: gethostip.o
45         $(CC) $(LDFLAGS) -o $@ $^
46
47 tidy dist:
48         rm -f *.o .*.d
49
50 clean: tidy
51         rm -f $(TARGETS)
52
53 spotless: clean
54
55 installer: all
56
57 install: installer
58         mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
59         install -m 755 $(TARGETS) $(ASIS) $(INSTALLROOT)$(BINDIR)
60
61 -include .*.d