Abstract out a large chunk of the kernel build machinery so that new
build features (such as ross's DEBUGLIST) can easily be applied to all ports. This should reduce the complexity of each port's kernel Makefile considerably. Line counts: 227 arch/i386/conf/Makefile.i386.orig 98 arch/i386/conf/Makefile.i386 227 arch/alpha/conf/Makefile.alpha.orig 99 arch/alpha/conf/Makefile.alpha 219 arch/sparc/conf/Makefile.sparc.orig 102 arch/sparc/conf/Makefile.sparc 215 arch/vax/conf/Makefile.vax.orig 102 arch/vax/conf/Makefile.vax 253 conf/Makefile.kern.inc Roll i386, alpha, sparc, and vax over to the new build machinery.
This commit is contained in:
parent
122d2863d8
commit
d5de3c2fb2
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.alpha,v 1.67 2001/10/26 06:45:34 jmc Exp $
|
||||
# $NetBSD: Makefile.alpha,v 1.68 2001/11/16 00:23:03 atatat Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -11,205 +11,44 @@
|
||||
# Machine generic makefile changes should be made in
|
||||
# /sys/arch/alpha/conf/Makefile.alpha
|
||||
# after which config should be rerun for all machines of that type.
|
||||
|
||||
MACHINE_ARCH=alpha
|
||||
USETOOLS?= no
|
||||
|
||||
.include <bsd.own.mk>
|
||||
|
||||
# DEBUG is set to -g if debugging.
|
||||
# PROF is set to -pg if profiling.
|
||||
#
|
||||
# To specify debugging, add the config line: makeoptions DEBUG="-g"
|
||||
# A better way is to specify -g only for a few files.
|
||||
#
|
||||
# makeoptions DEBUGLIST="uvm* trap if_*"
|
||||
|
||||
AR?= ar
|
||||
AS?= as
|
||||
CC?= cc
|
||||
CPP?= cpp
|
||||
LD?= ld
|
||||
LORDER?=lorder
|
||||
MKDEP?= mkdep
|
||||
NM?= nm
|
||||
RANLIB?=ranlib
|
||||
SIZE?= size
|
||||
STRIP?= strip
|
||||
TSORT?= tsort -q
|
||||
MACHINE_ARCH= alpha
|
||||
USETOOLS?= no
|
||||
NEED_OWN_INSTALL_TARGET?=no
|
||||
.include <bsd.own.mk>
|
||||
|
||||
# source tree is located via $S relative to the compilation directory
|
||||
.ifndef S
|
||||
S!= cd ../../../..; pwd
|
||||
.endif
|
||||
ALPHA= $S/arch/alpha
|
||||
##
|
||||
## (1) port identification
|
||||
##
|
||||
ALPHA= $S/arch/alpha
|
||||
GENASSYM= ${ALPHA}/alpha/genassym.cf
|
||||
MD_CPPFLAGS= -Dalpha
|
||||
|
||||
HAVE_EGCS!= ${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
|
||||
INCLUDES= -I. -I$S/arch -I$S -nostdinc
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT -Dalpha
|
||||
##
|
||||
## (2) compile settings
|
||||
##
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT \
|
||||
${MD_CPPFLAGS}
|
||||
COPTS?= -O2
|
||||
CWARNFLAGS?= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wpointer-arith
|
||||
# XXX Delete -Wuninitialized for now, since the compiler doesn't
|
||||
# XXX always get it right. --thorpej
|
||||
CWARNFLAGS+= -Wno-uninitialized
|
||||
.if (${HAVE_EGCS} != "")
|
||||
CWARNFLAGS+= -Wno-main
|
||||
.endif
|
||||
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -mno-fp-regs
|
||||
AFLAGS= -traditional -D_LOCORE
|
||||
LOADADDRESS?= fffffc0000300000
|
||||
LINKFLAGS= -N -Ttext ${LOADADDRESS} -e __transfer -G 4
|
||||
STRIPFLAGS= -g -X
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBKERN= ${KERNLIB}
|
||||
.else
|
||||
LIBKERN= ${KERNLIB_PROF}
|
||||
.endif
|
||||
|
||||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBCOMPAT= ${COMPATLIB}
|
||||
.else
|
||||
LIBCOMPAT= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
|
||||
# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
|
||||
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
|
||||
|
||||
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${${<:T:R}_G} -c $<
|
||||
NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
|
||||
NORMAL_S= ${CPP} ${AFLAGS} ${CPPFLAGS} $< | sed -e 's,^\#.*,,' | ${AS} -o ${.TARGET}
|
||||
|
||||
%OBJS
|
||||
##
|
||||
## (3) libkern and compat
|
||||
##
|
||||
|
||||
%CFILES
|
||||
|
||||
%SFILES
|
||||
|
||||
#
|
||||
# Define a set of xxx_G variables that will add -g to just those
|
||||
# files that match the shell patterns given in ${DEBUGLIST}
|
||||
#
|
||||
|
||||
.for i in ${DEBUGLIST}
|
||||
.for j in ${CFILES:T:M$i.c}
|
||||
${j:R}_G= -g
|
||||
.endfor
|
||||
.endfor
|
||||
|
||||
# load lines for config "xxx" will be emitted as:
|
||||
# xxx: ${SYSTEM_DEP} swapxxx.o
|
||||
# ${SYSTEM_LD_HEAD}
|
||||
# ${SYSTEM_LD} swapxxx.o
|
||||
# ${SYSTEM_LD_TAIL}
|
||||
SYSTEM_OBJ= locore.o transfer.o \
|
||||
param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
|
||||
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
|
||||
SYSTEM_LD_HEAD= @rm -f $@
|
||||
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
|
||||
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
|
||||
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
|
||||
|
||||
DEBUG?=
|
||||
.if ${DEBUG} == "-g" || defined(DEBUGLIST)
|
||||
LINKFLAGS+= -X
|
||||
SYSTEM_LD_TAIL+=; \
|
||||
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
|
||||
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
|
||||
${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
|
||||
.else
|
||||
LINKFLAGS+= -S
|
||||
.endif
|
||||
|
||||
%LOAD
|
||||
|
||||
# Use awk to cross-build assym.h from the genassym.s file.
|
||||
assym.h: $S/kern/genassym.sh ${ALPHA}/alpha/genassym.cf
|
||||
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
|
||||
< ${ALPHA}/alpha/genassym.cf > assym.h.tmp && \
|
||||
mv -f assym.h.tmp assym.h
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
rm -f param.c
|
||||
cp $S/conf/param.c .
|
||||
|
||||
param.o: param.c Makefile
|
||||
${NORMAL_C}
|
||||
|
||||
ioconf.o: ioconf.c
|
||||
${NORMAL_C}
|
||||
|
||||
newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
|
||||
sh $S/conf/newvers.sh
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
|
||||
|
||||
|
||||
__CLEANKERNEL: .USE
|
||||
@echo "${.TARGET}ing the kernel objects"
|
||||
rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
|
||||
[Ee]rrs linterrs makelinks assym.h.tmp assym.h
|
||||
|
||||
__CLEANDEPEND: .USE
|
||||
rm -f .depend
|
||||
|
||||
clean: __CLEANKERNEL
|
||||
|
||||
cleandir distclean: __CLEANKERNEL __CLEANDEPEND
|
||||
|
||||
lint:
|
||||
@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
|
||||
${ALPHA}/alpha/Locore.c ${CFILES} \
|
||||
ioconf.c param.c | \
|
||||
grep -v 'static function .* unused'
|
||||
|
||||
tags:
|
||||
@echo "see $S/kern/Makefile for tags"
|
||||
|
||||
links:
|
||||
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
|
||||
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
|
||||
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
|
||||
sort -u | comm -23 - dontlink | \
|
||||
sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
|
||||
sh makelinks && rm -f dontlink
|
||||
|
||||
SRCS= ${ALPHA}/alpha/locore.s ${ALPHA}/alpha/transfer.s \
|
||||
param.c ioconf.c ${CFILES} ${SFILES}
|
||||
depend: .depend
|
||||
.depend: ${SRCS} assym.h param.c
|
||||
${MKDEP} -x assembler-with-cpp ${AFLAGS} ${CPPFLAGS} \
|
||||
${ALPHA}/alpha/locore.s
|
||||
${MKDEP} -a -x assembler-with-cpp ${AFLAGS} ${CPPFLAGS} \
|
||||
${ALPHA}/alpha/transfer.s
|
||||
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
|
||||
test -z "${SFILES}" || \
|
||||
${MKDEP} -a -x assembler-with-cpp ${AFLAGS} ${CPPFLAGS} ${SFILES}
|
||||
sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
|
||||
${CPPFLAGS} < ${ALPHA}/alpha/genassym.cf
|
||||
@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
|
||||
@rm -f assym.dep
|
||||
|
||||
dependall: depend all
|
||||
|
||||
|
||||
# depend on root or device configuration
|
||||
autoconf.o conf.o: Makefile
|
||||
|
||||
# depend on network or filesystem configuration
|
||||
uipc_proto.o vfs_conf.o: Makefile
|
||||
|
||||
# depend on maxusers
|
||||
assym.h machdep.o: Makefile
|
||||
|
||||
# depend on CPU configuration
|
||||
clock.o machdep.o apecs.o cia.o lca.o ioasic.o scc.o icasic.o: Makefile
|
||||
##
|
||||
## (4) local objects, compile rules, and dependencies
|
||||
##
|
||||
MD_OBJS= locore.o transfer.o
|
||||
MD_CFILES=
|
||||
MD_SFILES= ${ALPHA}/alpha/locore.s ${ALPHA}/alpha/transfer.s
|
||||
|
||||
locore.o: ${ALPHA}/alpha/locore.s assym.h
|
||||
${NORMAL_S}
|
||||
@ -217,16 +56,44 @@ locore.o: ${ALPHA}/alpha/locore.s assym.h
|
||||
transfer.o: ${ALPHA}/alpha/transfer.s
|
||||
${NORMAL_S}
|
||||
|
||||
# The install target can be redefined by putting a
|
||||
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
|
||||
MACHINE_NAME!= uname -n
|
||||
install: install-kernel-${MACHINE_NAME}
|
||||
.if !target(install-kernel-${MACHINE_NAME}})
|
||||
install-kernel-${MACHINE_NAME}:
|
||||
rm -f /onetbsd
|
||||
ln /netbsd /onetbsd
|
||||
cp netbsd /nnetbsd
|
||||
mv /nnetbsd /netbsd
|
||||
.endif
|
||||
##
|
||||
## (5) link settings
|
||||
##
|
||||
LINKFORMAT= -N
|
||||
TEXTADDR?= fffffc0000300000
|
||||
EXTRA_LINKFLAGS= -G 4
|
||||
LINKFLAGS_DEBUG= -X
|
||||
LINKFLAGS_NORMAL= -S
|
||||
STRIPFLAGS= -g -X
|
||||
|
||||
##
|
||||
## (6) port specific target dependencies
|
||||
##
|
||||
|
||||
# depend on CPU configuration
|
||||
clock.o apecs.o cia.o lca.o ioasic.o scc.o icasic.o: Makefile
|
||||
|
||||
##
|
||||
## (7) misc settings
|
||||
##
|
||||
MKDEP_AFLAGS= -x assembler-with-cpp ${AFLAGS}
|
||||
|
||||
##
|
||||
## (8) config(8) generated machinery
|
||||
##
|
||||
%INCLUDES
|
||||
|
||||
%OBJS
|
||||
|
||||
%CFILES
|
||||
|
||||
%SFILES
|
||||
|
||||
%LOAD
|
||||
|
||||
%RULES
|
||||
|
||||
##
|
||||
## (9) port independent kernel machinery
|
||||
##
|
||||
.include "$S/conf/Makefile.kern.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.i386,v 1.118 2001/10/26 06:45:37 jmc Exp $
|
||||
# $NetBSD: Makefile.i386,v 1.119 2001/11/16 00:23:03 atatat Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -11,220 +11,88 @@
|
||||
# Machine generic makefile changes should be made in
|
||||
# /sys/arch/i386/conf/Makefile.i386
|
||||
# after which config should be rerun for all machines of that type.
|
||||
#
|
||||
# To specify debugging, add the config line: makeoptions DEBUG="-g"
|
||||
# A better way is to specify -g only for a few files.
|
||||
#
|
||||
# makeoptions DEBUGLIST="uvm* trap if_*"
|
||||
|
||||
MACHINE_ARCH=i386
|
||||
MACHINE_ARCH= i386
|
||||
USETOOLS?= no
|
||||
|
||||
NEED_OWN_INSTALL_TARGET?=no
|
||||
.include <bsd.own.mk>
|
||||
|
||||
# DEBUG is set to -g if debugging.
|
||||
# PROF is set to -pg if profiling.
|
||||
##
|
||||
## (1) port identification
|
||||
##
|
||||
I386= $S/arch/i386
|
||||
GENASSYM= ${I386}/i386/genassym.cf
|
||||
MD_CPPFLAGS= -Di386
|
||||
|
||||
AR?= ar
|
||||
AS?= as
|
||||
CC?= cc
|
||||
CPP?= cpp
|
||||
LD?= ld
|
||||
LORDER?=lorder
|
||||
MKDEP?= mkdep
|
||||
NM?= nm
|
||||
RANLIB?=ranlib
|
||||
SIZE?= size
|
||||
STRIP?= strip
|
||||
TSORT?= tsort -q
|
||||
|
||||
COPTS?= -O2
|
||||
|
||||
# source tree is located via $S relative to the compilation directory
|
||||
.ifndef S
|
||||
S!= cd ../../../..; pwd
|
||||
.endif
|
||||
I386= $S/arch/i386
|
||||
|
||||
HAVE_EGCS!= ${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
|
||||
INCLUDES= -I. -I$S/arch -I$S -nostdinc
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT -Di386
|
||||
CWARNFLAGS?= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
-Wpointer-arith
|
||||
# XXX Delete -Wuninitialized for now, since the compiler doesn't
|
||||
# XXX always get it right. --thorpej
|
||||
CWARNFLAGS+= -Wno-uninitialized
|
||||
.if (${HAVE_EGCS} != "")
|
||||
CWARNFLAGS+= -Wno-main
|
||||
.endif
|
||||
##
|
||||
## (2) compile settings
|
||||
##
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT \
|
||||
${MD_CPPFLAGS}
|
||||
COPTS?= -O2
|
||||
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
|
||||
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
|
||||
TEXTADDR?= c0100000
|
||||
LINKFLAGS= -Ttext ${TEXTADDR} -e start
|
||||
##
|
||||
## (3) libkern and compat
|
||||
##
|
||||
KERN_AS= obj
|
||||
|
||||
##
|
||||
## (4) local objects, compile rules, and dependencies
|
||||
##
|
||||
MD_OBJS= locore.o
|
||||
MD_CFILES=
|
||||
MD_SFILES= ${I386}/i386/locore.s
|
||||
|
||||
locore.o: ${I386}/i386/locore.s assym.h
|
||||
${NORMAL_S}
|
||||
|
||||
##
|
||||
## (5) link settings
|
||||
##
|
||||
TEXTADDR?= c0100000
|
||||
EXTRA_LINKFLAGS=-X
|
||||
.if (${OBJECT_FMT} == "ELF")
|
||||
KERN_LDSCRIPT?= kern.ldscript
|
||||
LINKFLAGS+= -T ${I386}/conf/${KERN_LDSCRIPT}
|
||||
LINKFORMAT= -T ${I386}/conf/${KERN_LDSCRIPT}
|
||||
.else
|
||||
LINKFLAGS+= -z
|
||||
LINKFORMAT= -z
|
||||
.endif
|
||||
|
||||
STRIPFLAGS= -g
|
||||
##
|
||||
## (6) port specific target dependencies
|
||||
##
|
||||
|
||||
freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o svr4_sigcode.o: assym.h
|
||||
apmcall.o in_cksum.o pnpbioscall.o: assym.h
|
||||
|
||||
##
|
||||
## (7) misc settings
|
||||
##
|
||||
KERNLINTFLAGS= -bceghnxzF
|
||||
|
||||
##
|
||||
## (8) config(8) generated machinery
|
||||
##
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBKERN= ${KERNLIB}
|
||||
.else
|
||||
LIBKERN= ${KERNLIB_PROF}
|
||||
.endif
|
||||
|
||||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBCOMPAT= ${COMPATLIB}
|
||||
.else
|
||||
LIBCOMPAT= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
|
||||
# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
|
||||
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
|
||||
|
||||
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
|
||||
NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
|
||||
NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
|
||||
|
||||
%OBJS
|
||||
|
||||
%CFILES
|
||||
|
||||
%SFILES
|
||||
|
||||
# load lines for config "xxx" will be emitted as:
|
||||
# xxx: ${SYSTEM_DEP} swapxxx.o
|
||||
# ${SYSTEM_LD_HEAD}
|
||||
# ${SYSTEM_LD} swapxxx.o
|
||||
# ${SYSTEM_LD_TAIL}
|
||||
SYSTEM_OBJ= locore.o \
|
||||
param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
|
||||
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
|
||||
SYSTEM_LD_HEAD= rm -f $@
|
||||
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
|
||||
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
|
||||
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
|
||||
|
||||
DEBUG?=
|
||||
.if ${DEBUG} == "-g"
|
||||
LINKFLAGS+= -X
|
||||
SYSTEM_LD_TAIL+=; \
|
||||
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
|
||||
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
|
||||
${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
|
||||
.else
|
||||
LINKFLAGS+= -X
|
||||
.endif
|
||||
|
||||
%LOAD
|
||||
|
||||
assym.h: $S/kern/genassym.sh ${I386}/i386/genassym.cf
|
||||
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
|
||||
< ${I386}/i386/genassym.cf > assym.h.tmp && \
|
||||
mv -f assym.h.tmp assym.h
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
rm -f param.c
|
||||
cp $S/conf/param.c .
|
||||
|
||||
param.o: param.c Makefile
|
||||
${NORMAL_C}
|
||||
|
||||
ioconf.o: ioconf.c
|
||||
${NORMAL_C}
|
||||
|
||||
newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
|
||||
sh $S/conf/newvers.sh
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
|
||||
|
||||
|
||||
__CLEANKERNEL: .USE
|
||||
@echo "${.TARGET}ing the kernel objects"
|
||||
rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
|
||||
[Ee]rrs linterrs makelinks assym.h.tmp assym.h
|
||||
|
||||
__CLEANDEPEND: .USE
|
||||
rm -f .depend
|
||||
|
||||
clean: __CLEANKERNEL
|
||||
|
||||
cleandir distclean: __CLEANKERNEL __CLEANDEPEND
|
||||
|
||||
ALLSFILES= ${I386}/i386/locore.s ${SFILES}
|
||||
LINTSTUBS= ${ALLSFILES:T:R:C/^.*$/LintStub_&.c/g}
|
||||
|
||||
.for _sfile in ${ALLSFILES}
|
||||
LintStub_${_sfile:T:R}.c: ${_sfile} assym.h
|
||||
${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \
|
||||
awk -f $S/kern/genlintstub.awk >${.TARGET}
|
||||
.endfor
|
||||
|
||||
lint: ${CFILES} ${LINTSTUBS} ioconf.c param.c
|
||||
@lint -bceghnxzF ${CPPFLAGS} -UKGDB \
|
||||
${CFILES} ${LINTSTUBS} ioconf.c param.c
|
||||
|
||||
tags:
|
||||
@echo "see $S/kern/Makefile for tags"
|
||||
|
||||
links:
|
||||
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
|
||||
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
|
||||
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
|
||||
sort -u | comm -23 - dontlink | \
|
||||
sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
|
||||
sh makelinks && rm -f dontlink
|
||||
|
||||
SRCS= ${I386}/i386/locore.s \
|
||||
param.c ioconf.c ${CFILES} ${SFILES}
|
||||
depend: .depend
|
||||
.depend: ${SRCS} assym.h param.c
|
||||
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${I386}/i386/locore.s
|
||||
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
|
||||
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
|
||||
sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
|
||||
${CPPFLAGS} < ${I386}/i386/genassym.cf
|
||||
@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
|
||||
@rm -f assym.dep
|
||||
|
||||
dependall: depend all
|
||||
|
||||
|
||||
# depend on root or device configuration
|
||||
autoconf.o conf.o: Makefile
|
||||
|
||||
# depend on network or filesystem configuration
|
||||
uipc_proto.o vfs_conf.o: Makefile
|
||||
|
||||
# depend on maxusers
|
||||
machdep.o: Makefile
|
||||
|
||||
# depend on CPU configuration
|
||||
locore.o machdep.o: Makefile
|
||||
|
||||
locore.o: ${I386}/i386/locore.s assym.h
|
||||
${NORMAL_S}
|
||||
|
||||
apmcall.o in_cksum.o pnpbioscall.o: assym.h
|
||||
|
||||
freebsd_sigcode.o ibcs2_sigcode.o linux_sigcode.o svr4_sigcode.o: assym.h
|
||||
|
||||
# The install target can be redefined by putting a
|
||||
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
|
||||
MACHINE_NAME!= uname -n
|
||||
install: install-kernel-${MACHINE_NAME}
|
||||
.if !target(install-kernel-${MACHINE_NAME}})
|
||||
install-kernel-${MACHINE_NAME}:
|
||||
rm -f /onetbsd
|
||||
ln /netbsd /onetbsd
|
||||
cp netbsd /nnetbsd
|
||||
mv /nnetbsd /netbsd
|
||||
.endif
|
||||
|
||||
%RULES
|
||||
|
||||
##
|
||||
## (9) port independent kernel machinery
|
||||
##
|
||||
.include "$S/conf/Makefile.kern.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.sparc,v 1.75 2001/10/26 06:45:39 jmc Exp $
|
||||
# $NetBSD: Makefile.sparc,v 1.76 2001/11/16 00:23:03 atatat Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -11,86 +11,80 @@
|
||||
# Machine generic makefile changes should be made in
|
||||
# /sys/arch/sparc/conf/Makefile.sparc
|
||||
# after which config should be rerun for all machines of that type.
|
||||
#
|
||||
# To specify debugging, add the config line: makeoptions DEBUG="-g"
|
||||
# A better way is to specify -g only for a few files.
|
||||
#
|
||||
# makeoptions DEBUGLIST="uvm* trap if_*"
|
||||
|
||||
MACHINE_ARCH=sparc
|
||||
MACHINE_ARCH= sparc
|
||||
USETOOLS?= no
|
||||
|
||||
NEED_OWN_INSTALL_TARGET?=no
|
||||
.include <bsd.own.mk>
|
||||
|
||||
# DEBUG is set to -g if debugging.
|
||||
# PROF is set to -pg if profiling.
|
||||
##
|
||||
## (1) port identification
|
||||
##
|
||||
SPARC= $S/arch/sparc
|
||||
GENASSYM= ${SPARC}/sparc/genassym.cf
|
||||
MD_CPPFLAGS=
|
||||
|
||||
AR?= ar
|
||||
AS?= as
|
||||
CC?= cc
|
||||
CPP?= cpp
|
||||
LD?= ld
|
||||
LORDER?=lorder
|
||||
MKDEP?= mkdep
|
||||
NM?= nm
|
||||
RANLIB?=ranlib
|
||||
SIZE?= size
|
||||
STRIP?= strip
|
||||
TSORT?= tsort -q
|
||||
|
||||
COPTS?= -O2
|
||||
|
||||
# source tree is located via $S relative to the compilation directory
|
||||
.ifndef S
|
||||
S!= cd ../../../..; pwd
|
||||
.endif
|
||||
SPARC= $S/arch/sparc
|
||||
|
||||
HAVE_EGCS!= ${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
|
||||
INCLUDES= -I. -I$S/arch -I$S -nostdinc
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT
|
||||
CWARNFLAGS?= -Werror -Wall -Wstrict-prototypes -Wmissing-prototypes \
|
||||
-Wpointer-arith
|
||||
# XXX Delete -Wuninitialized for now, since the compiler doesn't
|
||||
# XXX always get it right. --thorpej
|
||||
CWARNFLAGS+= -Wno-uninitialized
|
||||
.if (${HAVE_EGCS} != "")
|
||||
CWARNFLAGS+= -Wno-main
|
||||
.endif
|
||||
##
|
||||
## (2) compile settings
|
||||
##
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT \
|
||||
${MD_CPPFLAGS}
|
||||
COPTS?= -O2
|
||||
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
|
||||
# work around GCC (egcs-2.91.66) bug which is liable
|
||||
# to use FPU registers as temporaries:
|
||||
CFLAGS+= -mno-fpu
|
||||
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -Ttext F0004000 -e start
|
||||
.if ${OBJECT_FMT} != "ELF"
|
||||
LINKFLAGS+= -N -p
|
||||
.else
|
||||
KERN_LDSCRIPT?= kern.ldscript
|
||||
LINKFLAGS+= -n -T ${SPARC}/conf/${KERN_LDSCRIPT}
|
||||
.endif
|
||||
STRIPFLAGS= -g
|
||||
|
||||
%INCLUDES
|
||||
|
||||
### find out what to use for libkern
|
||||
##
|
||||
## (3) libkern and compat
|
||||
##
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBKERN= ${KERNLIB}
|
||||
|
||||
##
|
||||
## (4) local objects, compile rules, and dependencies
|
||||
##
|
||||
MD_OBJS= locore.o
|
||||
MD_CFILES=
|
||||
MD_SFILES= ${SPARC}/sparc/locore.s
|
||||
|
||||
locore.o: ${SPARC}/sparc/locore.s assym.h
|
||||
${NORMAL_S}
|
||||
|
||||
##
|
||||
## (5) link settings
|
||||
##
|
||||
TEXTADDR?= F0004000
|
||||
EXTRA_LINKFLAGS= -X
|
||||
.if ${OBJECT_FMT} == "ELF"
|
||||
KERN_LDSCRIPT?= kern.ldscript
|
||||
LINKFORMAT= -n -T ${SPARC}/conf/${KERN_LDSCRIPT}
|
||||
.else
|
||||
LIBKERN= ${KERNLIB_PROF}
|
||||
LINKFORMAT= -N -p
|
||||
.endif
|
||||
|
||||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBCOMPAT= ${COMPATLIB}
|
||||
.else
|
||||
LIBCOMPAT= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
##
|
||||
## (6) port specific target dependencies
|
||||
##
|
||||
|
||||
# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
|
||||
# HOSTED, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
|
||||
# depend on CPU configuration
|
||||
bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
|
||||
ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o: Makefile
|
||||
mem.o openprom.o pmap.o vm_machdep.o: Makefile
|
||||
|
||||
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
|
||||
NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
|
||||
NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
|
||||
##
|
||||
## (7) misc settings
|
||||
##
|
||||
|
||||
##
|
||||
## (8) config(8) generated machinery
|
||||
##
|
||||
%INCLUDES
|
||||
|
||||
%OBJS
|
||||
|
||||
@ -98,125 +92,11 @@ NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
|
||||
|
||||
%SFILES
|
||||
|
||||
# load lines for config "xxx" will be emitted as:
|
||||
# xxx: ${SYSTEM_DEP} swapxxx.o
|
||||
# ${SYSTEM_LD_HEAD}
|
||||
# ${SYSTEM_LD} swapxxx.o
|
||||
# ${SYSTEM_LD_TAIL}
|
||||
SYSTEM_OBJ= locore.o \
|
||||
param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
|
||||
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
|
||||
SYSTEM_LD_HEAD= @rm -f $@
|
||||
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
|
||||
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
|
||||
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
|
||||
|
||||
DEBUG?=
|
||||
.if ${DEBUG} == "-g"
|
||||
LINKFLAGS+= -X
|
||||
SYSTEM_LD_TAIL+=; \
|
||||
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
|
||||
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
|
||||
${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
|
||||
.else
|
||||
LINKFLAGS+= -X
|
||||
.endif
|
||||
|
||||
%LOAD
|
||||
|
||||
assym.h: $S/kern/genassym.sh ${SPARC}/sparc/genassym.cf
|
||||
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
|
||||
< ${SPARC}/sparc/genassym.cf > assym.h.tmp && \
|
||||
mv -f assym.h.tmp assym.h
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
rm -f param.c
|
||||
cp $S/conf/param.c .
|
||||
|
||||
param.o: param.c Makefile
|
||||
${NORMAL_C}
|
||||
|
||||
ioconf.o: ioconf.c
|
||||
${NORMAL_C}
|
||||
|
||||
newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
|
||||
sh $S/conf/newvers.sh
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
|
||||
|
||||
__CLEANKERNEL: .USE
|
||||
@echo "${.TARGET}ing the kernel objects"
|
||||
rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
|
||||
[Ee]rrs linterrs makelinks assym.h.tmp assym.h
|
||||
|
||||
__CLEANDEPEND: .USE
|
||||
rm -f .depend
|
||||
|
||||
clean: __CLEANKERNEL
|
||||
|
||||
cleandir distclean: __CLEANKERNEL __CLEANDEPEND
|
||||
|
||||
lint:
|
||||
@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
|
||||
${SPARC}/sparc/Locore.c ${CFILES} \
|
||||
ioconf.c param.c | \
|
||||
grep -v 'static function .* unused'
|
||||
|
||||
tags:
|
||||
@echo "see $S/kern/Makefile for tags"
|
||||
|
||||
links:
|
||||
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
|
||||
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
|
||||
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
|
||||
sort -u | comm -23 - dontlink | \
|
||||
sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
|
||||
sh makelinks && rm -f dontlink
|
||||
|
||||
SRCS= ${SPARC}/sparc/locore.s \
|
||||
param.c ioconf.c ${CFILES} ${SFILES}
|
||||
depend: .depend
|
||||
.depend: ${SRCS} assym.h param.c
|
||||
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${SPARC}/sparc/locore.s
|
||||
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
|
||||
.if !empty(SFILES)
|
||||
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
|
||||
.endif
|
||||
sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
|
||||
${CPPFLAGS} < ${SPARC}/sparc/genassym.cf
|
||||
@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
|
||||
@rm -f assym.dep
|
||||
|
||||
dependall: depend all
|
||||
|
||||
|
||||
# depend on root or device configuration
|
||||
autoconf.o conf.o: Makefile
|
||||
|
||||
# depend on network or filesystem configuration
|
||||
uipc_proto.o vfs_conf.o: Makefile
|
||||
|
||||
# depend on maxusers
|
||||
machdep.o: Makefile
|
||||
|
||||
# depend on CPU configuration
|
||||
bwtwo.o cgsix.o cgthree.o cgtwo.o cons.o dma.o esp.o fb.o if_ie.o: Makefile
|
||||
ms.c obio.o zs.c autoconf.o clock.o cpu.o disksubr.o locore.o: Makefile
|
||||
machdep.o mem.o openprom.o pmap.o vm_machdep.o: Makefile
|
||||
|
||||
|
||||
locore.o: ${SPARC}/sparc/locore.s assym.h
|
||||
${NORMAL_S}
|
||||
|
||||
# The install target can be redefined by putting a
|
||||
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
|
||||
MACHINE_NAME!= uname -n
|
||||
install: install-kernel-${MACHINE_NAME}
|
||||
.if !target(install-kernel-${MACHINE_NAME}})
|
||||
install-kernel-${MACHINE_NAME}:
|
||||
rm -f /onetbsd
|
||||
ln /netbsd /onetbsd
|
||||
cp netbsd /nnetbsd
|
||||
mv /nnetbsd /netbsd
|
||||
.endif
|
||||
|
||||
%RULES
|
||||
|
||||
##
|
||||
## (9) port independent kernel machinery
|
||||
##
|
||||
.include "$S/conf/Makefile.kern.inc"
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: Makefile.vax,v 1.62 2001/10/26 06:45:41 jmc Exp $
|
||||
# $NetBSD: Makefile.vax,v 1.63 2001/11/16 00:23:04 atatat Exp $
|
||||
|
||||
# Makefile for NetBSD
|
||||
#
|
||||
@ -11,193 +11,49 @@
|
||||
# Machine generic makefile changes should be made in
|
||||
# /sys/arch/vax/conf/Makefile.vax
|
||||
# after which config should be rerun for all machines of that type.
|
||||
#
|
||||
# To specify debugging, add the config line: makeoptions DEBUG="-g"
|
||||
# A better way is to specify -g only for a few files.
|
||||
#
|
||||
# makeoptions DEBUGLIST="uvm* trap if_*"
|
||||
|
||||
MACHINE_ARCH=vax
|
||||
MACHINE_ARCH= vax
|
||||
USETOOLS?= no
|
||||
|
||||
NEED_OWN_INSTALL_TARGET?=no
|
||||
.include <bsd.own.mk>
|
||||
|
||||
# DEBUG is set to -g if debugging.
|
||||
# PROF is set to -pg if profiling.
|
||||
##
|
||||
## (1) port identification
|
||||
##
|
||||
VAX= $S/arch/vax
|
||||
GENASSYM= ${VAX}/vax/genassym.cf
|
||||
MD_CPPFLAGS= -D_VAX_INLINE_
|
||||
|
||||
AR?= ar
|
||||
AS?= as
|
||||
CC?= cc
|
||||
CPP?= cpp
|
||||
LD?= ld
|
||||
LORDER?=lorder
|
||||
MKDEP?= mkdep
|
||||
NM?= nm
|
||||
RANLIB?=ranlib
|
||||
SIZE?= size
|
||||
STRIP?= strip
|
||||
TSORT?= tsort -q
|
||||
|
||||
COPTS?= -O2
|
||||
|
||||
# source tree is located via $S relative to the compilation directory
|
||||
.ifndef S
|
||||
S!= cd ../../../..; pwd
|
||||
.endif
|
||||
VAX= $S/arch/vax
|
||||
##
|
||||
## (2) compile settings
|
||||
##
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT \
|
||||
${MD_CPPFLAGS}
|
||||
COPTS?= -O2
|
||||
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
|
||||
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
|
||||
HAVE_EGCS!= ${CC} --version | egrep "^(2\.8|2\.9[0-4]|egcs)" ; echo
|
||||
INCLUDES= -I. -I$S/arch -I$S -nostdinc
|
||||
CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT \
|
||||
-D_VAX_INLINE_
|
||||
CWARNFLAGS?= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
-Wpointer-arith -Wno-main
|
||||
# XXX Delete -Wuninitialized for now, since the compiler doesn't
|
||||
# XXX always get it right. --thorpej
|
||||
CWARNFLAGS+= -Wno-uninitialized
|
||||
CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS}
|
||||
.if (${HAVE_EGCS} != "")
|
||||
CFLAGS+= -mno-pic
|
||||
.endif
|
||||
AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE
|
||||
LINKFLAGS= -N -Ttext 80000000 -e start
|
||||
STRIPFLAGS= -g
|
||||
|
||||
%INCLUDES
|
||||
|
||||
HOSTED_CC= ${CC}
|
||||
HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//}
|
||||
HOSTED_CFLAGS= ${CFLAGS}
|
||||
|
||||
### find out what to use for libkern
|
||||
##
|
||||
## (3) libkern and compat
|
||||
##
|
||||
KERN_AS= obj
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBKERN= ${KERNLIB}
|
||||
.else
|
||||
LIBKERN= ${KERNLIB_PROF}
|
||||
.endif
|
||||
|
||||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBCOMPAT= ${COMPATLIB}
|
||||
.else
|
||||
LIBCOMPAT= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
|
||||
# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
|
||||
# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
|
||||
|
||||
NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
|
||||
NOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $<
|
||||
NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
|
||||
|
||||
HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $<
|
||||
|
||||
%OBJS
|
||||
|
||||
%CFILES
|
||||
|
||||
%SFILES
|
||||
|
||||
# load lines for config "xxx" will be emitted as:
|
||||
# xxx: ${SYSTEM_DEP} swapxxx.o
|
||||
# ${SYSTEM_LD_HEAD}
|
||||
# ${SYSTEM_LD} swapxxx.o
|
||||
# ${SYSTEM_LD_TAIL}
|
||||
SYSTEM_OBJ= intvec.o subr.o \
|
||||
param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN}
|
||||
SYSTEM_DEP= Makefile ${SYSTEM_OBJ}
|
||||
SYSTEM_LD_HEAD= @rm -f $@
|
||||
SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
|
||||
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
|
||||
SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@
|
||||
|
||||
DEBUG?=
|
||||
.if ${DEBUG} == "-g"
|
||||
LINKFLAGS+= -X
|
||||
SYSTEM_LD_TAIL+=; \
|
||||
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
|
||||
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
|
||||
${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
|
||||
.else
|
||||
LINKFLAGS+= -S
|
||||
.endif
|
||||
|
||||
%LOAD
|
||||
|
||||
assym.h: $S/kern/genassym.sh ${VAX}/vax/genassym.cf
|
||||
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
|
||||
< ${VAX}/vax/genassym.cf > assym.h.tmp && \
|
||||
mv -f assym.h.tmp assym.h
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
rm -f param.c
|
||||
cp $S/conf/param.c .
|
||||
|
||||
param.o: param.c Makefile
|
||||
${NORMAL_C}
|
||||
|
||||
ioconf.o: ioconf.c
|
||||
${NORMAL_C}
|
||||
|
||||
newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
|
||||
sh $S/conf/newvers.sh
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
|
||||
|
||||
__CLEANKERNEL: .USE
|
||||
@echo "${.TARGET}ing the kernel objects"
|
||||
rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
|
||||
[Ee]rrs linterrs makelinks assym.h.tmp assym.h
|
||||
|
||||
__CLEANDEPEND: .USE
|
||||
rm -f .depend
|
||||
|
||||
clean: __CLEANKERNEL
|
||||
|
||||
cleandir distclean: __CLEANKERNEL __CLEANDEPEND
|
||||
|
||||
lint:
|
||||
@lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \
|
||||
${VAX}/vax/Locore.c ${CFILES} \
|
||||
ioconf.c param.c | \
|
||||
grep -v 'static function .* unused'
|
||||
|
||||
tags:
|
||||
@echo "see $S/kern/Makefile for tags"
|
||||
|
||||
links:
|
||||
egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
|
||||
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
|
||||
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
|
||||
sort -u | comm -23 - dontlink | \
|
||||
sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
|
||||
sh makelinks && rm -f dontlink
|
||||
|
||||
SRCS= ${VAX}/vax/intvec.s ${VAX}/vax/subr.s \
|
||||
param.c ioconf.c ${CFILES} ${SFILES}
|
||||
depend: .depend
|
||||
.depend: ${SRCS} assym.h param.c
|
||||
${MKDEP} ${AFLAGS} ${CPPFLAGS} ${VAX}/vax/intvec.s ${VAX}/vax/subr.s
|
||||
${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
|
||||
${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
|
||||
sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
|
||||
${CPPFLAGS} < ${VAX}/vax/genassym.cf
|
||||
@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
|
||||
@rm -f assym.dep
|
||||
|
||||
dependall: depend all
|
||||
|
||||
|
||||
# depend on root or device configuration
|
||||
autoconf.o conf.o: Makefile
|
||||
|
||||
# depend on network or filesystem configuration
|
||||
uipc_proto.o vfs_conf.o: Makefile
|
||||
|
||||
# depend on maxusers
|
||||
machdep.o: Makefile
|
||||
|
||||
# depend on CPU configuration
|
||||
tmscp.o ts.o uba.o uda.o autoconf.o clock.o conf.o emulate.o intvec.o: Makefile
|
||||
machdep.o sbi.o subr.o: Makefile
|
||||
|
||||
##
|
||||
## (4) local objects, compile rules, and dependencies
|
||||
##
|
||||
MD_OBJS= intvec.o subr.o
|
||||
MD_CFILES=
|
||||
MD_SFILES= ${VAX}/vax/intvec.s ${VAX}/vax/subr.s
|
||||
|
||||
intvec.o: ${VAX}/vax/intvec.s assym.h
|
||||
${NORMAL_S}
|
||||
@ -205,16 +61,42 @@ intvec.o: ${VAX}/vax/intvec.s assym.h
|
||||
subr.o: ${VAX}/vax/subr.s assym.h
|
||||
${NORMAL_S}
|
||||
|
||||
# The install target can be redefined by putting a
|
||||
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
|
||||
MACHINE_NAME!= uname -n
|
||||
install: install-kernel-${MACHINE_NAME}
|
||||
.if !target(install-kernel-${MACHINE_NAME}})
|
||||
install-kernel-${MACHINE_NAME}:
|
||||
rm -f /onetbsd
|
||||
ln /netbsd /onetbsd
|
||||
cp netbsd /nnetbsd
|
||||
mv /nnetbsd /netbsd
|
||||
.endif
|
||||
##
|
||||
## (5) link settings
|
||||
##
|
||||
TEXTADDR?= 80000000
|
||||
LINKFORMAT= -N
|
||||
LINKFLAGS_DEBUG= -X
|
||||
LINKFLAGS_NORMAL= -S
|
||||
|
||||
##
|
||||
## (6) port specific target dependencies
|
||||
##
|
||||
|
||||
# depend on CPU configuration
|
||||
tmscp.o ts.o uba.o uda.o clock.o emulate.o intvec.o: Makefile
|
||||
sbi.o subr.o: Makefile
|
||||
|
||||
##
|
||||
## (7) misc settings
|
||||
##
|
||||
|
||||
##
|
||||
## (8) config(8) generated machinery
|
||||
##
|
||||
%INCLUDES
|
||||
|
||||
%OBJS
|
||||
|
||||
%CFILES
|
||||
|
||||
%SFILES
|
||||
|
||||
%LOAD
|
||||
|
||||
%RULES
|
||||
|
||||
##
|
||||
## (9) port independent kernel machinery
|
||||
##
|
||||
.include "$S/conf/Makefile.kern.inc"
|
||||
|
255
sys/conf/Makefile.kern.inc
Normal file
255
sys/conf/Makefile.kern.inc
Normal file
@ -0,0 +1,255 @@
|
||||
# $NetBSD: Makefile.kern.inc,v 1.1 2001/11/16 00:23:02 atatat Exp $
|
||||
#
|
||||
# This file contains common `MI' targets and definitions and it is included
|
||||
# at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}. There are
|
||||
# many `MI' definitions that should end up in here, but they are not yet.
|
||||
#
|
||||
# Each target in this file should be protected with `if !target(target)'
|
||||
# or `if !commands(target)' and each variable should only be conditionally
|
||||
# assigned `VAR ?= VALUE', so that everything can be overriden.
|
||||
#
|
||||
# DEBUG is set to -g if debugging.
|
||||
# PROF is set to -pg if profiling.
|
||||
#
|
||||
# To specify debugging, add the config line: makeoptions DEBUG="-g"
|
||||
# A better way is to specify -g only for a few files.
|
||||
#
|
||||
# makeoptions DEBUGLIST="uvm* trap if_*"
|
||||
#
|
||||
# all ports are expected to include bsd.own.mk for toolchain settings
|
||||
|
||||
##
|
||||
## (1) port independent source tree identification
|
||||
##
|
||||
# source tree is located via $S relative to the compilation directory
|
||||
.ifndef S
|
||||
S!= cd ../../../..; pwd
|
||||
.endif
|
||||
|
||||
##
|
||||
## (2) compile settings
|
||||
##
|
||||
## CPPFLAGS, CFLAGS, and AFLAGS must be set in the port's Makefile
|
||||
##
|
||||
INCLUDES?= -I. ${MD_INCLUDES} -I$S/arch -I$S -nostdinc
|
||||
CWARNFLAGS?= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes \
|
||||
-Wpointer-arith
|
||||
# XXX Delete -Wuninitialized for now, since the compiler doesn't
|
||||
# XXX always get it right. --thorpej
|
||||
CWARNFLAGS+= -Wno-uninitialized
|
||||
|
||||
.if !defined(HAVE_EGCS)
|
||||
HAVE_EGCS!= ${CC} --version | egrep "^(2\.[89]|egcs)" ; echo
|
||||
.endif
|
||||
.if (${HAVE_EGCS} != "")
|
||||
CWARNFLAGS+= -Wno-main
|
||||
.endif
|
||||
|
||||
# Define a set of xxx_G variables that will add -g to just those
|
||||
# files that match the shell patterns given in ${DEBUGLIST}
|
||||
#
|
||||
.for i in ${DEBUGLIST}
|
||||
.for j in ${CFILES:T:M$i.c}
|
||||
${j:R}_G?= -g
|
||||
.endfor
|
||||
.endfor
|
||||
|
||||
# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
|
||||
# NOPROF and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
|
||||
NORMAL_C?= ${CC} ${CFLAGS} ${CPPFLAGS} ${${<:T:R}_G} ${PROF} -c $<
|
||||
NOPROF_C?= ${CC} ${CFLAGS} ${CPPFLAGS} ${${<:T:R}_G} -c $<
|
||||
NORMAL_S?= ${CC} ${AFLAGS} ${CPPFLAGS} -c $<
|
||||
|
||||
##
|
||||
## (3) libkern and compat
|
||||
##
|
||||
## Set KERN_AS in the port Makefile to "obj" or "library". The
|
||||
## default is "library", as documented in $S/lib/libkern/Makefile.inc.
|
||||
##
|
||||
|
||||
### find out what to use for libkern
|
||||
.include "$S/lib/libkern/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBKERN?= ${KERNLIB}
|
||||
.else
|
||||
LIBKERN?= ${KERNLIB_PROF}
|
||||
.endif
|
||||
|
||||
### find out what to use for libcompat
|
||||
.include "$S/compat/common/Makefile.inc"
|
||||
.ifndef PROF
|
||||
LIBCOMPAT?= ${COMPATLIB}
|
||||
.else
|
||||
LIBCOMPAT?= ${COMPATLIB_PROF}
|
||||
.endif
|
||||
|
||||
##
|
||||
## (4) local objects, compile rules, and dependencies
|
||||
##
|
||||
## Each port should have a corresponding section with settings for
|
||||
## MD_CFILES, MD_SFILES, and MD_OBJS, along with build rules for same.
|
||||
##
|
||||
MI_CFILES=ioconf.c param.c
|
||||
# the need for a MI_SFILES variable is dubitable at best
|
||||
MI_OBJS=${MI_CFILES:S/.c/.o/}
|
||||
|
||||
param.c: $S/conf/param.c
|
||||
rm -f param.c
|
||||
cp $S/conf/param.c .
|
||||
|
||||
param.o: Makefile
|
||||
|
||||
.for _cfile in ${MI_CFILES}
|
||||
${_cfile:T:R}.o: ${_cfile}
|
||||
${NORMAL_C}
|
||||
.endfor
|
||||
|
||||
##
|
||||
## (5) link settings
|
||||
##
|
||||
## TEXTADDR (or LOADADDRESS), LINKFORMAT, and any EXTRA_LINKFLAGS must
|
||||
## be set in the port's Makefile. The port specific definitions for
|
||||
## LINKFLAGS_NORMAL and LINKFLAGS_DEBUG will added to the LINKFLAGS
|
||||
## depending on the value of DEBUG.
|
||||
##
|
||||
# load lines for config "xxx" will be emitted as:
|
||||
# xxx: ${SYSTEM_DEP} swapxxx.o
|
||||
# ${SYSTEM_LD_HEAD}
|
||||
# ${SYSTEM_LD} swapxxx.o
|
||||
# ${SYSTEM_LD_TAIL}
|
||||
SYSTEM_OBJ?= ${MD_OBJS} ${MI_OBJS} ${OBJS} ${LIBCOMPAT} ${LIBKERN}
|
||||
SYSTEM_DEP?= Makefile ${SYSTEM_OBJ}
|
||||
SYSTEM_LD_HEAD?= @rm -f $@
|
||||
SYSTEM_LD?= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
|
||||
${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
|
||||
SYSTEM_LD_TAIL?= @${SIZE} $@; chmod 755 $@
|
||||
|
||||
TEXTADDR?= ${LOADADDRESS} # backwards compatibility
|
||||
LINKTEXT?= -Ttext ${TEXTADDR}
|
||||
LINKDATA?= ${DATAADDR:D-Tdata ${DATAADDR}}
|
||||
ENTRYPOINT?= start
|
||||
LINKENTRY?= -e ${ENTRYPOINT}
|
||||
LINKFLAGS?= ${LINKFORMAT} ${LINKTEXT} ${LINKDATA} ${LINKENTRY} \
|
||||
${EXTRA_LINKFLAGS}
|
||||
|
||||
LINKFLAGS_DEBUG?=
|
||||
SYSTEM_LD_TAIL_DEBUG?=; \
|
||||
echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \
|
||||
echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \
|
||||
${STRIP} ${STRIPFLAGS} -o $@ $@.gdb
|
||||
LINKFLAGS_NORMAL?=
|
||||
STRIPFLAGS?= -g
|
||||
|
||||
DEBUG?=
|
||||
.if ${DEBUG} == "-g"
|
||||
SYSTEM_LD_TAIL+=${SYSTEM_LD_TAIL_DEBUG}
|
||||
LINKFLAGS+= ${LINKFLAGS_DEBUG}
|
||||
.else
|
||||
LINKFLAGS+= ${LINKFLAGS_NORMAL}
|
||||
.endif
|
||||
|
||||
##
|
||||
## (6) port independent targets and dependencies: assym.h, newvers
|
||||
##
|
||||
.if !target(assym.h)
|
||||
assym.h: $S/kern/genassym.sh ${GENASSYM}
|
||||
sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \
|
||||
< ${GENASSYM} > assym.h.tmp && \
|
||||
mv -f assym.h.tmp assym.h
|
||||
.endif
|
||||
|
||||
.if !target(newvers)
|
||||
newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
|
||||
sh $S/conf/newvers.sh
|
||||
${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
|
||||
.endif
|
||||
|
||||
# depend on root or device configuration
|
||||
autoconf.o conf.o: Makefile
|
||||
|
||||
# depend on network or filesystem configuration
|
||||
uipc_proto.o vfs_conf.o: Makefile
|
||||
|
||||
# depend on maxusers and CPU configuration
|
||||
assym.h machdep.o: Makefile
|
||||
|
||||
##
|
||||
## (7) misc targets: install, clean(dir), depend(all), lint, links, tags
|
||||
##
|
||||
## Any ports that have other stuff to be cleaned up should fill in
|
||||
## EXTRA_CLEAN. Some ports may want different settings for
|
||||
## KERNLINTFLAGS, MKDEP_CFLAGS, or MKDEP_AFLAGS.
|
||||
##
|
||||
.if !target(__CLEANKERNEL)
|
||||
__CLEANKERNEL: .USE
|
||||
@echo "${.TARGET}ing the kernel objects"
|
||||
rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
|
||||
[Ee]rrs linterrs makelinks assym.h.tmp assym.h \
|
||||
${EXTRA_CLEAN}
|
||||
.endif
|
||||
|
||||
.if !target(__CLEANDEPEND)
|
||||
__CLEANDEPEND: .USE
|
||||
rm -f .depend
|
||||
.endif
|
||||
|
||||
# do not !target these, the kern and compat Makefiles augment them
|
||||
cleandir distclean: __CLEANKERNEL __CLEANDEPEND
|
||||
clean: __CLEANKERNEL
|
||||
depend: .depend
|
||||
|
||||
.if !target(.depend)
|
||||
SRCS?= ${MD_SFILES} ${MD_CFILES} ${MI_CFILES} ${CFILES} ${SFILES}
|
||||
MKDEP_AFLAGS?= ${AFLAGS}
|
||||
MKDEP_CFLAGS?= ${CFLAGS}
|
||||
.depend: ${SRCS} assym.h
|
||||
${MKDEP} ${MKDEP_AFLAGS} ${CPPFLAGS} ${MD_SFILES} ${SFILES}
|
||||
${MKDEP} -a ${MKDEP_CFLAGS} ${CPPFLAGS} ${MD_CFILES} ${MI_CFILES} \
|
||||
${CFILES}
|
||||
sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \
|
||||
${CPPFLAGS} < ${GENASSYM}
|
||||
@sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend
|
||||
@rm -f assym.dep
|
||||
.endif
|
||||
|
||||
.if !target(dependall)
|
||||
dependall: depend all
|
||||
.endif
|
||||
|
||||
.if !target(lint)
|
||||
ALLSFILES?= ${MD_SFILES} ${SFILES}
|
||||
LINTSTUBS?= ${ALLSFILES:T:R:C/^.*$/LintStub_&.c/g}
|
||||
KERNLINTFLAGS?= -hbxncez -Dvolatile=
|
||||
.for _sfile in ${ALLSFILES}
|
||||
LintStub_${_sfile:T:R}.c: ${_sfile} assym.h
|
||||
${CC} -E -C ${AFLAGS} ${CPPFLAGS} ${_sfile} | \
|
||||
awk -f $S/kern/genlintstub.awk >${.TARGET}
|
||||
.endfor
|
||||
lint: ${CFILES} ${KERNLINTSTUBS} ${MI_CFILES} ${MD_CFILES}
|
||||
@${LINT} ${KERNLINTFLAGS} ${CPPFLAGS} -UKGDB \
|
||||
${CFILES} ${LINTSTUBS} ${MI_CFILES} ${MD_CFILES} | \
|
||||
grep -v 'static function .* unused'
|
||||
.endif
|
||||
|
||||
.if !target(install)
|
||||
# The install target can be redefined by putting a
|
||||
# install-kernel-${MACHINE_NAME} target into /etc/mk.conf
|
||||
MACHINE_NAME!= uname -n
|
||||
install: install-kernel-${MACHINE_NAME}
|
||||
.if !target(install-kernel-${MACHINE_NAME}})
|
||||
install-kernel-${MACHINE_NAME}:
|
||||
rm -f /onetbsd
|
||||
ln /netbsd /onetbsd
|
||||
cp netbsd /nnetbsd
|
||||
mv /nnetbsd /netbsd
|
||||
.endif
|
||||
.endif
|
||||
|
||||
.if !target(tags)
|
||||
tags:
|
||||
@echo "see $S/kern/Makefile for tags"
|
||||
.endif
|
||||
|
||||
##
|
||||
## the end
|
||||
##
|
Loading…
Reference in New Issue
Block a user