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