aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
Diffstat (limited to 'com32')
-rw-r--r--com32/MCONFIG98
-rw-r--r--com32/cmenu/Makefile5
-rw-r--r--com32/gdbstub/Makefile3
-rw-r--r--com32/gfxboot/Makefile3
-rw-r--r--com32/gpllib/Makefile3
-rw-r--r--com32/hdt/Makefile8
-rw-r--r--com32/lib/MCONFIG80
-rw-r--r--com32/lib/Makefile5
-rw-r--r--com32/libupload/Makefile3
-rw-r--r--com32/libutil/Makefile3
-rw-r--r--com32/lua/src/Makefile6
-rw-r--r--com32/mboot/Makefile6
-rw-r--r--com32/menu/Makefile8
-rw-r--r--com32/modules/Makefile3
-rw-r--r--com32/rosh/MCONFIG27
-rw-r--r--com32/rosh/Makefile3
-rw-r--r--com32/samples/Makefile3
-rw-r--r--com32/sysdump/Makefile7
-rw-r--r--com32/tools/Makefile4
19 files changed, 42 insertions, 236 deletions
diff --git a/com32/MCONFIG b/com32/MCONFIG
deleted file mode 100644
index a74ed326..00000000
--- a/com32/MCONFIG
+++ /dev/null
@@ -1,98 +0,0 @@
-## -*- makefile -*- -------------------------------------------------------
-##
-## Copyright 2008-2009 H. Peter Anvin - All Rights Reserved
-## Copyright 2009 Intel Corporation; author: H. Peter Anvin
-##
-## 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,)
-GCCOPT += $(call gcc_ok,-m32,)
-GCCOPT += $(call gcc_ok,-fno-stack-protector,)
-GCCOPT += $(call gcc_ok,-fwrapv,)
-GCCOPT += $(call gcc_ok,-freg-struct-return,)
-GCCOPT += -mregparm=3 -DREGPARM=3 -march=i386 -Os
-GCCOPT += $(call gcc_ok,-fPIE,-fPIC)
-GCCOPT += $(call gcc_ok,-fno-exceptions,)
-GCCOPT += $(call gcc_ok,-fno-asynchronous-unwind-tables,)
-GCCOPT += $(call gcc_ok,-fno-strict-aliasing,)
-GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
-GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
-GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
-GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
-GCCOPT += $(call gcc_ok,-mpreferred-stack-boundary=2,)
-GCCOPT += $(call gcc_ok,-incoming-stack-boundary=2,)
-
-com32 := $(topdir)/com32
-RELOCS := $(com32)/tools/relocs
-
-ifneq ($(NOGPL),1)
-GPLLIB = $(com32)/gpllib/libcom32gpl.a
-GPLINCLUDE = -I$(com32)/gplinclude
-else
-GPLLIB =
-GPLINCLUDE =
-endif
-
-CFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \
- -fomit-frame-pointer -D__COM32__ \
- -nostdinc -iwithprefix include \
- -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE)
-SFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \
- -fomit-frame-pointer -D__COM32__ \
- -nostdinc -iwithprefix include \
- -I$(com32)/libutil/include -I$(com32)/include $(GPLINCLUDE)
-
-COM32LD = $(com32)/lib/com32.ld
-LDFLAGS = -m elf_i386 --emit-relocs -T $(COM32LD)
-LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
-
-LNXCFLAGS = -I$(com32)/libutil/include $(GCCWARN) -O -g \
- -D_GNU_SOURCE -D_FORTIFY_SOURCE=0 -Wno-error
-LNXSFLAGS = -g
-LNXLDFLAGS = -g
-
-C_LIBS = $(com32)/libutil/libutil_com.a $(GPLLIB) \
- $(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) $(MAKEDEPS) $(SFLAGS) -c -o $@ $<
-
-.PRECIOUS: %.o
-%.o: %.c
- $(CC) $(MAKEDEPS) $(CFLAGS) -c -o $@ $<
-
-.PRECIOUS: %.elf
-%.elf: %.o $(LIBS) $(C_LIBS) $(COM32LD)
- $(LD) $(LDFLAGS) -o $@ $(filter-out $(COM32LD),$^)
-
-.PRECIOUS: %.lo
-%.lo: %.S
- $(CC) $(MAKEDEPS) $(LNXSFLAGS) -c -o $@ $<
-
-.PRECIOUS: %.lo
-%.lo: %.c
- $(CC) $(MAKEDEPS) $(LNXCFLAGS) -c -o $@ $<
-
-.PRECIOUS: %.lnx
-%.lnx: %.lo $(LNXLIBS) $(C_LNXLIBS)
- $(CC) $(LNXCFLAGS) -o $@ $^
-
-%.c32: %.elf
- $(OBJCOPY) -O binary $< $@
- $(RELOCS) $< >> $@ || ( rm -f $@ ; false )
diff --git a/com32/cmenu/Makefile b/com32/cmenu/Makefile
index 794af741..446bbcdd 100644
--- a/com32/cmenu/Makefile
+++ b/com32/cmenu/Makefile
@@ -17,11 +17,12 @@
NOGPL := 1
-# This must be defined before MCONFIG is included
+# This must be defined before com32.mk is included
LIBS = libmenu/libmenu.a
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
CFLAGS += -I./libmenu
diff --git a/com32/gdbstub/Makefile b/com32/gdbstub/Makefile
index 5513876b..38d003cc 100644
--- a/com32/gdbstub/Makefile
+++ b/com32/gdbstub/Makefile
@@ -15,7 +15,8 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
CFLAGS += -fPIE
diff --git a/com32/gfxboot/Makefile b/com32/gfxboot/Makefile
index 73133e1b..183115f4 100644
--- a/com32/gfxboot/Makefile
+++ b/com32/gfxboot/Makefile
@@ -12,7 +12,8 @@
## -----------------------------------------------------------------------
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
MODULES = gfxboot.c32
diff --git a/com32/gpllib/Makefile b/com32/gpllib/Makefile
index 8e7fb430..4b7b8468 100644
--- a/com32/gpllib/Makefile
+++ b/com32/gpllib/Makefile
@@ -4,7 +4,8 @@
# Include configuration rules
topdir = ../..
-include ../lib/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/lib.mk
REQFLAGS += -I../gplinclude -I../gplinclude/zzjson
diff --git a/com32/hdt/Makefile b/com32/hdt/Makefile
index edacd85f..b4f4e359 100644
--- a/com32/hdt/Makefile
+++ b/com32/hdt/Makefile
@@ -16,11 +16,11 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
-LIBS = ../cmenu/libmenu/libmenu.a ../libutil/libutil_com.a \
- ../lib/libcom32.a ../libupload/libcom32upload.a $(LIBGCC)
-CFLAGS += -I$(com32)/cmenu/libmenu -I$(com32)
+LIBS = ../cmenu/libmenu/libmenu.a ../libupload/libcom32upload.a
+CFLAGS += -I$(com32)/cmenu/libmenu
MODULES = hdt.c32
TESTFILES =
diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG
deleted file mode 100644
index 44278bd1..00000000
--- a/com32/lib/MCONFIG
+++ /dev/null
@@ -1,80 +0,0 @@
-# -*- makefile -*-
-
-include $(topdir)/MCONFIG
-
-GCCOPT := $(call gcc_ok,-std=gnu99,)
-GCCOPT += $(call gcc_ok,-m32,)
-GCCOPT += $(call gcc_ok,-fno-stack-protector,)
-GCCOPT += $(call gcc_ok,-fwrapv,)
-GCCOPT += $(call gcc_ok,-freg-struct-return,)
-GCCOPT += $(call gcc_ok,-fPIE,-fPIC)
-GCCOPT += $(call gcc_ok,-fno-exceptions,)
-GCCOPT += $(call gcc_ok,-fno-asynchronous-unwind-tables,)
-GCCOPT += $(call gcc_ok,-fno-strict-aliasing,)
-GCCOPT += $(call gcc_ok,-falign-functions=0,-malign-functions=0)
-GCCOPT += $(call gcc_ok,-falign-jumps=0,-malign-jumps=0)
-GCCOPT += $(call gcc_ok,-falign-labels=0,-malign-labels=0)
-GCCOPT += $(call gcc_ok,-falign-loops=0,-malign-loops=0)
-GCCOPT += $(call gcc_ok,-mpreferred-stack-boundary=2,)
-
-INCLUDE = -I.
-STRIP = strip --strip-all -R .comment -R .note
-
-# zlib and libpng configuration flags
-LIBFLAGS = -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO \
- -DPNG_NO_WRITE_SUPPORTED \
- -DPNG_NO_MNG_FEATURES \
- -DPNG_NO_READ_tIME -DPNG_NO_WRITE_tIME
-
-# We need some features in libpng which apparently aren't available in the
-# fixed-point versions. It's OK, because we have to have a non-graphical
-# fallback anyway, just use that on old machines...
-# LIBFLAGS += -DPNG_NO_FLOATING_POINT_SUPPORTED
-
-REQFLAGS = $(GCCOPT) -g -mregparm=3 -DREGPARM=3 -D__COM32__ \
- -nostdinc -iwithprefix include -I. -I./sys -I../include
-OPTFLAGS = -Os -march=i386 -falign-functions=0 -falign-jumps=0 \
- -falign-labels=0 -ffast-math -fomit-frame-pointer
-WARNFLAGS = $(GCCWARN) -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
-
-CFLAGS = $(OPTFLAGS) $(REQFLAGS) $(WARNFLAGS) $(LIBFLAGS)
-LDFLAGS = -m elf32_i386
-
-.SUFFIXES: .c .o .a .so .lo .i .S .s .ls .ss .lss
-
-% : %.c # Cancel default rule
-
-% : %.S
-
-.c.o:
- $(CC) $(MAKEDEPS) $(CFLAGS) -c -o $@ $<
-
-.c.i:
- $(CC) $(MAKEDEPS) $(CFLAGS) -E -o $@ $<
-
-.c.s:
- $(CC) $(MAKEDEPS) $(CFLAGS) -S -o $@ $<
-
-.S.o:
- $(CC) $(MAKEDEPS) $(CFLAGS) -D__ASSEMBLY__ -c -o $@ $<
-
-.S.s:
- $(CC) $(MAKEDEPS) $(CFLAGS) -D__ASSEMBLY__ -E -o $@ $<
-
-.S.lo:
- $(CC) $(MAKEDEPS) $(CFLAGS) $(SOFLAGS) -D__ASSEMBLY__ -c -o $@ $<
-
-.S.ls:
- $(CC) $(MAKEDEPS) $(CFLAGS) $(SOFLAGS) -D__ASSEMBLY__ -E -o $@ $<
-
-.s.o:
- $(CC) $(MAKEDEPS) $(CFLAGS) -x assembler -c -o $@ $<
-
-.ls.lo:
- $(CC) $(MAKEDEPS) $(CFLAGS) $(SOFLAGS) -x assembler -c -o $@ $<
-
-.c.lo:
- $(CC) $(MAKEDEPS) $(CFLAGS) $(SOFLAGS) -c -o $@ $<
-
-.c.ls:
- $(CC) $(MAKEDEPS) $(CFLAGS) $(SOFLAGS) -S -o $@ $<
diff --git a/com32/lib/Makefile b/com32/lib/Makefile
index bf0da998..105c2bd6 100644
--- a/com32/lib/Makefile
+++ b/com32/lib/Makefile
@@ -4,8 +4,9 @@
# Include configuration rules
NOGPL := 1
-topdir = ../..
-include MCONFIG
+topdir = ../../
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/lib.mk
LIBOBJS = \
abort.o atexit.o atoi.o atol.o atoll.o calloc.o creat.o \
diff --git a/com32/libupload/Makefile b/com32/libupload/Makefile
index c009b6b9..83053350 100644
--- a/com32/libupload/Makefile
+++ b/com32/libupload/Makefile
@@ -1,6 +1,7 @@
# Include configuration rules
topdir = ../..
-include ../lib/MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
REQFLAGS += -I./
diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile
index 7a6b5272..83e23a0a 100644
--- a/com32/libutil/Makefile
+++ b/com32/libutil/Makefile
@@ -30,7 +30,8 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
LIBOBJS = ansiline.o ansiraw.o get_key.o keyname.o \
sha1hash.o unbase64.o \
diff --git a/com32/lua/src/Makefile b/com32/lua/src/Makefile
index 4081bfe1..14b0e33d 100644
--- a/com32/lua/src/Makefile
+++ b/com32/lua/src/Makefile
@@ -16,9 +16,9 @@
##
topdir = ../../..
-include ../../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
-LIBS = ../../lib/libcom32.a $(LIBGCC)
LNXLIBS =
# Temporarily allow warnings not being treated as errors
@@ -54,7 +54,7 @@ $(LIBLUA) : $(LIBLUA_OBJS)
$(AR) cq $@ $^
$(RANLIB) $@
-lua.elf : $(OBJS) $(LIBLUA) $(LIBS) $(C_LIBS)
+lua.elf : $(OBJS) $(LIBLUA) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/mboot/Makefile b/com32/mboot/Makefile
index 7e6c2e96..b7ee1154 100644
--- a/com32/mboot/Makefile
+++ b/com32/mboot/Makefile
@@ -16,9 +16,9 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
-LIBS = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
LNXLIBS = ../libutil/libutil_lnx.a
MODULES = mboot.c32
@@ -28,7 +28,7 @@ OBJS = mboot.o map.o mem.o initvesa.o apm.o solaris.o syslinux.o
all: $(MODULES) $(TESTFILES)
-mboot.elf : $(OBJS) $(LIBS) $(C_LIBS)
+mboot.elf : $(OBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/menu/Makefile b/com32/menu/Makefile
index 2a032728..b67b997d 100644
--- a/com32/menu/Makefile
+++ b/com32/menu/Makefile
@@ -15,9 +15,9 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
-LIBS = ../libutil/libutil_com.a ../lib/libcom32.a $(LIBGCC)
LNXLIBS = ../libutil/libutil_lnx.a
MODULES = menu.c32 vesamenu.c32
@@ -28,10 +28,10 @@ COMMONOBJS = menumain.o readconfig.o passwd.o drain.o printmsg.o colors.o \
all: $(MODULES) $(TESTFILES)
-menu.elf : menu.o $(COMMONOBJS) $(LIBS) $(C_LIBS)
+menu.elf : menu.o $(COMMONOBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-vesamenu.elf : vesamenu.o $(COMMONOBJS) $(LIBS) $(C_LIBS)
+vesamenu.elf : vesamenu.o $(COMMONOBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 8e061f73..e9ce1d1f 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -16,7 +16,8 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
MODULES = chain.c32 config.c32 ethersel.c32 dmitest.c32 cpuidtest.c32 \
disk.c32 pcitest.c32 elf.c32 linux.c32 reboot.c32 pmload.c32 \
diff --git a/com32/rosh/MCONFIG b/com32/rosh/MCONFIG
deleted file mode 100644
index 25c41396..00000000
--- a/com32/rosh/MCONFIG
+++ /dev/null
@@ -1,27 +0,0 @@
-## -*- 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 GRC configurables
-##
-
-## Include the COM32 common configurables
-include ../MCONFIG
-
-# CFLAGS = $(GCCOPT) $(GCCWARN) -march=i386 \
-# -fomit-frame-pointer -D__COM32__ \
-# -nostdinc -iwithprefix include \
-# -I$(com32)/libutil/include -I$(com32)/include
-# -g3 -dD
-
-# LNXCFLAGS = -I$(com32)/libutil/include $(GCCWARN) -O -g3 -D_GNU_SOURCE -dD
-# -U__GNUC__
diff --git a/com32/rosh/Makefile b/com32/rosh/Makefile
index f4b7d866..766f68d5 100644
--- a/com32/rosh/Makefile
+++ b/com32/rosh/Makefile
@@ -17,7 +17,8 @@
##
topdir = ../..
-include MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/rosh.mk
# from com32/sysdump/Makefile
# The DATE is set on the make command line when building binaries for
diff --git a/com32/samples/Makefile b/com32/samples/Makefile
index bee2b992..76986d59 100644
--- a/com32/samples/Makefile
+++ b/com32/samples/Makefile
@@ -15,7 +15,8 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
all: hello.c32 resolv.c32 serialinfo.c32 \
localboot.c32 \
diff --git a/com32/sysdump/Makefile b/com32/sysdump/Makefile
index 3de8a5b8..e4290993 100644
--- a/com32/sysdump/Makefile
+++ b/com32/sysdump/Makefile
@@ -16,10 +16,11 @@
##
topdir = ../..
-include ../MCONFIG
+MAKEDIR = $(topdir)/mk
+include $(MAKEDIR)/com32.mk
-include $(topdir)/version.mk
-LIBS = ../libutil/libutil_com.a ../lib/libcom32.a ../libupload/libcom32upload.a $(LIBGCC)
+LIBS = ../libupload/libcom32upload.a
LNXLIBS = ../libutil/libutil_lnx.a
CFLAGS += -I$(com32) -I$(topdir)
@@ -44,7 +45,7 @@ CFLAGS += -DDATE='"$(DATE)"'
all: $(MODULES) $(TESTFILES)
-sysdump.elf : $(OBJS) $(LIBS) $(C_LIBS)
+sysdump.elf : $(OBJS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/tools/Makefile b/com32/tools/Makefile
index e34296b4..7badabd2 100644
--- a/com32/tools/Makefile
+++ b/com32/tools/Makefile
@@ -10,8 +10,8 @@
##
## -----------------------------------------------------------------------
-topdir = ../..
-include $(topdir)/MCONFIG.build
+MAKEDIR = ../../mk
+include $(MAKEDIR)/build.mk
BINS = relocs