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 ## -----------------------------------------------------------------------
20 TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
24 gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) dummy.c -o $$tmpf 2>/dev/null; \
25 then echo '$(1)'; else echo '$(2)'; fi; rm -f $$tmpf)
28 LDHASH := $(call gcc_ok,-Wl$(comma)--hash-style=both,)
30 CFLAGS = -W -Wall -Os -fomit-frame-pointer -D_FILE_OFFSET_BITS=64
31 LDFLAGS = -O2 -s $(LDHASH)
35 TARGETS = mkdiskimage gethostip
36 ASIS = keytab-lilo lss16toppm md5pass ppmtolss16 sha1pass syslinux2ansi
38 all: mkdiskimage gethostip
41 $(CC) $(CFLAGS) -c -o $@ $<
43 mkdiskimage: mkdiskimage.in ../mbr/mbr.bin bin2hex.pl
44 $(PERL) bin2hex.pl < ../mbr/mbr.bin | cat mkdiskimage.in - > $@
47 gethostip: gethostip.o
48 $(CC) $(LDFLAGS) -o $@ $^