Remove -s for host binaries
[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 MAKEDIR = $(topdir)/mk
19 include $(MAKEDIR)/syslinux.mk
20
21 CFLAGS   = $(GCCWARN) -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
22 LDFLAGS  = -O2
23
24 TARGETS  = mkdiskimage isohybrid gethostip memdiskfind
25 TARGETS += isohybrid.pl  # about to be obsoleted
26 ASIS     = keytab-lilo lss16toppm md5pass ppmtolss16 sha1pass syslinux2ansi \
27            pxelinux-options
28
29 ISOHDPFX = ../mbr/isohdpfx.bin ../mbr/isohdpfx_f.bin ../mbr/isohdpfx_c.bin \
30            ../mbr/isohdppx.bin ../mbr/isohdppx_f.bin ../mbr/isohdppx_c.bin
31
32 all: $(TARGETS)
33
34 %.o: %.c
35         $(CC) $(UMAKEDEPS) $(CFLAGS) -c -o $@ $<
36
37 mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
38         $(PERL) bin2hex.pl < ../mbr/mbr.bin | cat mkdiskimage.in - > $@
39         chmod a+x $@
40
41 # Works on anything with a Perl interpreter...
42 isohybrid.pl: isohybrid.in $(ISOHDPFX) bin2hex.pl
43         cp -f isohybrid.in $@
44         for f in $(ISOHDPFX) ; do $(PERL) bin2hex.pl < $$f >> $@ ; done
45         chmod a+x $@
46
47 isohdpfx.c: $(ISOHDPFX) isohdpfxarray.pl
48         $(PERL) isohdpfxarray.pl $(ISOHDPFX) > $@
49
50 isohybrid: isohybrid.o isohdpfx.o
51         $(CC) $(LDFLAGS) -o $@ $^
52
53 gethostip: gethostip.o
54         $(CC) $(LDFLAGS) -o $@ $^
55
56 memdiskfind: memdiskfind.o
57         $(CC) $(LDFLAGS) -o $@ $^
58
59 tidy dist:
60         rm -f *.o .*.d isohdpfx.c
61
62 clean: tidy
63         rm -f $(TARGETS)
64
65 spotless: clean
66
67 installer: all
68
69 install: installer
70         mkdir -m 755 -p $(INSTALLROOT)$(BINDIR)
71         install -m 755 $(TARGETS) $(ASIS) $(INSTALLROOT)$(BINDIR)
72
73 -include .*.d