Makefile.mvme68k revision 1.15
11.15Smycroft#	$NetBSD: Makefile.mvme68k,v 1.15 1996/08/31 21:41:25 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.15Smycroft.ifndef S
321.12SmycroftS!=	cd ../../../..; pwd
331.15Smycroft.endif
341.12SmycroftMVME68K=$S/arch/mvme68k
351.1Schuck
361.13SmycroftINCLUDES=	-I. -I$S/arch -I$S -nostdinc
371.14SmycroftCPPFLAGS=	${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \
381.14Smycroft		-Dmc68020 -Dmvme68k -DFPCOPROC
391.12SmycroftCWARNFLAGS=	-Werror
401.12SmycroftCFLAGS=		${DEBUG} ${CWARNFLAGS} -O2 -msoft-float
411.8SmycroftAFLAGS=		-x assembler-with-cpp -traditional-cpp -D_LOCORE
421.6SmycroftLINKFLAGS=	-n -Ttext 8000 -e start
431.1Schuck
441.1Schuck### find out what to use for libkern
451.1Schuck.include "$S/lib/libkern/Makefile.inc"
461.1Schuck.ifndef PROF
471.1SchuckLIBKERN=	${KERNLIB}
481.1Schuck.else
491.1SchuckLIBKERN=	${KERNLIB_PROF}
501.1Schuck.endif
511.1Schuck
521.1Schuck### find out what to use for libcompat
531.1Schuck.include "$S/compat/common/Makefile.inc"
541.1Schuck.ifndef PROF
551.1SchuckLIBCOMPAT=    ${COMPATLIB}
561.1Schuck.else
571.1SchuckLIBCOMPAT=    ${COMPATLIB_PROF}
581.1Schuck.endif
591.1Schuck
601.1Schuck### for the Motorola 68040 Floating Point Software Product
611.1Schuck.include "$S/arch/m68k/fpsp/Makefile.inc"
621.1Schuck
631.14Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
641.14Smycroft# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
651.1Schuck
661.6SmycroftNORMAL_C=	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $<
671.8SmycroftNORMAL_S=	${CC} ${AFLAGS} ${CPPFLAGS} -c $<
681.1Schuck
691.14SmycroftHOSTED_C=	${NORMAL_C:S/^-pg$//:S/^-p$//:S/^-nostdinc$//}
701.13Smycroft
711.1Schuck%OBJS
721.1Schuck
731.1Schuck%CFILES
741.1Schuck
751.6Smycroft%SFILES
761.6Smycroft
771.1Schuck# load lines for config "xxx" will be emitted as:
781.1Schuck# xxx: ${SYSTEM_DEP} swapxxx.o
791.1Schuck#	${SYSTEM_LD_HEAD}
801.1Schuck#	${SYSTEM_LD} swapxxx.o
811.1Schuck#	${SYSTEM_LD_TAIL}
821.6SmycroftSYSTEM_OBJ=	locore.o ${FPSP} \
831.10Scgd		param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT}
841.6SmycroftSYSTEM_DEP=	Makefile ${SYSTEM_OBJ}
851.6SmycroftSYSTEM_LD_HEAD=	@rm -f $@
861.6SmycroftSYSTEM_LD=	@echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \
871.6Smycroft		${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o
881.6SmycroftSYSTEM_LD_TAIL=	@size $@; chmod 755 $@
891.6Smycroft
901.1SchuckDEBUG?=
911.1Schuck.if ${DEBUG} == "-g"
921.6SmycroftLINKFLAGS+=	-X
931.6SmycroftSYSTEM_LD_TAIL+=; \
941.6Smycroft		echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \
951.6Smycroft		echo ${STRIP} $@; ${STRIP} $@
961.1Schuck.else
971.12SmycroftLINKFLAGS+=	-S
981.1Schuck.endif
991.1Schuck
1001.1Schuck%LOAD
1011.1Schuck
1021.6Smycroftassym.h: genassym
1031.6Smycroft	./genassym >assym.h
1041.6Smycroft
1051.6Smycroftgenassym: genassym.o
1061.6Smycroft	${CC} -o $@ genassym.o
1071.6Smycroft
1081.6Smycroftgenassym.o: ${MVME68K}/mvme68k/genassym.c
1091.14Smycroft	${HOSTED_C}
1101.6Smycroft
1111.6Smycroftparam.c: $S/conf/param.c
1121.6Smycroft	rm -f param.c
1131.6Smycroft	cp $S/conf/param.c .
1141.6Smycroft
1151.6Smycroftparam.o: param.c Makefile
1161.14Smycroft	${NORMAL_C}
1171.6Smycroft
1181.6Smycroftioconf.o: ioconf.c
1191.6Smycroft	${NORMAL_C}
1201.1Schuck
1211.6Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP}
1221.1Schuck	sh $S/conf/newvers.sh
1231.6Smycroft	${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c
1241.6Smycroft
1251.1Schuck
1261.1Schuckclean::
1271.10Scgd	rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \
1281.6Smycroft	    [Ee]rrs linterrs makelinks genassym genassym.o assym.h
1291.1Schuck
1301.6Smycroftlint:
1311.14Smycroft	@lint -hbxncez -DGENERIC -Dvolatile= ${CPPFLAGS} -UKGDB \
1321.1Schuck	    ${MVME68K}/mvme68k/Locore.c ${CFILES} ${MVME68K}/mvme68k/swapgeneric.c \
1331.1Schuck	    ioconf.c param.c | \
1341.6Smycroft	    grep -v 'static function .* unused'
1351.1Schuck
1361.6Smycrofttags:
1371.6Smycroft	@echo "see $S/kern/Makefile for tags"
1381.1Schuck
1391.1Schucklinks:
1401.1Schuck	egrep '#if' ${CFILES} | sed -f $S/conf/defines | \
1411.1Schuck	  sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
1421.1Schuck	echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
1431.1Schuck	  sort -u | comm -23 - dontlink | \
1441.6Smycroft	  sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks
1451.1Schuck	sh makelinks && rm -f dontlink
1461.1Schuck
1471.6SmycroftSRCS=	${MVME68K}/mvme68k/locore.s \
1481.10Scgd	param.c ioconf.c ${CFILES} ${SFILES}
1491.11Smycroftdepend:: .depend
1501.10Scgd.depend: ${SRCS} assym.h param.c
1511.12Smycroft	${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/locore.s
1521.12Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES}
1531.12Smycroft	${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}
1541.14Smycroft	${MKDEP} -a ${CFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/genassym.c
1551.6Smycroft
1561.6Smycroft
1571.6Smycroft# depend on root or device configuration
1581.6Smycroftautoconf.o conf.o: Makefile
1591.6Smycroft 
1601.6Smycroft# depend on network or filesystem configuration 
1611.6Smycroftuipc_proto.o vfs_conf.o: Makefile 
1621.1Schuck
1631.6Smycroft# depend on maxusers
1641.6Smycroftgenassym.o machdep.o: Makefile
1651.1Schuck
1661.6Smycroft# depend on CPU configuration 
1671.6Smycroftlocore.o pmap.o sys_machdep.o trap.o: Makefile
1681.1Schuck
1691.1Schuck
1701.6Smycroftlocore.o: ${MVME68K}/mvme68k/locore.s assym.h
1711.6Smycroft	${NORMAL_S}
1721.1Schuck
1731.1Schuck%RULES
174