summaryrefslogtreecommitdiffstats
path: root/sys/conf/Makefile.i386
diff options
context:
space:
mode:
authorjdp <jdp@FreeBSD.org>1997-05-21 23:21:30 +0000
committerjdp <jdp@FreeBSD.org>1997-05-21 23:21:30 +0000
commit9d49e3ca10793934650b1b143aac73511eaea0d7 (patch)
tree3b411b9c2272ca42fb229552d2c3cfea00b7e050 /sys/conf/Makefile.i386
parenta57b7759a5c877fc07cfd3ce98eefc8dc1524d82 (diff)
downloadFreeBSD-src-9d49e3ca10793934650b1b143aac73511eaea0d7.zip
FreeBSD-src-9d49e3ca10793934650b1b143aac73511eaea0d7.tar.gz
This commit affects ELF kernels only.
Remove "setdefs.h" and arrange to generate it automatically at ELF kernel build time. "gensetdefs.c" is a utility which scans a set of ELF object files and outputs a line ``DEFINE_SET(name, length);'' for each linker set that it finds. When generating an ELF kernel, this is run just before the final link to generate "setdefs.h". Remove the init_sets() function from "setdef0.c", and its call from "machdep.c". Since "gensetdefs.c" calculates the length of each set, it is no longer necessary in an ELF kernel to count the set elements at kernel initialization time. Also remove "set_of_sets" which was used for this purpose. Link "setdef0" and "setdef1" into the kernel only if building for ELF. Since init_sets() is no longer used, there is no need to link them into an a.out kernel.
Diffstat (limited to 'sys/conf/Makefile.i386')
-rw-r--r--sys/conf/Makefile.i38635
1 files changed, 25 insertions, 10 deletions
diff --git a/sys/conf/Makefile.i386 b/sys/conf/Makefile.i386
index 340a05f..b6c1e01 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: Makefile.i386,v 1.95 1997/04/27 20:01:47 peter Exp $
+# $Id: Makefile.i386,v 1.96 1997/05/07 16:05:23 dfr Exp $
#
# Makefile for FreeBSD
#
@@ -55,30 +55,36 @@ 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= ${I386}/i386/setdef0.c ioconf.c param.c vnode_if.c config.c \
- ${I386}/i386/setdef1.c
+# ${I386}/i386/setdef0.c and ${I386}/i386/setdef1.c are intentionally
+# omitted from SYSTEM_CFILES. They depend on setdefs.h, a header which
+# is generated from all of ${OBJS}. We don't want to have to compile
+# everything just to do a make depend.
+SYSTEM_CFILES= ioconf.c param.c vnode_if.c config.c
SYSTEM_SFILES= ${I386}/i386/locore.s
-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}
.if ${CFLAGS:M-g} == ""
SYMORDER_EXCLUDE=-x symbols.exclude
.endif
SYSTEM_LD_HEAD= @echo loading $@; rm -f $@
.if ${BINFORMAT} == aout
+SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
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} == aoutkld
+SYSTEM_OBJS= locore.o vnode_if.o ${OBJS} ioconf.o param.o config.o
SYSTEM_LD= @${LD} -Bforcedynamic -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_OBJS= locore.o setdef0.o vnode_if.o ${OBJS} ioconf.o param.o config.o \
+ setdef1.o
+SYSTEM_LD= @${LD} -Bstatic -Ttext ${LOAD_ADDRESS} -e btext -defsym _DYNAMIC=0 \
+ -o $@ -X ${SYSTEM_OBJS} vers.o
SYSTEM_LD_TAIL= @size $@; chmod 755 $@
.endif
@@ -95,8 +101,8 @@ SYSTEM_LD_TAIL= @size $@; chmod 755 $@
%CLEAN
clean:
- rm -f *.o *.s eddep errs genassym kernel linterrs \
- makelinks param.c symbols.exclude symbols.sort tags \
+ rm -f *.o *.s eddep errs genassym gensetdefs kernel linterrs \
+ makelinks param.c setdefs.h symbols.exclude symbols.sort tags \
vers.c vnode_if.c vnode_if.h ${CLEAN}
#lint: /tmp param.c
@@ -116,12 +122,21 @@ symbols.sort: ${I386}/i386/symbols.raw
locore.o: ${I386}/i386/locore.s assym.s
${NORMAL_S}
-setdef0.o: ${I386}/i386/setdef0.c
+setdef0.o: ${I386}/i386/setdef0.c setdefs.h
${NORMAL_C}
-setdef1.o: ${I386}/i386/setdef1.c
+setdef1.o: ${I386}/i386/setdef1.c setdefs.h
${NORMAL_C}
+setdefs.h: gensetdefs ${OBJS}
+ ./gensetdefs ${OBJS} >setdefs.h
+
+gensetdefs: gensetdefs.o
+ ${CC} ${CFLAGS} gensetdefs.o -o $@
+
+gensetdefs.o: ${I386}/i386/gensetdefs.c
+ ${CC} -c ${CFLAGS} ${I386}/i386/gensetdefs.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.
OpenPOWER on IntegriCloud