diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-08-20 15:15:34 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-08-20 15:15:34 -0700 |
commit | bd09a6d828fa492aed4406adde6c412e0e5c640d (patch) | |
tree | 660a4813999ba273afb26fd3e137399cb0a57a97 /com32/MCONFIG | |
parent | 6aa3a1c8380276387430684eb39650e958b0030a (diff) | |
download | syslinux-bd09a6d828fa492aed4406adde6c412e0e5c640d.tar.gz |
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/MCONFIG')
-rw-r--r-- | com32/MCONFIG | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/com32/MCONFIG b/com32/MCONFIG new file mode 100644 index 00000000..2b7e018b --- /dev/null +++ b/com32/MCONFIG @@ -0,0 +1,68 @@ +## -*- makefile -*- ------------------------------------------------------- +## +## Copyright 2008 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., 51 Franklin St, Fifth Floor, +## Boston MA 02110-1301, USA; either version 2 of the License, or +## (at your option) any later version; incorporated herein by reference. +## +## ----------------------------------------------------------------------- + +## +## COM32 common configurables +## + +include $(topdir)/MCONFIG + +GCCOPT := $(call gcc_ok,-std=gnu99,) \ + $(call gcc_ok,-m32,) \ + $(call gcc_ok,-fno-stack-protector,) \ + -mregparm=3 -DREGPARM=3 -march=i386 -Os + +com32 = $(topdir)/com32 + +CFLAGS = $(GCCOPT) -W -Wall -march=i386 \ + -fomit-frame-pointer -D__COM32__ \ + -nostdinc -iwithprefix include \ + -I$(com32)/libutil/include -I$(com32)/include +SFLAGS = $(GCCOPT) -D__COM32__ -march=i386 +LDFLAGS = -m elf_i386 -T $(com32)/lib/com32.ld +LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc) + +LNXCFLAGS = -I$(com32)/libutil/include -W -Wall -O -g -D_GNU_SOURCE +LNXSFLAGS = -g +LNXLDFLAGS = -g + +C_LIBS = $(com32)/libutil/libutil_com.a $(com32)/lib/libcom32.a $(LIBGCC) +C_LNXLIBS = $(com32)/libutil/libutil_lnx.a + +.SUFFIXES: .lss .c .lo .o .elf .c32 .lnx + +.PRECIOUS: %.o +%.o: %.S + $(CC) $(SFLAGS) -c -o $@ $< + +.PRECIOUS: %.o +%.o: %.c + $(CC) $(CFLAGS) -c -o $@ $< + +.PRECIOUS: %.elf +%.elf: %.o $(LIBS) $(C_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) $(C_LNXLIBS) + $(CC) $(LNXCFLAGS) -o $@ $^ + +%.c32: %.elf + $(OBJCOPY) -O binary $< $@ |