Adding upstream version 4.01+dfsg.
[syslinux-debian/hramrach.git] / sample / Makefile
blob9fa21c2a8259c82c4b6925819d4ee19b51b7c6d6
1 ## -----------------------------------------------------------------------
2 ##
3 ## Copyright 2001-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.
11 ## -----------------------------------------------------------------------
14 ## samples for syslinux users
17 topdir = ..
18 include $(topdir)/MCONFIG.embedded
20 INCLUDES = -I$(com32)/include
22 PPMTOLSS16 = $(topdir)/utils/ppmtolss16
23 LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
24 LIB = liboldcom32.a
26 LIBOBJS = conio.o atou.o skipatou.o printf.o c32exit.o
28 com32 = $(topdir)/com32
29 C_LIBS = $(com32)/libutil/libutil_com.a $(com32)/lib/libcom32.a $(LIBGCC)
30 LDFLAGS = -m elf_i386 -T $(com32)/lib/com32.ld
32 all: syslogo.lss comecho.com hello.c32 hello2.c32 filetest.c32 c32echo.c32 \
33 fd.c32 $(LIB)
35 .PRECIOUS: %.o
37 .PRECIOUS: %.elf
38 %.elf: c32entry.o %.o $(LIB)
39 $(LD) -Ttext 0x101000 -e _start -o $@ $^
41 %.c32: %.elf
42 $(OBJCOPY) -O binary $< $@
44 %.com: %.asm
45 ( $(NASM) -M -DDEPEND -o $@ $< ; echo '' ) > .$@.d ; true
46 $(NASM) $(NASMOPT) -f bin -o $@ -l $*.lst $<
48 $(LIB): $(LIBOBJS)
49 rm -f $@
50 $(AR) cq $@ $^
51 $(RANLIB) $@
53 %.lss: %.ppm.gz $(PPMTOLSS16)
54 $(GZIPPROG) -cd $< | \
55 $(PPMTOLSS16) \#000000=0 \#d0d0d0=7 \#f6f6f6=15 \
56 > $@
58 %.ppm.gz: %.png
59 $(PNGTOPNM) $< | gzip -9 > $@
61 tidy dist:
62 rm -f *.o *.a *.lst *.elf .*.d
64 # Don't specify *.com since mdiskchk.com can't be built using Linux tools
65 clean: tidy
66 rm -f *.lss *.o *.c32 comecho.com
68 spotless: clean
70 -include .*.d