Makefile.mvme68k revision 1.13
11.13Smycroft#	$NetBSD: Makefile.mvme68k,v 1.13 1996/08/10 06:09:16 mycroft Exp $
21.1Schuck
31.1Schuck# Makefile for NetBSD
41.1Schuck#
51.1Schuck# This makefile is constructed from a machine description:
61.1Schuck#	config machineid
71.1Schuck# Most changes should be made in the machine description
81.1Schuck#	/sys/arch/mvme68k/conf/``machineid''
91.1Schuck# after which you should do
101.6Smycroft#	config machineid
111.1Schuck# Machine generic makefile changes should be made in
121.1Schuck#	/sys/arch/mvme68k/conf/Makefile.mvme68k
131.1Schuck# after which config should be rerun for all machines of that type.
141.1Schuck#
151.1Schuck# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE
161.1Schuck#	IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
171.1Schuck#
181.1Schuck# -DTRACE	compile in kernel tracing hooks
191.1Schuck# -DQUOTA	compile in file system quotas
201.1Schuck
211.6Smycroft# DEBUG is set to -g if debugging.
221.6Smycroft# PROF is set to -pg if profiling.
231.1Schuck
241.9SmycroftCC?=	cc
251.9SmycroftLD?=	ld
261.12SmycroftMKDEP?=	mkdep
271.9SmycroftSTRIP?=	strip -d
281.9SmycroftTOUCH?=	touch -f -c
291.1Schuck
301.1Schuck# source tree is located via $S relative to the compilation directory
311.12SmycroftS!=	cd ../../../..; pwd
321.12SmycroftMVME68K=$S/arch/mvme68k
331.1Schuck
341.13SmycroftINCLUDES=	-I. -I$S/arch -I$S -nostdinc
351.6SmycroftCPPFLAGS=	${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Dmvme68k -DFPCOPROC
361.12SmycroftCWARNFLAGS=	-Werror
371.12SmycroftCFLAGS=		${DEBUG} ${CWARNFLAGS} -O2 -msoft-float
381.8SmycroftAFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
391.6SmycroftLINKFLAGS=	-n -Ttext 8000 -e start
401.1Schuck
411.1Schuck### find out what to use for libkern
421.1Schuck.include "$S/lib/libkern/Makefile.inc"
431.1Schuck.ifndef PROF
441.1SchuckLIBKERN=	${KERNLIB}
451.1Schuck.else
461.1SchuckLIBKERN=	${KERNLIB_PROF}
471.1Schuck.endif
481.1Schuck
491.1Schuck### find out what to use for libcompat
501.1Schuck.include "$S/compat/common/Makefile.inc"
511.1Schuck.ifndef PROF
521.1SchuckLIBCOMPAT=    ${COMPATLIB}
531.1Schuck.else
541.1SchuckLIBCOMPAT=    ${COMPATLIB_PROF}
551.1Schuck.endif
561.1Schuck
571.1Schuck### for the Motorola 68040 Floating Point Software Product
581.1Schuck.include "$S/arch/m68k/fpsp/Makefile.inc"
591.1Schuck
601.1Schuck# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP}
611.1Schuck# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix,
621.1Schuck# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file
631.1Schuck# is marked as config-dependent.
641.1Schuck
651.6SmycroftNORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
661.6SmycroftNORMAL_C_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
671.1Schuck
681.6SmycroftDRIVER_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
691.6SmycroftDRIVER_C_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} ${PARAM} -c $<
701.1Schuck
711.8SmycroftNORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
721.8SmycroftNORMAL_S_C=	${CC} ${AFLAGS} ${CPPFLAGS} ${PARAM} -c $<
731.1Schuck
741.13SmycroftHOSTED_C_C=	${NORMAL_C_C:S/^-pg$//:S/^-p$//:S/^-nostdinc$//}
751.13Smycroft
761.1Schuck%OBJS
771.1Schuck
781.1Schuck%CFILES
791.1Schuck
801.6Smycroft%SFILES
811.6Smycroft
821.1Schuck# load lines for config "xxx" will be emitted as:
831.1Schuck# xxx: ${SYSTEM_DEP} swapxxx.o
841.1Schuck#	${SYSTEM_LD_HEAD}
851.1Schuck#	${SYSTEM_LD} swapxxx.o
861.1Schuck#	${SYSTEM_LD_TAIL}
871.6SmycroftSYSTEM_OBJ=	locore.o ${FPSP} \
881.10Scgd		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
891.6SmycroftSYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
901.6SmycroftSYSTEM_LD_HEAD=	@rm -f $@
911.6SmycroftSYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
921.6Smycroft		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
931.6SmycroftSYSTEM_LD_TAIL=	@size $@; chmod 755 $@
941.6Smycroft
951.1SchuckDEBUG?=
961.1Schuck.if ${DEBUG} == "-g"
971.6SmycroftLINKFLAGS+=	-X
981.6SmycroftSYSTEM_LD_TAIL+=; \
991.6Smycroft		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
1001.6Smycroft		echo ${STRIP} $@; ${STRIP} $@
1011.1Schuck.else
1021.12SmycroftLINKFLAGS+=	-S
1031.1Schuck.endif
1041.1Schuck
1051.1Schuck%LOAD
1061.1Schuck
1071.6Smycroftassym.h: genassym
1081.6Smycroft	./genassym >assym.h
1091.6Smycroft
1101.6Smycroftgenassym: genassym.o
1111.6Smycroft	${CC} -o $@ genassym.o
1121.6Smycroft
1131.6Smycroftgenassym.o: ${MVME68K}/mvme68k/genassym.c
1141.13Smycroft	${HOSTED_C_C}
1151.6Smycroft
1161.6Smycroftparam.c: $S/conf/param.c
1171.6Smycroft	rm -f param.c
1181.6Smycroft	cp $S/conf/param.c .
1191.6Smycroft
1201.6Smycroftparam.o: param.c Makefile
1211.6Smycroft	${NORMAL_C_C}
1221.6Smycroft
1231.6Smycroftioconf.o: ioconf.c
1241.6Smycroft	${NORMAL_C}
1251.1Schuck
1261.6Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1271.1Schuck	sh $S/conf/newvers.sh
1281.6Smycroft	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1291.6Smycroft
1301.1Schuck
1311.1Schuckclean::
1321.10Scgd	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1331.6Smycroft	    [Ee]rrs linterrs makelinks genassym genassym.o assym.h
1341.1Schuck
1351.6Smycroftlint:
1361.6Smycroft	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} ${PARAM} -UKGDB \
1371.1Schuck	    ${MVME68K}/mvme68k/Locore.c ${CFILES} ${MVME68K}/mvme68k/swapgeneric.c \
1381.1Schuck	    ioconf.c param.c | \
1391.6Smycroft	    grep -v 'static function .* unused'
1401.1Schuck
1411.6Smycrofttags:
1421.6Smycroft	@echo "see $S/kern/Makefile for tags"
1431.1Schuck
1441.1Schucklinks:
1451.1Schuck	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1461.1Schuck	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1471.1Schuck	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1481.1Schuck	  sort -u | comm -23 - dontlink | \
1491.6Smycroft	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1501.1Schuck	sh makelinks && rm -f dontlink
1511.1Schuck
1521.6SmycroftSRCS=	${MVME68K}/mvme68k/locore.s \
1531.10Scgd	param.c ioconf.c ${CFILES} ${SFILES}
1541.11Smycroftdepend:: .depend
1551.10Scgd.depend: ${SRCS} assym.h param.c
1561.12Smycroft	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/locore.s
1571.12Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
1581.12Smycroft	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1591.12Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} ${PARAM} ${MVME68K}/mvme68k/genassym.c
1601.6Smycroft
1611.6Smycroft
1621.6Smycroft# depend on root or device configuration
1631.6Smycroftautoconf.o conf.o: Makefile
1641.6Smycroft 
1651.6Smycroft# depend on network or filesystem configuration 
1661.6Smycroftuipc_proto.o vfs_conf.o: Makefile 
1671.1Schuck
1681.6Smycroft# depend on maxusers
1691.6Smycroftgenassym.o machdep.o: Makefile
1701.1Schuck
1711.6Smycroft# depend on CPU configuration 
1721.6Smycroftlocore.o pmap.o sys_machdep.o trap.o: Makefile
1731.1Schuck
1741.1Schuck
1751.6Smycroftlocore.o: ${MVME68K}/mvme68k/locore.s assym.h
1761.6Smycroft	${NORMAL_S}
1771.1Schuck
1781.1Schuck%RULES
179