1 #ident "$Id: Makefile,v 1.7 2005/01/04 03:05:17 hpa Exp $"
2 ## -----------------------------------------------------------------------
4 ## Copyright 2001-2004 H. Peter Anvin - All Rights Reserved
6 ## This program is free software; you can redistribute it and/or modify
7 ## it under the terms of the GNU General Public License as published by
8 ## the Free Software Foundation, Inc., 53 Temple Place Ste 330,
9 ## Boston MA 02111-1307, USA; either version 2 of the License, or
10 ## (at your option) any later version; incorporated herein by reference.
12 ## -----------------------------------------------------------------------
15 ## samples for syslinux users
18 gcc_ok = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \
19 then echo $(1); else echo $(2); fi)
21 M32 := $(call gcc_ok,-m32,)
28 CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os -fomit-frame-pointer -I../libutil/include -I../include -D__COM32__
29 LNXCFLAGS = -W -Wall -O -g -I../libutil/include
32 SFLAGS = -D__COM32__ -march=i386
33 LDFLAGS = -T ../lib/com32.ld
35 PPMTOLSS16 = ../ppmtolss16
36 LIBGCC := $(shell $(CC) --print-libgcc)
37 LIBS = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
38 LNXLIBS = ../libutil/libutil_lnx.a
40 .SUFFIXES: .lss .c .o .elf .c32 .lnx
42 all: hello.c32 cat.c32 resolv.c32 \
43 fancyhello.c32 fancyhello.lnx \
44 keytest.c32 keytest.lnx \
48 $(CC) $(SFLAGS) -c -o $@ $<
52 $(CC) $(CFLAGS) -c -o $@ $<
56 $(LD) $(LDFLAGS) -o $@ $^
60 $(CC) $(LNXSFLAGS) -c -o $@ $<
64 $(CC) $(LNXCFLAGS) -c -o $@ $<
67 %.lnx: %.lo $(LNXLIBS)
68 $(CC) $(LNXLDFLAGS) -o $@ $^
71 $(OBJCOPY) -O binary $< $@
74 rm -f *.o *.lo *.a *.lst *.elf
77 rm -f *.lss *.c32 *.lnx *.com
82 install: # Don't install samples