Makefile.vax revision 1.61
11.61Sthorpej# $NetBSD: Makefile.vax,v 1.61 2001/10/23 19:26:47 thorpej 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.61Sthorpej 151.61SthorpejMACHINE_ARCH=vax 161.16Smycroft 171.16Smycroft# DEBUG is set to -g if debugging. 181.16Smycroft# PROF is set to -pg if profiling. 191.16Smycroft 201.38SthorpejAR?= ar 211.38SthorpejAS?= as 221.19SmycroftCC?= cc 231.38SthorpejCPP?= cpp 241.19SmycroftLD?= ld 251.37SthorpejLORDER?=lorder 261.23SmycroftMKDEP?= mkdep 271.37SthorpejNM?= nm 281.38SthorpejRANLIB?=ranlib 291.34SlukemSIZE?= size 301.53StsutsuiSTRIP?= strip 311.37SthorpejTSORT?= tsort -q 321.38Sthorpej 331.34SlukemCOPTS?= -O2 341.1Sragge 351.16Smycroft# source tree is located via $S relative to the compilation directory 361.26Smycroft.ifndef S 371.23SmycroftS!= cd ../../../..; pwd 381.26Smycroft.endif 391.23SmycroftVAX= $S/arch/vax 401.1Sragge 411.59SmattHAVE_EGCS!= ${CC} --version | egrep "^(2\.8|2\.9[0-4]|egcs)" ; echo 421.24SmycroftINCLUDES= -I. -I$S/arch -I$S -nostdinc 431.58SmrgCPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL -D_KERNEL_OPT \ 441.25Smycroft -D_VAX_INLINE_ 451.46SaugustssCWARNFLAGS?= -Werror -Wall -Wmissing-prototypes -Wstrict-prototypes \ 461.60Smatt -Wpointer-arith -Wno-main 471.54Sthorpej# XXX Delete -Wuninitialized for now, since the compiler doesn't 481.54Sthorpej# XXX always get it right. --thorpej 491.54SthorpejCWARNFLAGS+= -Wno-uninitialized 501.28SjonathanCFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} 511.54Sthorpej.if (${HAVE_EGCS} != "") 521.47SmattCFLAGS+= -mno-pic 531.47Smatt.endif 541.18SmycroftAFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 551.43SraggeLINKFLAGS= -N -Ttext 80000000 -e start 561.50StsutsuiSTRIPFLAGS= -g 571.48Smrg 581.48Smrg%INCLUDES 591.27Smycroft 601.27SmycroftHOSTED_CC= ${CC} 611.27SmycroftHOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} 621.27SmycroftHOSTED_CFLAGS= ${CFLAGS} 631.1Sragge 641.1Sragge### find out what to use for libkern 651.45SdrochnerKERN_AS= obj 661.1Sragge.include "$S/lib/libkern/Makefile.inc" 671.1Sragge.ifndef PROF 681.9SchristosLIBKERN= ${KERNLIB} 691.1Sragge.else 701.1SraggeLIBKERN= ${KERNLIB_PROF} 711.1Sragge.endif 721.1Sragge 731.11Sragge### find out what to use for libcompat 741.11Sragge.include "$S/compat/common/Makefile.inc" 751.11Sragge.ifndef PROF 761.11SraggeLIBCOMPAT= ${COMPATLIB} 771.11Sragge.else 781.11SraggeLIBCOMPAT= ${COMPATLIB_PROF} 791.11Sragge.endif 801.11Sragge 811.25Smycroft# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 821.25Smycroft# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 831.16Smycroft 841.16SmycroftNORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 851.42SthorpejNOPROF_C= ${CC} ${CFLAGS} ${CPPFLAGS} -c $< 861.18SmycroftNORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 871.24Smycroft 881.27SmycroftHOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< 891.1Sragge 901.1Sragge%OBJS 911.1Sragge 921.1Sragge%CFILES 931.1Sragge 941.16Smycroft%SFILES 951.16Smycroft 961.16Smycroft# load lines for config "xxx" will be emitted as: 971.16Smycroft# xxx: ${SYSTEM_DEP} swapxxx.o 981.16Smycroft# ${SYSTEM_LD_HEAD} 991.16Smycroft# ${SYSTEM_LD} swapxxx.o 1001.16Smycroft# ${SYSTEM_LD_TAIL} 1011.22SraggeSYSTEM_OBJ= intvec.o subr.o \ 1021.45Sdrochner param.o ioconf.o ${OBJS} ${LIBCOMPAT} ${LIBKERN} 1031.16SmycroftSYSTEM_DEP= Makefile ${SYSTEM_OBJ} 1041.16SmycroftSYSTEM_LD_HEAD= @rm -f $@ 1051.16SmycroftSYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 1061.16Smycroft ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 1071.34SlukemSYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 1081.16Smycroft 1091.16SmycroftDEBUG?= 1101.16Smycroft.if ${DEBUG} == "-g" 1111.16SmycroftLINKFLAGS+= -X 1121.16SmycroftSYSTEM_LD_TAIL+=; \ 1131.49Scgd echo mv -f $@ $@.gdb; mv -f $@ $@.gdb; \ 1141.53Stsutsui echo ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb; \ 1151.53Stsutsui ${STRIP} ${STRIPFLAGS} -o $@ $@.gdb 1161.16Smycroft.else 1171.23SmycroftLINKFLAGS+= -S 1181.16Smycroft.endif 1191.16Smycroft 1201.1Sragge%LOAD 1211.1Sragge 1221.35Sraggeassym.h: $S/kern/genassym.sh ${VAX}/vax/genassym.cf 1231.35Sragge sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 1241.35Sragge < ${VAX}/vax/genassym.cf > assym.h.tmp && \ 1251.35Sragge mv -f assym.h.tmp assym.h 1261.35Sragge 1271.16Smycroftparam.c: $S/conf/param.c 1281.16Smycroft rm -f param.c 1291.16Smycroft cp $S/conf/param.c . 1301.1Sragge 1311.16Smycroftparam.o: param.c Makefile 1321.25Smycroft ${NORMAL_C} 1331.1Sragge 1341.16Smycroftioconf.o: ioconf.c 1351.16Smycroft ${NORMAL_C} 1361.1Sragge 1371.16Smycroftnewvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 1381.16Smycroft sh $S/conf/newvers.sh 1391.16Smycroft ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 1401.1Sragge 1411.33Schristos__CLEANKERNEL: .USE 1421.33Schristos @echo "${.TARGET}ing the kernel objects" 1431.33Schristos rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 1441.33Schristos [Ee]rrs linterrs makelinks assym.h.tmp assym.h 1451.33Schristos 1461.33Schristos__CLEANDEPEND: .USE 1471.33Schristos rm -f .depend 1481.1Sragge 1491.33Schristosclean: __CLEANKERNEL 1501.33Schristos 1511.44Slukemcleandir distclean: __CLEANKERNEL __CLEANDEPEND 1521.1Sragge 1531.16Smycroftlint: 1541.29Sperry @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 1551.30Sperry ${VAX}/vax/Locore.c ${CFILES} \ 1561.16Smycroft ioconf.c param.c | \ 1571.16Smycroft grep -v 'static function .* unused' 1581.16Smycroft 1591.16Smycrofttags: 1601.16Smycroft @echo "see $S/kern/Makefile for tags" 1611.16Smycroft 1621.16Smycroftlinks: 1631.16Smycroft egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 1641.16Smycroft sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 1651.16Smycroft echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 1661.16Smycroft sort -u | comm -23 - dontlink | \ 1671.16Smycroft sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 1681.16Smycroft sh makelinks && rm -f dontlink 1691.16Smycroft 1701.22SraggeSRCS= ${VAX}/vax/intvec.s ${VAX}/vax/subr.s \ 1711.20Scgd param.c ioconf.c ${CFILES} ${SFILES} 1721.31Sraggedepend: .depend 1731.35Sragge.depend: ${SRCS} assym.h param.c 1741.23Smycroft ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${VAX}/vax/intvec.s ${VAX}/vax/subr.s 1751.23Smycroft ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 1761.23Smycroft ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 1771.57Schs sh $S/kern/genassym.sh ${MKDEP} -f assym.dep ${CFLAGS} \ 1781.57Schs ${CPPFLAGS} < ${VAX}/vax/genassym.cf 1791.57Schs @sed -e 's/.*\.o:.*\.c/assym.h:/' < assym.dep >> .depend 1801.57Schs @rm -f assym.dep 1811.52Stron 1821.52Strondependall: depend all 1831.16Smycroft 1841.16Smycroft 1851.16Smycroft# depend on root or device configuration 1861.16Smycroftautoconf.o conf.o: Makefile 1871.16Smycroft 1881.16Smycroft# depend on network or filesystem configuration 1891.16Smycroftuipc_proto.o vfs_conf.o: Makefile 1901.16Smycroft 1911.16Smycroft# depend on maxusers 1921.16Smycroftmachdep.o: Makefile 1931.16Smycroft 1941.16Smycroft# depend on CPU configuration 1951.16Smycrofttmscp.o ts.o uba.o uda.o autoconf.o clock.o conf.o emulate.o intvec.o: Makefile 1961.41Sraggemachdep.o sbi.o subr.o: Makefile 1971.5Sragge 1981.1Sragge 1991.36Sraggeintvec.o: ${VAX}/vax/intvec.s assym.h 2001.16Smycroft ${NORMAL_S} 2011.1Sragge 2021.35Sraggesubr.o: ${VAX}/vax/subr.s assym.h 2031.16Smycroft ${NORMAL_S} 2041.55Shubertf 2051.55Shubertf# The install target can be redefined by putting a 2061.55Shubertf# install-kernel-${MACHINE_NAME} target into /etc/mk.conf 2071.55ShubertfMACHINE_NAME!= uname -n 2081.55Shubertfinstall: install-kernel-${MACHINE_NAME} 2091.55Shubertf.if !target(install-kernel-${MACHINE_NAME}}) 2101.55Shubertfinstall-kernel-${MACHINE_NAME}: 2111.55Shubertf rm -f /onetbsd 2121.55Shubertf ln /netbsd /onetbsd 2131.55Shubertf cp netbsd /nnetbsd 2141.55Shubertf mv /nnetbsd /netbsd 2151.55Shubertf.endif 2161.1Sragge 2171.1Sragge%RULES 218