summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--MCONFIG2
-rw-r--r--MCONFIG.embedded35
-rw-r--r--com32/menu/Makefile4
-rw-r--r--com32/modules/Makefile8
-rw-r--r--dos/Makefile18
-rw-r--r--mbr/Makefile12
-rw-r--r--memdisk/Makefile13
-rw-r--r--memdump/Makefile17
-rw-r--r--sample/Makefile10
9 files changed, 53 insertions, 66 deletions
diff --git a/MCONFIG b/MCONFIG
index 6919ce76..9900ac4a 100644
--- a/MCONFIG
+++ b/MCONFIG
@@ -50,3 +50,5 @@ NM = nm
RANLIB = ranlib
GZIPPROG = gzip
PNGTOPNM = pngtopnm
+
+com32 = $(topdir)/com32
diff --git a/MCONFIG.embedded b/MCONFIG.embedded
new file mode 100644
index 00000000..fee374f7
--- /dev/null
+++ b/MCONFIG.embedded
@@ -0,0 +1,35 @@
+## -*- makefile -*- ------------------------------------------------------
+##
+## Copyright 2001-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., 53 Temple Place Ste 330,
+## Boston MA 02111-1307, USA; either version 2 of the License, or
+## (at your option) any later version; incorporated herein by reference.
+##
+## -----------------------------------------------------------------------
+
+##
+## Make configuration for embedded directories
+##
+
+include $(topdir)/MCONFIG
+
+GCCOPT := $(call gcc_ok,-m32,) \
+ $(call gcc_ok,-ffreestanding,) \
+ $(call gcc_ok,-fno-stack-protector,) \
+ $(call gcc_ok,-falign-functions=0,-malign-functions=0) \
+ $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \
+ $(call gcc_ok,-falign-loops=0,-malign-loops=0) \
+ -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 \
+ -msoft-float
+
+LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
+
+LD += -m elf_i386
+CFLAGS = $(GCCOPT) -g -W -Wall $(OPTFLAGS) $(INCLUDES)
+SFLAGS = $(CFLAGS) -D__ASSEMBLY__
+
+.SUFFIXES: .c .o .S .s .i .elf .com .bin .asm .lst .c32 .lss
+
diff --git a/com32/menu/Makefile b/com32/menu/Makefile
index 73cf5867..cfdea06a 100644
--- a/com32/menu/Makefile
+++ b/com32/menu/Makefile
@@ -28,10 +28,10 @@ COMMONOBJS = menumain.o readconfig.o passwd.o printmsg.o colors.o \
all: $(MODULES) $(TESTFILES)
-menu.elf : menu.o $(COMMONOBJS) $(LIBS)
+menu.elf : menu.o $(COMMONOBJS) $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-vesamenu.elf : vesamenu.o $(COMMONOBJS) $(LIBS)
+vesamenu.elf : vesamenu.o $(COMMONOBJS) $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 2f6fb252..691e929a 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -25,16 +25,16 @@ TESTFILES =
all: $(MODULES) $(TESTFILES)
-pcitest.elf : pcitest.o $(LIBS)
+pcitest.elf : pcitest.o $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-cpuidtest.elf : cpuidtest.o cpuid.o $(LIBS)
+cpuidtest.elf : cpuidtest.o cpuid.o $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-dmitest.elf : dmitest.o dmi_utils.o dmi.o $(LIBS)
+dmitest.elf : dmitest.o dmi_utils.o dmi.o $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
-ethersel.elf : ethersel.o $(LIBS)
+ethersel.elf : ethersel.o $(LIBS) $(C_LIBS)
$(LD) $(LDFLAGS) -o $@ $^
tidy dist:
diff --git a/dos/Makefile b/dos/Makefile
index 028e8330..da73a6d5 100644
--- a/dos/Makefile
+++ b/dos/Makefile
@@ -15,24 +15,12 @@
##
topdir = ..
-include $(topdir)/MCONFIG
+include $(topdir)/MCONFIG.embedded
-GCCOPT := $(call gcc_ok,-m32,) \
- $(call gcc_ok,-ffreestanding,) \
- $(call gcc_ok,-fno-stack-protector,) \
- $(call gcc_ok,-falign-functions=0,-malign-functions=0) \
- $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \
- $(call gcc_ok,-falign-loops=0,-malign-loops=0) \
- -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 \
- -msoft-float
-
-LIBGCC := $(shell $(CC) $(GCCOPT) --print-libgcc)
-
-LDFLAGS = -m elf_i386 -T com16.ld
+LDFLAGS = -T com16.ld
OPTFLAGS = -g
INCLUDES = -include code16.h -nostdinc -iwithprefix include \
-I. -I.. -I../libfat -I ../libinstaller
-CFLAGS = $(GCCOPT) -W -Wall -msoft-float $(OPTFLAGS) $(INCLUDES)
SRCS = syslinux.c \
../libinstaller/syslxmod.c \
@@ -44,8 +32,6 @@ OBJS = crt0.o $(patsubst %.c,%.o,$(notdir $(SRCS)))
LIBOBJS = conio.o memcpy.o memset.o skipatou.o atou.o malloc.o free.o \
argv.o printf.o __divdi3.o __udivmoddi4.o
-.SUFFIXES: .c .o .i .s .S .elf .com .asm .lst
-
VPATH = .:../libfat:../libinstaller
TARGETS = syslinux.com copybs.com
diff --git a/mbr/Makefile b/mbr/Makefile
index 6ae63719..7952e60b 100644
--- a/mbr/Makefile
+++ b/mbr/Makefile
@@ -15,17 +15,7 @@
#
topdir = ..
-include $(topdir)/MCONFIG
-
-GCCOPT := $(call gcc_ok,-m32,) \
- $(call gcc_ok,-ffreestanding,) \
- $(call gcc_ok,-fno-stack-protector) \
- -march=i386 -Os
-
-LDFLAGS = -m elf_i386
-SFLAGS = $(GCCOPT)
-
-.SUFFIXES: .S .s .o .elf
+include $(topdir)/MCONFIG.embedded
all: mbr.bin gptmbr.bin
diff --git a/memdisk/Makefile b/memdisk/Makefile
index 66a6e51a..d3023a0e 100644
--- a/memdisk/Makefile
+++ b/memdisk/Makefile
@@ -11,28 +11,17 @@
## -----------------------------------------------------------------------
topdir = ..
-include $(topdir)/MCONFIG
+include $(topdir)/MCONFIG.embedded
-include $(topdir)/version.mk
-GCCOPT := $(call gcc_ok,-m32,) \
- $(call gcc_ok,-ffreestanding,) \
- $(call gcc_ok,-fno-stack-protector) \
- $(call gcc_ok,-falign-functions=0,-malign-functions=0) \
- $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \
- $(call gcc_ok,-falign-loops=0,-malign-loops=0) \
- -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3
-
CFLAGS = $(GCCOPT) -g -W -Wall -Wno-sign-compare -DDATE='"$(DATE)"'
SFLAGS = $(GCCOPT) -D__ASSEMBLY__
LDFLAGS = $(GCCOPT) -g
INCLUDE = -I$(topdir)/com32/include
-LD += -m elf_i386
NASM = nasm
NASMOPT = -O9999
NFLAGS = -dDATE='"$(DATE)"' -dWITH_EDD
NINCLUDE =
-OBJCOPY = objcopy
-PERL = perl
SRCS = $(wildcard *.asm *.c *.h)
diff --git a/memdump/Makefile b/memdump/Makefile
index 44677239..6696020c 100644
--- a/memdump/Makefile
+++ b/memdump/Makefile
@@ -15,21 +15,10 @@
##
topdir = ..
-include $(topdir)/MCONFIG
-
-GCCOPT := $(call gcc_ok,-m32,) \
- $(call gcc_ok,-ffreestanding,) \
- $(call gcc_ok,-fno-stack-protector,) \
- $(call gcc_ok,-falign-functions=0,-malign-functions=0) \
- $(call gcc_ok,-falign-jumps=0,-malign-jumps=0) \
- $(call gcc_ok,-falign-loops=0,-malign-loops=0) \
- -march=i386 -Os -fomit-frame-pointer -mregparm=3 -DREGPARM=3 \
- -msoft-float
-
-LD += -m elf_i386
-OPTFLAGS = -g
+include $(topdir)/MCONFIG.embedded
+
+OPTFLAGS =
INCLUDES = -include code16.h -I.
-CFLAGS = $(GCCOPT) -W -Wall $(OPTFLAGS) $(INCLUDES)
LDFLAGS = -T com16.ld
SRCS = main.c serial.c ymsend.c
diff --git a/sample/Makefile b/sample/Makefile
index d9df4582..8560b3e1 100644
--- a/sample/Makefile
+++ b/sample/Makefile
@@ -15,19 +15,15 @@
##
topdir = ..
-include $(topdir)/MCONFIG
+include $(topdir)/MCONFIG.embedded
+
+INCLUDES = -I$(com32)/include
-LD += -m elf_i386
-CFLAGS = $(GCCOPT) -W -Wall -I$(topdir)/com32/include
-SFLAGS = $(GCCOPT)
-LDFLAGS = -s
PPMTOLSS16 = $(topdir)/utils/ppmtolss16
LIB = liboldcom32.a
LIBOBJS = conio.o atou.o skipatou.o printf.o c32exit.o
-.SUFFIXES: .lss .c .o .elf .c32
-
all: syslogo.lss comecho.com hello.c32 hello2.c32 filetest.c32 c32echo.c32 \
fd.c32 $(LIB)