summaryrefslogtreecommitdiffstats
path: root/sys/conf/Makefile.i386
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1997-04-22 06:55:47 +0000
committerjdp <jdp@FreeBSD.org>1997-04-22 06:55:47 +0000
commitae3a563c6ee04fa1b4d008183af8eb1e1f23f05e (patch)
tree4bf568e3ad4a7debc59e03b325c4fd155f8e7f1e /sys/conf/Makefile.i386
parent23b3d8266325c10c3d66be6ba93ad96a46c2f2bd (diff)
downloadFreeBSD-src-ae3a563c6ee04fa1b4d008183af8eb1e1f23f05e.zip
FreeBSD-src-ae3a563c6ee04fa1b4d008183af8eb1e1f23f05e.tar.gz
Make the necessary changes so that an ELF kernel can be built. I
have successfully built, booted, and run a number of different ELF kernel configurations, including GENERIC. LINT also builds and links cleanly, though I have not tried to boot it. The impact on developers is virtually nil, except for two things. All linker sets that might possibly be present in the kernel must be listed in "sys/i386/i386/setdefs.h". And all C symbols that are also referenced from assembly language code must be listed in "sys/i386/include/asnames.h". It so happens that failure to do these things will have no impact on the a.out kernel. But it will break the build of the ELF kernel. The ELF bootloader works, but it is not ready to commit quite yet.
Diffstat (limited to 'sys/conf/Makefile.i386')
-rw-r--r--sys/conf/Makefile.i38632
1 files changed, 23 insertions, 9 deletions
diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386
index 15d7cfd..d1cacbc 100644
--- a/sys/conf/Makefile.i386
+++ b/sys/conf/Makefile.i386
@@ -1,7 +1,7 @@
# Makefile.i386 -- with config changes.
# Copyright 1990 W. Jolitz
# from: @(#)Makefile.i386 7.1 5/10/91
-# $Id$
+# $Id: Makefile.i386,v 1.93 1997/02/22 09:31:39 peter Exp $
#
# Makefile for FreeBSD
#
@@ -15,9 +15,9 @@
# /sys/i386/conf/Makefile.i386
# after which config should be rerun for all machines.
#
-CC?= cc
-CPP?= cpp
-LD?= /usr/bin/ld
+
+BINFORMAT?= aout
+#BINFORMAT?= elf
.if exists(./@/.)
S= ./@
@@ -54,18 +54,26 @@ DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $<
DRIVER_S= ${CC} -c -x assembler-with-cpp -DLOCORE ${COPTS} $<
PROFILE_C= ${CC} -c ${CFLAGS} ${PARAM} $<
-SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c
+SYSTEM_CFILES= ${I386}/i386/setdef0.c ioconf.c param.c vnode_if.c config.c \
+ ${I386}/i386/setdef1.c
SYSTEM_SFILES= ${I386}/i386/locore.s
-SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
+SYSTEM_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \
+ setdef1.o
SYSTEM_DEP= Makefile symbols.exclude symbols.sort ${SYSTEM_OBJS}
-SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
-SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o
.if ${CFLAGS:M-g} == ""
SYMORDER_EXCLUDE=-x symbols.exclude
.endif
+SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
+.if ${BINFORMAT} == aout
+SYSTEM_LD= @${LD} -Bstatic -Z -T ${LOAD_ADDRESS} -o $@ -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @echo rearranging symbols; \
symorder -m ${SYMORDER_EXCLUDE} symbols.sort $@; \
size $@; chmod 755 $@
+.endif
+.if ${BINFORMAT} == elf
+SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -o $@ -X ${SYSTEM_OBJS} vers.o
+SYSTEM_LD_TAIL= @size $@; chmod 755 $@
+.endif
%BEFORE_DEPEND
@@ -101,6 +109,12 @@ symbols.sort: ${I386}/i386/symbols.raw
locore.o: ${I386}/i386/locore.s assym.s
${NORMAL_S}
+setdef0.o: ${I386}/i386/setdef0.c
+ ${NORMAL_C}
+
+setdef1.o: ${I386}/i386/setdef1.c
+ ${NORMAL_C}
+
# everything potentially depends on the Makefile since everything potentially
# depends on the options. Some things are more dependent on the Makefile for
# historical reasons.
@@ -134,7 +148,7 @@ depend: assym.s param.c vnode_if.h ${BEFORE_DEPEND}
rm -f .newdep
mkdep -a -f .newdep ${COPTS} ${CFILES} ${SYSTEM_CFILES}
mkdep -a -f .newdep ${COPTS} ${PARAM} -UKERNEL ${I386}/i386/genassym.c
- MKDEP_CPP="${CPP}" ; export MKDEP_CPP ; \
+ MKDEP_CPP="${CC} -E -x assembler-with-cpp" ; export MKDEP_CPP ; \
mkdep -a -f .newdep -DLOCORE ${COPTS} ${SFILES} ${SYSTEM_SFILES}
rm -f .depend
mv -f .newdep .depend
OpenPOWER on IntegriCloud