Makefile.vax revision 1.24
11.24Smycroft#	$NetBSD: Makefile.vax,v 1.24 1996/08/10 06:10:18 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.1Sragge# -DUUDMA	compile in unibus tu58 pseudo-dma code
211.16Smycroft
221.16Smycroft# DEBUG is set to -g if debugging.
231.16Smycroft# PROF is set to -pg if profiling.
241.16Smycroft
251.19SmycroftCC?=	cc
261.19SmycroftLD?=	ld
271.23SmycroftMKDEP?=	mkdep
281.19SmycroftSTRIP?=	strip -d
291.19SmycroftTOUCH?=	touch -f -c
301.1Sragge
311.16Smycroft# source tree is located via $S relative to the compilation directory
321.23SmycroftS!=	cd ../../../..; pwd
331.23SmycroftVAX=	$S/arch/vax
341.1Sragge
351.24SmycroftINCLUDES=	-I. -I$S/arch -I$S -nostdinc
361.16SmycroftCPPFLAGS=	${INCLUDES} ${IDENT} -D_KERNEL -D_VAX_INLINE_
371.23SmycroftCWARNFLAGS=	-Werror
381.23SmycroftCFLAGS=		${DEBUG} ${CWARNFLAGS} -O2 
391.18SmycroftAFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
401.16SmycroftLINKFLAGS=	-Z -Ttext 80000000 -e _start
411.1Sragge
421.1Sragge### find out what to use for libkern
431.1Sragge.include "$S/lib/libkern/Makefile.inc"
441.1Sragge.ifndef PROF
451.9SchristosLIBKERN=	${KERNLIB}
461.1Sragge.else
471.1SraggeLIBKERN=        ${KERNLIB_PROF}
481.1Sragge.endif
491.1Sragge
501.11Sragge### find out what to use for libcompat
511.11Sragge.include "$S/compat/common/Makefile.inc"
521.11Sragge.ifndef PROF
531.11SraggeLIBCOMPAT=      ${COMPATLIB}
541.11Sragge.else
551.11SraggeLIBCOMPAT=      ${COMPATLIB_PROF}
561.11Sragge.endif
571.11Sragge
581.16Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
591.16Smycroft# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
601.16Smycroft# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
611.16Smycroft# is marked as config-dependent.
621.16Smycroft
631.16SmycroftNORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
641.16SmycroftNORMAL_C_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
651.16Smycroft
661.16SmycroftDRIVER_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
671.16SmycroftDRIVER_C_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
681.1Sragge
691.18SmycroftNORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
701.18SmycroftNORMAL_S_C=	${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
711.24Smycroft
721.24SmycroftHOSTED_C_C=	${NORMAL_C_C:S/^-pg$//:S/^-p$//:S/^-nostdinc$//}
731.1Sragge
741.1Sragge%OBJS
751.1Sragge
761.1Sragge%CFILES
771.1Sragge
781.16Smycroft%SFILES
791.16Smycroft
801.16Smycroft# load lines for config "xxx" will be emitted as:
811.16Smycroft# xxx: ${SYSTEM_DEP} swapxxx.o
821.16Smycroft#	${SYSTEM_LD_HEAD}
831.16Smycroft#	${SYSTEM_LD} swapxxx.o
841.16Smycroft#	${SYSTEM_LD_TAIL}
851.22SraggeSYSTEM_OBJ=	intvec.o subr.o \
861.20Scgd		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
871.16SmycroftSYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
881.16SmycroftSYSTEM_LD_HEAD=	@rm -f $@
891.16SmycroftSYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
901.16Smycroft		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
911.16SmycroftSYSTEM_LD_TAIL=	@size $@; chmod 755 $@
921.16Smycroft
931.16SmycroftDEBUG?=
941.16Smycroft.if ${DEBUG} == "-g"
951.16SmycroftLINKFLAGS+=	-X
961.16SmycroftSYSTEM_LD_TAIL+=; \
971.16Smycroft		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
981.16Smycroft		echo ${STRIP} $@; ${STRIP} $@
991.16Smycroft.else
1001.23SmycroftLINKFLAGS+=	-S
1011.16Smycroft.endif
1021.16Smycroft
1031.1Sragge%LOAD
1041.1Sragge
1051.16Smycroftparam.c: $S/conf/param.c
1061.16Smycroft	rm -f param.c
1071.16Smycroft	cp $S/conf/param.c .
1081.1Sragge
1091.16Smycroftparam.o: param.c Makefile
1101.16Smycroft	${NORMAL_C_C}
1111.1Sragge
1121.16Smycroftioconf.o: ioconf.c
1131.16Smycroft	${NORMAL_C}
1141.1Sragge
1151.16Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1161.16Smycroft	sh $S/conf/newvers.sh
1171.16Smycroft	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1181.1Sragge
1191.1Sragge
1201.16Smycroftclean::
1211.20Scgd	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1221.16Smycroft	    [Ee]rrs linterrs makelinks
1231.1Sragge
1241.16Smycroftlint:
1251.16Smycroft	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
1261.16Smycroft	    ${VAX}/vax/Locore.c ${CFILES} ${VAX}/vax/swapgeneric.c \
1271.16Smycroft	    ioconf.c param.c | \
1281.16Smycroft	    grep -v 'static function .* unused'
1291.16Smycroft
1301.16Smycrofttags:
1311.16Smycroft	@echo "see $S/kern/Makefile for tags"
1321.16Smycroft
1331.16Smycroftlinks:
1341.16Smycroft	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1351.16Smycroft	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1361.16Smycroft	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1371.16Smycroft	  sort -u | comm -23 - dontlink | \
1381.16Smycroft	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1391.16Smycroft	sh makelinks && rm -f dontlink
1401.16Smycroft
1411.22SraggeSRCS=	${VAX}/vax/intvec.s ${VAX}/vax/subr.s \
1421.20Scgd	param.c ioconf.c ${CFILES} ${SFILES}
1431.21Smycroftdepend:: .depend
1441.20Scgd.depend: ${SRCS} param.c
1451.23Smycroft	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${VAX}/vax/intvec.s ${VAX}/vax/subr.s
1461.23Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
1471.23Smycroft	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1481.16Smycroft
1491.16Smycroft
1501.16Smycroft# depend on root or device configuration
1511.16Smycroftautoconf.o conf.o: Makefile
1521.16Smycroft 
1531.16Smycroft# depend on network or filesystem configuration 
1541.16Smycroftuipc_proto.o vfs_conf.o: Makefile 
1551.16Smycroft
1561.16Smycroft# depend on maxusers
1571.16Smycroftmachdep.o: Makefile
1581.16Smycroft
1591.16Smycroft# depend on CPU configuration 
1601.16Smycrofttmscp.o ts.o uba.o uda.o autoconf.o clock.o conf.o emulate.o intvec.o: Makefile
1611.16Smycroftmachdep.o sbi.o subr.o uvaxII.o: Makefile
1621.5Sragge
1631.1Sragge
1641.16Smycroftintvec.o: ${VAX}/vax/intvec.s
1651.16Smycroft	${NORMAL_S}
1661.1Sragge
1671.16Smycroftsubr.o: ${VAX}/vax/subr.s
1681.16Smycroft	${NORMAL_S}
1691.1Sragge
1701.1Sragge%RULES
171