Makefile.vax revision 1.26
11.26Smycroft#	$NetBSD: Makefile.vax,v 1.26 1996/08/31 21:41:56 mycroft Exp $
21.4Scgd
31.16Smycroft# Makefile for NetBSD
41.1Sragge#
51.1Sragge# This makefile is constructed from a machine description:
61.1Sragge#	config machineid
71.1Sragge# Most changes should be made in the machine description
81.16Smycroft#	/sys/arch/vax/conf/``machineid''
91.1Sragge# after which you should do
101.16Smycroft#	config machineid
111.1Sragge# Machine generic makefile changes should be made in
121.16Smycroft#	/sys/arch/vax/conf/Makefile.vax
131.1Sragge# after which config should be rerun for all machines of that type.
141.1Sragge#
151.1Sragge# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
161.1Sragge#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
171.1Sragge#
181.1Sragge# -DTRACE	compile in kernel tracing hooks
191.1Sragge# -DQUOTA	compile in file system quotas
201.16Smycroft
211.16Smycroft# DEBUG is set to -g if debugging.
221.16Smycroft# PROF is set to -pg if profiling.
231.16Smycroft
241.19SmycroftCC?=	cc
251.19SmycroftLD?=	ld
261.23SmycroftMKDEP?=	mkdep
271.19SmycroftSTRIP?=	strip -d
281.19SmycroftTOUCH?=	touch -f -c
291.1Sragge
301.16Smycroft# source tree is located via $S relative to the compilation directory
311.26Smycroft.ifndef S
321.23SmycroftS!=	cd ../../../..; pwd
331.26Smycroft.endif
341.23SmycroftVAX=	$S/arch/vax
351.1Sragge
361.24SmycroftINCLUDES=	-I. -I$S/arch -I$S -nostdinc
371.25SmycroftCPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
381.25Smycroft		-D_VAX_INLINE_
391.23SmycroftCWARNFLAGS=	-Werror
401.23SmycroftCFLAGS=		${DEBUG} ${CWARNFLAGS} -O2 
411.18SmycroftAFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
421.16SmycroftLINKFLAGS=	-Z -Ttext 80000000 -e _start
431.1Sragge
441.1Sragge### find out what to use for libkern
451.1Sragge.include "$S/lib/libkern/Makefile.inc"
461.1Sragge.ifndef PROF
471.9SchristosLIBKERN=	${KERNLIB}
481.1Sragge.else
491.1SraggeLIBKERN=        ${KERNLIB_PROF}
501.1Sragge.endif
511.1Sragge
521.11Sragge### find out what to use for libcompat
531.11Sragge.include "$S/compat/common/Makefile.inc"
541.11Sragge.ifndef PROF
551.11SraggeLIBCOMPAT=      ${COMPATLIB}
561.11Sragge.else
571.11SraggeLIBCOMPAT=      ${COMPATLIB_PROF}
581.11Sragge.endif
591.11Sragge
601.25Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
611.25Smycroft# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
621.16Smycroft
631.16SmycroftNORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
641.18SmycroftNORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
651.24Smycroft
661.25SmycroftHOSTED_C=	${NORMAL_C:S/^-pg$//:S/^-p$//:S/^-nostdinc$//}
671.1Sragge
681.1Sragge%OBJS
691.1Sragge
701.1Sragge%CFILES
711.1Sragge
721.16Smycroft%SFILES
731.16Smycroft
741.16Smycroft# load lines for config "xxx" will be emitted as:
751.16Smycroft# xxx: ${SYSTEM_DEP} swapxxx.o
761.16Smycroft#	${SYSTEM_LD_HEAD}
771.16Smycroft#	${SYSTEM_LD} swapxxx.o
781.16Smycroft#	${SYSTEM_LD_TAIL}
791.22SraggeSYSTEM_OBJ=	intvec.o subr.o \
801.20Scgd		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
811.16SmycroftSYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
821.16SmycroftSYSTEM_LD_HEAD=	@rm -f $@
831.16SmycroftSYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
841.16Smycroft		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
851.16SmycroftSYSTEM_LD_TAIL=	@size $@; chmod 755 $@
861.16Smycroft
871.16SmycroftDEBUG?=
881.16Smycroft.if ${DEBUG} == "-g"
891.16SmycroftLINKFLAGS+=	-X
901.16SmycroftSYSTEM_LD_TAIL+=; \
911.16Smycroft		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
921.16Smycroft		echo ${STRIP} $@; ${STRIP} $@
931.16Smycroft.else
941.23SmycroftLINKFLAGS+=	-S
951.16Smycroft.endif
961.16Smycroft
971.1Sragge%LOAD
981.1Sragge
991.16Smycroftparam.c: $S/conf/param.c
1001.16Smycroft	rm -f param.c
1011.16Smycroft	cp $S/conf/param.c .
1021.1Sragge
1031.16Smycroftparam.o: param.c Makefile
1041.25Smycroft	${NORMAL_C}
1051.1Sragge
1061.16Smycroftioconf.o: ioconf.c
1071.16Smycroft	${NORMAL_C}
1081.1Sragge
1091.16Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1101.16Smycroft	sh $S/conf/newvers.sh
1111.16Smycroft	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1121.1Sragge
1131.1Sragge
1141.16Smycroftclean::
1151.20Scgd	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1161.16Smycroft	    [Ee]rrs linterrs makelinks
1171.1Sragge
1181.16Smycroftlint:
1191.25Smycroft	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB \
1201.16Smycroft	    ${VAX}/vax/Locore.c ${CFILES} ${VAX}/vax/swapgeneric.c \
1211.16Smycroft	    ioconf.c param.c | \
1221.16Smycroft	    grep -v 'static function .* unused'
1231.16Smycroft
1241.16Smycrofttags:
1251.16Smycroft	@echo "see $S/kern/Makefile for tags"
1261.16Smycroft
1271.16Smycroftlinks:
1281.16Smycroft	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1291.16Smycroft	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1301.16Smycroft	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1311.16Smycroft	  sort -u | comm -23 - dontlink | \
1321.16Smycroft	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1331.16Smycroft	sh makelinks && rm -f dontlink
1341.16Smycroft
1351.22SraggeSRCS=	${VAX}/vax/intvec.s ${VAX}/vax/subr.s \
1361.20Scgd	param.c ioconf.c ${CFILES} ${SFILES}
1371.21Smycroftdepend:: .depend
1381.20Scgd.depend: ${SRCS} param.c
1391.23Smycroft	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${VAX}/vax/intvec.s ${VAX}/vax/subr.s
1401.23Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
1411.23Smycroft	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1421.16Smycroft
1431.16Smycroft
1441.16Smycroft# depend on root or device configuration
1451.16Smycroftautoconf.o conf.o: Makefile
1461.16Smycroft 
1471.16Smycroft# depend on network or filesystem configuration 
1481.16Smycroftuipc_proto.o vfs_conf.o: Makefile 
1491.16Smycroft
1501.16Smycroft# depend on maxusers
1511.16Smycroftmachdep.o: Makefile
1521.16Smycroft
1531.16Smycroft# depend on CPU configuration 
1541.16Smycrofttmscp.o ts.o uba.o uda.o autoconf.o clock.o conf.o emulate.o intvec.o: Makefile
1551.16Smycroftmachdep.o sbi.o subr.o uvaxII.o: Makefile
1561.5Sragge
1571.1Sragge
1581.16Smycroftintvec.o: ${VAX}/vax/intvec.s
1591.16Smycroft	${NORMAL_S}
1601.1Sragge
1611.16Smycroftsubr.o: ${VAX}/vax/subr.s
1621.16Smycroft	${NORMAL_S}
1631.1Sragge
1641.1Sragge%RULES
165