diff options
author | hpa <hpa> | 2004-12-08 19:42:54 +0000 |
---|---|---|
committer | hpa <hpa> | 2004-12-08 19:42:54 +0000 |
commit | 6d9fffcea45d238a0e001d3a53277b6d8ba6b14e (patch) | |
tree | f801567dd914f805249b6935dc94cc0231b23618 /com32/samples/Makefile | |
parent | 9d8d831238b6b9b0cd3fcec17b0fe8ea1d7db5c7 (diff) | |
download | syslinux-elf-6d9fffcea45d238a0e001d3a53277b6d8ba6b14e.tar.gz syslinux-elf-6d9fffcea45d238a0e001d3a53277b6d8ba6b14e.tar.xz syslinux-elf-6d9fffcea45d238a0e001d3a53277b6d8ba6b14e.zip |
Separate modules (intended to be production code used for real stuff)
and samples (demo code).
Diffstat (limited to 'com32/samples/Makefile')
-rw-r--r-- | com32/samples/Makefile | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/com32/samples/Makefile b/com32/samples/Makefile new file mode 100644 index 00000000..93b7343a --- /dev/null +++ b/com32/samples/Makefile @@ -0,0 +1,80 @@ +#ident "$Id$" +## ----------------------------------------------------------------------- +## +## Copyright 2001-2004 H. Peter Anvin - All Rights Reserved +## +## This program is free software; you can redistribute it and/or modify +## it under the terms of the GNU General Public License as published by +## the Free Software Foundation, Inc., 675 Mass Ave, Cambridge MA 02139, +## USA; either version 2 of the License, or (at your option) any later +## version; incorporated herein by reference. +## +## ----------------------------------------------------------------------- + +## +## samples for syslinux users +## + +gcc_ok = $(shell if gcc $(1) -c -x c /dev/null -o /dev/null 2>/dev/null; \ + then echo $(1); else echo $(2); fi) + +M32 := $(call gcc_ok,-m32,) + +CC = gcc $(M32) +LD = ld -m elf_i386 +AR = ar +NASM = nasm +RANLIB = ranlib +CFLAGS = -W -Wall -march=i386 -Os -fomit-frame-pointer -I../libutil/include -I../include -D__COM32__ +LNXCFLAGS = -W -Wall -march=i386 -Os -g -I../libutil/include +LNXSFLAGS = -march=i386 +LNXLDFLAGS = -g +SFLAGS = -D__COM32__ -march=i386 +LDFLAGS = -T ../lib/com32.ld +OBJCOPY = objcopy +PPMTOLSS16 = ../ppmtolss16 +LIBGCC := $(shell $(CC) --print-libgcc) +LIBS = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC) +LNXLIBS = ../libutil/libutil_lnx.a + +.SUFFIXES: .lss .c .o .elf .c32 .lnx + +all: hello.c32 \ + fancyhello.c32 fancyhello.lnx \ + keytest.c32 keytest.lnx + +.PRECIOUS: %.o +%.o: %.S + $(CC) $(SFLAGS) -c -o $@ $< + +.PRECIOUS: %.o +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PRECIOUS: %.elf +%.elf: %.o $(LIBS) + $(LD) $(LDFLAGS) -o $@ $^ + +.PRECIOUS: %.lo +%.lo: %.S + $(CC) $(LNXSFLAGS) -c -o $@ $< + +.PRECIOUS: %.lo +%.lo: %.c + $(CC) $(LNXCFLAGS) -c -o $@ $< + +.PRECIOUS: %.lnx +%.lnx: %.lo $(LNXLIBS) + $(CC) $(LNXLDFLAGS) -o $@ $^ + +%.c32: %.elf + $(OBJCOPY) -O binary $< $@ + +tidy: + rm -f *.o *.lo *.a *.lst *.elf + +clean: tidy + rm -f *.lss *.c32 *.lnx *.com + +spotless: clean + rm -f *~ \#* |