Makefile.mvme68k revision 1.14
11.14Smycroft#	$NetBSD: Makefile.mvme68k,v 1.14 1996/08/12 00:51:48 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.14SmycroftCPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
361.14Smycroft		-Dmc68020 -Dmvme68k -DFPCOPROC
371.12SmycroftCWARNFLAGS=	-Werror
381.12SmycroftCFLAGS=		${DEBUG} ${CWARNFLAGS} -O2 -msoft-float
391.8SmycroftAFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
401.6SmycroftLINKFLAGS=	-n -Ttext 8000 -e start
411.1Schuck
421.1Schuck### find out what to use for libkern
431.1Schuck.include "$S/lib/libkern/Makefile.inc"
441.1Schuck.ifndef PROF
451.1SchuckLIBKERN=	${KERNLIB}
461.1Schuck.else
471.1SchuckLIBKERN=	${KERNLIB_PROF}
481.1Schuck.endif
491.1Schuck
501.1Schuck### find out what to use for libcompat
511.1Schuck.include "$S/compat/common/Makefile.inc"
521.1Schuck.ifndef PROF
531.1SchuckLIBCOMPAT=    ${COMPATLIB}
541.1Schuck.else
551.1SchuckLIBCOMPAT=    ${COMPATLIB_PROF}
561.1Schuck.endif
571.1Schuck
581.1Schuck### for the Motorola 68040 Floating Point Software Product
591.1Schuck.include "$S/arch/m68k/fpsp/Makefile.inc"
601.1Schuck
611.14Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
621.14Smycroft# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
631.1Schuck
641.6SmycroftNORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
651.8SmycroftNORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
661.1Schuck
671.14SmycroftHOSTED_C=	${NORMAL_C:S/^-pg$//:S/^-p$//:S/^-nostdinc$//}
681.13Smycroft
691.1Schuck%OBJS
701.1Schuck
711.1Schuck%CFILES
721.1Schuck
731.6Smycroft%SFILES
741.6Smycroft
751.1Schuck# load lines for config "xxx" will be emitted as:
761.1Schuck# xxx: ${SYSTEM_DEP} swapxxx.o
771.1Schuck#	${SYSTEM_LD_HEAD}
781.1Schuck#	${SYSTEM_LD} swapxxx.o
791.1Schuck#	${SYSTEM_LD_TAIL}
801.6SmycroftSYSTEM_OBJ=	locore.o ${FPSP} \
811.10Scgd		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
821.6SmycroftSYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
831.6SmycroftSYSTEM_LD_HEAD=	@rm -f $@
841.6SmycroftSYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
851.6Smycroft		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
861.6SmycroftSYSTEM_LD_TAIL=	@size $@; chmod 755 $@
871.6Smycroft
881.1SchuckDEBUG?=
891.1Schuck.if ${DEBUG} == "-g"
901.6SmycroftLINKFLAGS+=	-X
911.6SmycroftSYSTEM_LD_TAIL+=; \
921.6Smycroft		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
931.6Smycroft		echo ${STRIP} $@; ${STRIP} $@
941.1Schuck.else
951.12SmycroftLINKFLAGS+=	-S
961.1Schuck.endif
971.1Schuck
981.1Schuck%LOAD
991.1Schuck
1001.6Smycroftassym.h: genassym
1011.6Smycroft	./genassym >assym.h
1021.6Smycroft
1031.6Smycroftgenassym: genassym.o
1041.6Smycroft	${CC} -o $@ genassym.o
1051.6Smycroft
1061.6Smycroftgenassym.o: ${MVME68K}/mvme68k/genassym.c
1071.14Smycroft	${HOSTED_C}
1081.6Smycroft
1091.6Smycroftparam.c: $S/conf/param.c
1101.6Smycroft	rm -f param.c
1111.6Smycroft	cp $S/conf/param.c .
1121.6Smycroft
1131.6Smycroftparam.o: param.c Makefile
1141.14Smycroft	${NORMAL_C}
1151.6Smycroft
1161.6Smycroftioconf.o: ioconf.c
1171.6Smycroft	${NORMAL_C}
1181.1Schuck
1191.6Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1201.1Schuck	sh $S/conf/newvers.sh
1211.6Smycroft	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1221.6Smycroft
1231.1Schuck
1241.1Schuckclean::
1251.10Scgd	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1261.6Smycroft	    [Ee]rrs linterrs makelinks genassym genassym.o assym.h
1271.1Schuck
1281.6Smycroftlint:
1291.14Smycroft	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB \
1301.1Schuck	    ${MVME68K}/mvme68k/Locore.c ${CFILES} ${MVME68K}/mvme68k/swapgeneric.c \
1311.1Schuck	    ioconf.c param.c | \
1321.6Smycroft	    grep -v 'static function .* unused'
1331.1Schuck
1341.6Smycrofttags:
1351.6Smycroft	@echo "see $S/kern/Makefile for tags"
1361.1Schuck
1371.1Schucklinks:
1381.1Schuck	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1391.1Schuck	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1401.1Schuck	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1411.1Schuck	  sort -u | comm -23 - dontlink | \
1421.6Smycroft	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1431.1Schuck	sh makelinks && rm -f dontlink
1441.1Schuck
1451.6SmycroftSRCS=	${MVME68K}/mvme68k/locore.s \
1461.10Scgd	param.c ioconf.c ${CFILES} ${SFILES}
1471.11Smycroftdepend:: .depend
1481.10Scgd.depend: ${SRCS} assym.h param.c
1491.12Smycroft	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/locore.s
1501.12Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
1511.12Smycroft	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1521.14Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/genassym.c
1531.6Smycroft
1541.6Smycroft
1551.6Smycroft# depend on root or device configuration
1561.6Smycroftautoconf.o conf.o: Makefile
1571.6Smycroft 
1581.6Smycroft# depend on network or filesystem configuration 
1591.6Smycroftuipc_proto.o vfs_conf.o: Makefile 
1601.1Schuck
1611.6Smycroft# depend on maxusers
1621.6Smycroftgenassym.o machdep.o: Makefile
1631.1Schuck
1641.6Smycroft# depend on CPU configuration 
1651.6Smycroftlocore.o pmap.o sys_machdep.o trap.o: Makefile
1661.1Schuck
1671.1Schuck
1681.6Smycroftlocore.o: ${MVME68K}/mvme68k/locore.s assym.h
1691.6Smycroft	${NORMAL_S}
1701.1Schuck
1711.1Schuck%RULES
172