Makefile.vax revision 1.36
1# $NetBSD: Makefile.vax,v 1.36 1997/11/04 22:59:42 ragge Exp $ 2 3# Makefile for NetBSD 4# 5# This makefile is constructed from a machine description: 6# config machineid 7# Most changes should be made in the machine description 8# /sys/arch/vax/conf/``machineid'' 9# after which you should do 10# config machineid 11# Machine generic makefile changes should be made in 12# /sys/arch/vax/conf/Makefile.vax 13# after which config should be rerun for all machines of that type. 14# 15# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 16# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 17# 18# -DTRACE compile in kernel tracing hooks 19# -DQUOTA compile in file system quotas 20 21# DEBUG is set to -g if debugging. 22# PROF is set to -pg if profiling. 23 24CC?= cc 25LD?= ld 26MKDEP?= mkdep 27SIZE?= size 28STRIP?= strip 29COPTS?= -O2 30 31# source tree is located via $S relative to the compilation directory 32.ifndef S 33S!= cd ../../../..; pwd 34.endif 35VAX= $S/arch/vax 36 37INCLUDES= -I. -I$S/arch -I$S -nostdinc 38CPPFLAGS= ${INCLUDES} ${IDENT} ${PARAM} -D_KERNEL \ 39 -D_VAX_INLINE_ 40CWARNFLAGS= -Werror 41CFLAGS= ${DEBUG} ${COPTS} ${CWARNFLAGS} 42AFLAGS= -x assembler-with-cpp -traditional-cpp -D_LOCORE 43LINKFLAGS= -Z -Ttext 80000000 -e _start 44STRIPFLAGS= -d 45 46HOSTED_CC= ${CC} 47HOSTED_CPPFLAGS=${CPPFLAGS:S/^-nostdinc$//} 48HOSTED_CFLAGS= ${CFLAGS} 49 50### find out what to use for libkern 51.include "$S/lib/libkern/Makefile.inc" 52.ifndef PROF 53LIBKERN= ${KERNLIB} 54.else 55LIBKERN= ${KERNLIB_PROF} 56.endif 57 58### find out what to use for libcompat 59.include "$S/compat/common/Makefile.inc" 60.ifndef PROF 61LIBCOMPAT= ${COMPATLIB} 62.else 63LIBCOMPAT= ${COMPATLIB_PROF} 64.endif 65 66# compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or 67# HOSTED}, and SUFFIX is the file suffix, capitalized (e.g. C for a .c file). 68 69NORMAL_C= ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $< 70NORMAL_S= ${CC} ${AFLAGS} ${CPPFLAGS} -c $< 71 72HOSTED_C= ${HOSTED_CC} ${HOSTED_CFLAGS} ${HOSTED_CPPFLAGS} -c $< 73 74%OBJS 75 76%CFILES 77 78%SFILES 79 80# load lines for config "xxx" will be emitted as: 81# xxx: ${SYSTEM_DEP} swapxxx.o 82# ${SYSTEM_LD_HEAD} 83# ${SYSTEM_LD} swapxxx.o 84# ${SYSTEM_LD_TAIL} 85SYSTEM_OBJ= intvec.o subr.o \ 86 param.o ioconf.o ${OBJS} ${LIBKERN} ${LIBCOMPAT} 87SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 88SYSTEM_LD_HEAD= @rm -f $@ 89SYSTEM_LD= @echo ${LD} ${LINKFLAGS} -o $@ '$${SYSTEM_OBJ}' vers.o; \ 90 ${LD} ${LINKFLAGS} -o $@ ${SYSTEM_OBJ} vers.o 91SYSTEM_LD_TAIL= @${SIZE} $@; chmod 755 $@ 92 93DEBUG?= 94.if ${DEBUG} == "-g" 95LINKFLAGS+= -X 96SYSTEM_LD_TAIL+=; \ 97 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 98 echo ${STRIP} ${STRIPFLAGS} $@; ${STRIP} ${STRIPFLAGS} $@ 99.else 100LINKFLAGS+= -S 101.endif 102 103%LOAD 104 105assym.h: $S/kern/genassym.sh ${VAX}/vax/genassym.cf 106 sh $S/kern/genassym.sh ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} \ 107 < ${VAX}/vax/genassym.cf > assym.h.tmp && \ 108 mv -f assym.h.tmp assym.h 109 110param.c: $S/conf/param.c 111 rm -f param.c 112 cp $S/conf/param.c . 113 114param.o: param.c Makefile 115 ${NORMAL_C} 116 117ioconf.o: ioconf.c 118 ${NORMAL_C} 119 120newvers: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 121 sh $S/conf/newvers.sh 122 ${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c vers.c 123 124__CLEANKERNEL: .USE 125 @echo "${.TARGET}ing the kernel objects" 126 rm -f eddep *netbsd netbsd.gdb tags *.[io] [a-z]*.s \ 127 [Ee]rrs linterrs makelinks assym.h.tmp assym.h 128 129__CLEANDEPEND: .USE 130 rm -f .depend 131 132clean: __CLEANKERNEL 133 134cleandir: __CLEANKERNEL __CLEANDEPEND 135 136lint: 137 @lint -hbxncez -Dvolatile= ${CPPFLAGS} -UKGDB \ 138 ${VAX}/vax/Locore.c ${CFILES} \ 139 ioconf.c param.c | \ 140 grep -v 'static function .* unused' 141 142tags: 143 @echo "see $S/kern/Makefile for tags" 144 145links: 146 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 147 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 148 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 149 sort -u | comm -23 - dontlink | \ 150 sed 's,../.*/\(.*.o\),rm -f \1; ln -s ../GENERIC/\1 \1,' > makelinks 151 sh makelinks && rm -f dontlink 152 153SRCS= ${VAX}/vax/intvec.s ${VAX}/vax/subr.s \ 154 param.c ioconf.c ${CFILES} ${SFILES} 155depend: .depend 156.depend: ${SRCS} assym.h param.c 157 ${MKDEP} ${AFLAGS} ${CPPFLAGS} ${VAX}/vax/intvec.s ${VAX}/vax/subr.s 158 ${MKDEP} -a ${CFLAGS} ${CPPFLAGS} param.c ioconf.c ${CFILES} 159 ${MKDEP} -a ${AFLAGS} ${CPPFLAGS} ${SFILES} 160 161 162# depend on root or device configuration 163autoconf.o conf.o: Makefile 164 165# depend on network or filesystem configuration 166uipc_proto.o vfs_conf.o: Makefile 167 168# depend on maxusers 169machdep.o: Makefile 170 171# depend on CPU configuration 172tmscp.o ts.o uba.o uda.o autoconf.o clock.o conf.o emulate.o intvec.o: Makefile 173machdep.o sbi.o subr.o uvaxII.o: Makefile 174 175 176intvec.o: ${VAX}/vax/intvec.s assym.h 177 ${NORMAL_S} 178 179subr.o: ${VAX}/vax/subr.s assym.h 180 ${NORMAL_S} 181 182%RULES 183