aboutsummaryrefslogtreecommitdiffstats
path: root/com32/samples/Makefile
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2008-08-20 15:15:34 -0700
committerH. Peter Anvin <hpa@zytor.com>2008-08-20 15:15:34 -0700
commitbd09a6d828fa492aed4406adde6c412e0e5c640d (patch)
tree660a4813999ba273afb26fd3e137399cb0a57a97 /com32/samples/Makefile
parent6aa3a1c8380276387430684eb39650e958b0030a (diff)
downloadsyslinux-elf-bd09a6d828fa492aed4406adde6c412e0e5c640d.tar.gz
syslinux-elf-bd09a6d828fa492aed4406adde6c412e0e5c640d.tar.xz
syslinux-elf-bd09a6d828fa492aed4406adde6c412e0e5c640d.zip
Major Makefile cleanups; gcc 4.3.0 compatiblity
Cleanup and centralize the Makefile system even more. Fix a gcc 4.3 incompatibility in memdisk (definition of strlen).
Diffstat (limited to 'com32/samples/Makefile')
-rw-r--r--com32/samples/Makefile62
1 files changed, 3 insertions, 59 deletions
diff --git a/com32/samples/Makefile b/com32/samples/Makefile
index c06668d9..28260a35 100644
--- a/com32/samples/Makefile
+++ b/com32/samples/Makefile
@@ -14,37 +14,8 @@
## samples for syslinux users
##
-TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
-CC = gcc
-
-gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
- then echo $(1); else echo $(2); fi; rm -f $$tmpf)
-
-GCCOPT := $(call gcc_ok,-std=gnu99,) \
- $(call gcc_ok,-m32,) \
- $(call gcc_ok,-fno-stack-protector,) \
-
-LD = ld -m elf_i386
-AR = ar
-NASM = nasm
-NASMOPT = -O9999
-RANLIB = ranlib
-CFLAGS = $(GCCOPT) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \
- -fomit-frame-pointer -D__COM32__ \
- -nostdinc -iwithprefix include \
- -I../libutil/include -I../include \
- -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
-LNXCFLAGS = -W -Wall -O -g -I../libutil/include
-LNXSFLAGS = -g
-LNXLDFLAGS = -g
-SFLAGS = -D__COM32__ -march=i386
-LDFLAGS = -T ../lib/com32.ld
-OBJCOPY = objcopy
-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
+topdir = ../..
+include ../MCONFIG
all: hello.c32 cat.c32 resolv.c32 vesainfo.c32 serialinfo.c32 \
localboot.c32 \
@@ -52,35 +23,8 @@ all: hello.c32 cat.c32 resolv.c32 vesainfo.c32 serialinfo.c32 \
keytest.c32 keytest.lnx \
advdump.c32
-.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 dist:
- rm -f *.o *.lo *.a *.lst *.elf .*.d
+ rm -f *.o *.lo *.a *.lst *.elf .*.d *.tmp
clean: tidy
rm -f *.lss *.c32 *.lnx *.com