1 #ident "$Id: Makefile,v 1.23 2005/01/03 08:23:16 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,) $(call gcc_ok,-ffreestanding,)
28 CFLAGS = -W -Wall -march=i386 -Os -fomit-frame-pointer -I../com32/include
32 PPMTOLSS16 = ../ppmtolss16
35 LIBOBJS = conio.o atou.o skipatou.o printf.o c32exit.o
37 ARCH := $(shell uname -m)
41 LDFLAGS += -m elf_i386
44 .SUFFIXES: .lss .c .o .elf .c32
46 all: syslogo.lss comecho.com hello.c32 hello2.c32 filetest.c32 c32echo.c32 \
51 $(CC) $(SFLAGS) -c -o $@ $<
55 $(CC) $(CFLAGS) -c -o $@ $<
58 %.elf: c32entry.o %.o $(LIB)
59 $(LD) $(LDFLAGS) -Ttext 0x101000 -e _start -o $@ $^
62 $(OBJCOPY) -O binary $< $@
65 $(NASM) -f bin -o $@ -l $*.lst $<
72 syslogo.lss: syslogo.png $(PPMTOLSS16)
73 pngtopnm syslogo.png | \
74 $(PPMTOLSS16) \#000000=0 \#d0d0d0=7 \#f6f6f6=15 \
78 rm -f *.o *.a *.lst *.elf
80 # Don't specify *.com since mdiskchk.com can't be built using Linux tools
82 rm -f *.lss *.o *.c32 comecho.com