1 ## -----------------------------------------------------------------------
3 ## Copyright 2001-2004 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 gcc_ok
= $(shell if gcc
$(1) -c
-x c
/dev
/null
-o
/dev
/null
2>/dev
/null
; \
18 then echo
$(1); else echo
$(2); fi
)
20 M32
:= $(call gcc_ok
,-m32
,)
27 CFLAGS
= $(M32
) -mregparm
=3 -DREGPARM
=3 -W
-Wall
-march
=i386
-Os
-fomit-frame-pointer
-I..
/libutil
/include -I..
/include -D__COM32__
28 LNXCFLAGS
= -W
-Wall
-O
-g
-I..
/libutil
/include
31 SFLAGS
= -D__COM32__
-march
=i386
32 LDFLAGS
= -T ..
/lib
/com32.
ld
34 PPMTOLSS16
= ..
/ppmtolss16
35 LIBGCC
:= $(shell $(CC
) --print-libgcc
)
36 LIBS
= ..
/libutil
/libutil_com.a ..
/lib
/libcom32.a
$(LIBGCC
)
37 LNXLIBS
= ..
/libutil
/libutil_lnx.a
39 .SUFFIXES
: .lss .c .o .elf .c32 .lnx
43 AUXDIR
= $(LIBDIR
)/syslinux
45 COM32DIR
= $(AUXDIR
)/com32
47 MODULES
= chain.c32 menu.c32 vesamenu.c32 ethersel.c32 mboot.c32 dmitest.c32
50 all: $(MODULES
) $(TESTFILES
)
54 $(CC
) $(SFLAGS
) -c
-o
$@
$<
58 $(CC
) $(CFLAGS
) -c
-o
$@
$<
62 $(LD
) $(LDFLAGS
) -o
$@
$^
66 $(CC
) $(LNXSFLAGS
) -c
-o
$@
$<
70 $(CC
) $(LNXCFLAGS
) -c
-o
$@
$<
73 %.lnx
: %.lo
$(LNXLIBS
)
74 $(CC
) $(LNXLDFLAGS
) -o
$@
$^
77 $(OBJCOPY
) -O binary
$< $@
79 dmitest.elf
: dmitest.o dmi_utils.o dmi.o
$(LIBS
)
80 $(LD
) $(LDFLAGS
) -o
$@
$^
82 menu.elf
: menu.o menumain.o readconfig.o
$(LIBS
)
83 $(LD
) $(LDFLAGS
) -o
$@
$^
85 vesamenu.elf
: vesamenu.o menumain.o readconfig.o
$(LIBS
)
86 $(LD
) $(LDFLAGS
) -o
$@
$^
88 menu.lnx
: menu.lo readconfig.lo
$(LNXLIBS
)
89 $(CC
) $(LNXLDFLAGS
) -o
$@
$^
92 rm -f
*.o
*.lo
*.a
*.lst
*.elf
95 rm -f
*.lss
*.c32
*.lnx
*.com
101 mkdir
-m
755 -p
$(INSTALLROOT
)$(AUXDIR
)
102 install -m
644 $(MODULES
) $(INSTALLROOT
)$(AUXDIR
)