Makefile.mvme68k revision 1.46
11.46Sscw# $NetBSD: Makefile.mvme68k,v 1.46 2000/03/18 22:33:02 scw 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.32SthorpejAR?= ar 251.32SthorpejAS?= as 261.9SmycroftCC?= cc 271.32SthorpejCPP?= cpp 281.9SmycroftLD?= ld 291.31SthorpejLORDER?=lorder 301.12SmycroftMKDEP?= mkdep 311.31SthorpejNM?= nm 321.32SthorpejRANLIB?=ranlib 331.30SlukemSIZE?= size 341.45StsutsuiSTRIP?= strip 351.31SthorpejTSORT?= tsort -q 361.32Sthorpej 371.30SlukemCOPTS?= -O2 381.1Schuck 391.1Schuck# source tree is located via $S relative to the compilation directory 401.15Smycroft.ifndef S 411.12SmycroftS!= cd ../../../..; pwd 421.15Smycroft.endif 431.12SmycroftMVME68K=$S/arch/mvme68k 441.1Schuck 451.23Sgwr# Override CPP defaults entirely, so cross-compilation works. 461.23Sgwr# Keep -nostdinc before all -I flags, similar for -undef ... 471.33StvHAVE_GCC28!= ${CC} --version | egrep "^(2\.8|egcs)" ; echo 481.23SgwrINCLUDES= -nostdinc -I. -I$S/arch -I$S 491.39SthorpejCPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -Dmvme68k 501.46SscwCWARNFLAGS?= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes \ 511.46Sscw -Wpointer-arith 521.33Stv.if (${HAVE_GCC28} != "") 531.33StvCWARNFLAGS+= -Wno-main 541.33Stv.endif 551.25SthorpejCFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} -msoft-float 561.25SthorpejAFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 571.6SmycroftLINKFLAGS= -n -Ttext 8000 -e start 581.42StsutsuiSTRIPFLAGS= -g 591.40Smrg 601.40Smrg%INCLUDES 611.16Smycroft 621.25SthorpejHOSTED_CC= ${CC} 631.25SthorpejHOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} 641.25SthorpejHOSTED_CFLAGS= ${CFLAGS} 651.25Sthorpej 661.1Schuck### find out what to use for libkern 671.36SdrochnerKERN_AS= obj 681.1Schuck.include "$S/lib/libkern/Makefile.inc" 691.1Schuck.ifndef PROF 701.1SchuckLIBKERN= ${KERNLIB} 711.1Schuck.else 721.1SchuckLIBKERN= ${KERNLIB_PROF} 731.1Schuck.endif 741.1Schuck 751.1Schuck### find out what to use for libcompat 761.1Schuck.include "$S/compat/common/Makefile.inc" 771.1Schuck.ifndef PROF 781.23SgwrLIBCOMPAT= ${COMPATLIB} 791.1Schuck.else 801.23SgwrLIBCOMPAT= ${COMPATLIB_PROF} 811.1Schuck.endif 821.1Schuck 831.1Schuck### for the Motorola 68040 Floating Point Software Product 841.1Schuck.include "$S/arch/m68k/fpsp/Makefile.inc" 851.1Schuck 861.25Sthorpej# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 871.25Sthorpej# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 881.1Schuck 891.6SmycroftNORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 901.34SthorpejNOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< 911.25SthorpejNORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 921.1Schuck 931.25SthorpejHOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< 941.13Smycroft 951.1Schuck%OBJS 961.1Schuck 971.1Schuck%CFILES 981.1Schuck 991.6Smycroft%SFILES 1001.6Smycroft 1011.1Schuck# load lines for config "xxx" will be emitted as: 1021.1Schuck# xxx: ${SYSTEM_DEP} swapxxx.o 1031.1Schuck# ${SYSTEM_LD_HEAD} 1041.1Schuck# ${SYSTEM_LD} swapxxx.o 1051.1Schuck# ${SYSTEM_LD_TAIL} 1061.6SmycroftSYSTEM_OBJ= locore.o ${FPSP} \ 1071.36Sdrochner param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 1081.6SmycroftSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 1091.6SmycroftSYSTEM_LD_HEAD= @rm -f $@ 1101.6SmycroftSYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 1111.6Smycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 1121.30SlukemSYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 1131.6Smycroft 1141.1SchuckDEBUG?= 1151.1Schuck.if ${DEBUG} == "-g" 1161.6SmycroftLINKFLAGS+= -X 1171.6SmycroftSYSTEM_LD_TAIL+=; \ 1181.41Scgd echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ 1191.45Stsutsui echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ 1201.45Stsutsui ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb 1211.1Schuck.else 1221.12SmycroftLINKFLAGS+= -S 1231.1Schuck.endif 1241.1Schuck 1251.1Schuck%LOAD 1261.1Schuck 1271.22Smycroftassym.h: $S/kern/genassym.sh ${MVME68K}/mvme68k/genassym.cf 1281.22Smycroft sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 1291.22Smycroft < ${MVME68K}/mvme68k/genassym.cf > assym.h.tmp && \ 1301.22Smycroft mv -f assym.h.tmp assym.h 1311.6Smycroft 1321.6Smycroftparam.c: $S/conf/param.c 1331.6Smycroft rm -f param.c 1341.6Smycroft cp $S/conf/param.c . 1351.6Smycroft 1361.6Smycroftparam.o: param.c Makefile 1371.14Smycroft ${NORMAL_C} 1381.6Smycroft 1391.6Smycroftioconf.o: ioconf.c 1401.6Smycroft ${NORMAL_C} 1411.1Schuck 1421.6Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1431.1Schuck sh $S/conf/newvers.sh 1441.6Smycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 1451.6Smycroft 1461.29Schristos__CLEANKERNEL: .USE 1471.29Schristos @echo "${.TARGET}ing the kernel objects" 1481.10Scgd rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 1491.22Smycroft [Ee]rrs linterrs makelinks assym.h.tmp assym.h 1501.29Schristos 1511.29Schristos__CLEANDEPEND: .USE 1521.29Schristos rm -f .depend 1531.29Schristos 1541.29Schristosclean: __CLEANKERNEL 1551.29Schristos 1561.35Slukemcleandir distclean: __CLEANKERNEL __CLEANDEPEND 1571.1Schuck 1581.6Smycroftlint: 1591.18Sperry @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 1601.27Smycroft ${CFILES} ioconf.c param.c | \ 1611.6Smycroft grep -v 'static function .* unused' 1621.1Schuck 1631.6Smycrofttags: 1641.6Smycroft @echo "see $S/kern/Makefile for tags" 1651.1Schuck 1661.1Schucklinks: 1671.1Schuck egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1681.1Schuck sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1691.1Schuck echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1701.1Schuck sort -u | comm -23 - dontlink | \ 1711.6Smycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 1721.1Schuck sh makelinks && rm -f dontlink 1731.1Schuck 1741.6SmycroftSRCS= ${MVME68K}/mvme68k/locore.s \ 1751.10Scgd param.c ioconf.c ${CFILES} ${SFILES} 1761.20Schuckdepend: .depend 1771.10Scgd.depend: ${SRCS} assym.h param.c 1781.25Sthorpej ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${MVME68K}/mvme68k/locore.s 1791.25Sthorpej ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 1801.25Sthorpej -if test -n "${SFILES}"; then \ 1811.25Sthorpej ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES}; \ 1821.25Sthorpej fi 1831.26Sleo sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 1841.26Sleo ${CPPFLAGS} < ${MVME68K}/mvme68k/genassym.cf 1851.26Sleo @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 1861.26Sleo @rm -f assym.dep 1871.44Stron 1881.44Strondependall: depend all 1891.6Smycroft 1901.6Smycroft 1911.6Smycroft# depend on root or device configuration 1921.6Smycroftautoconf.o conf.o: Makefile 1931.6Smycroft 1941.6Smycroft# depend on network or filesystem configuration 1951.6Smycroftuipc_proto.o vfs_conf.o: Makefile 1961.1Schuck 1971.6Smycroft# depend on maxusers 1981.22Smycroftmachdep.o: Makefile 1991.1Schuck 2001.6Smycroft# depend on CPU configuration 2011.6Smycroftlocore.o pmap.o sys_machdep.o trap.o: Makefile 2021.1Schuck 2031.1Schuck 2041.6Smycroftlocore.o: ${MVME68K}/mvme68k/locore.s assym.h 2051.6Smycroft ${NORMAL_S} 2061.1Schuck 2071.1Schuck%RULES 208