1 ## -----------------------------------------------------------------------
3 ## Copyright 2001-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 ## -----------------------------------------------------------------------
14 ## samples for syslinux users
17 TMPFILE
= $(shell mktemp
/tmp
/gcc_ok.XXXXXX
)
19 gcc_ok
= $(shell tmpf
=$(TMPFILE
); if gcc
$(1) -c
-x c
/dev
/null
-o
$$tmpf 2>/dev
/null
; \
20 then echo
$(1); else echo
$(2); fi
; rm -f
$$tmpf)
22 M32
:= $(call gcc_ok
,-m32
,) $(call gcc_ok
,-fno-stack-protector
,)
30 CFLAGS
= $(M32
) -mregparm
=3 -DREGPARM
=3 -W
-Wall
-march
=i386
-Os
-fomit-frame-pointer
-I..
/libutil
/include -I..
/include -D__COM32__
31 LNXCFLAGS
= -W
-Wall
-O
-g
-I..
/libutil
/include
34 SFLAGS
= -D__COM32__
-march
=i386
35 LDFLAGS
= -T ..
/lib
/com32.
ld
37 PPMTOLSS16
= ..
/ppmtolss16
38 LIBGCC
:= $(shell $(CC
) --print-libgcc
)
39 LIBS
= ..
/libutil
/libutil_com.a ..
/lib
/libcom32.a
$(LIBGCC
)
40 LNXLIBS
= ..
/libutil
/libutil_lnx.a
42 .SUFFIXES
: .lss .c .o .elf .c32 .lnx
44 all: hello.c32 cat.c32 resolv.c32 vesainfo.c32 serialinfo.c32 \
46 fancyhello.c32 fancyhello.lnx \
47 keytest.c32 keytest.lnx \
52 $(CC
) $(SFLAGS
) -c
-o
$@
$<
56 $(CC
) $(CFLAGS
) -c
-o
$@
$<
60 $(LD
) $(LDFLAGS
) -o
$@
$^
64 $(CC
) $(LNXSFLAGS
) -c
-o
$@
$<
68 $(CC
) $(LNXCFLAGS
) -c
-o
$@
$<
71 %.lnx
: %.lo
$(LNXLIBS
)
72 $(CC
) $(LNXLDFLAGS
) -o
$@
$^
75 $(OBJCOPY
) -O binary
$< $@
78 rm -f
*.o
*.lo
*.a
*.lst
*.elf
81 rm -f
*.lss
*.c32
*.lnx
*.com
86 install: # Don't install samples