aboutsummaryrefslogtreecommitdiff
path: root/sys/conf/Makefile.i386
diff options
context:
space:
mode:
authorJohn Polstra <jdp@FreeBSD.org>1997-04-22 06:55:47 +0000
committerJohn Polstra <jdp@FreeBSD.org>1997-04-22 06:55:47 +0000
commit9081eec1fb8813af57c6a7c53069bf8643bd399e (patch)
tree200cd3979eb17191e8d11bfa5b0bbeb2cef69c8e /sys/conf/Makefile.i386
parent7d2f1d1f8c8d396e5ff69f69deeff33c0fcacfe6 (diff)
downloadsrc-9081eec1fb8813af57c6a7c53069bf8643bd399e.tar.gz
src-9081eec1fb8813af57c6a7c53069bf8643bd399e.zip
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.
Notes
Notes: svn path=/head/; revision=25083
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 15d7cfd96245..d1cacbcf1b95 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