1 1.1 chuck # $NetBSD: Makefile.mvme68k,v 1.1 1995/07/25 23:12:05 chuck Exp $ 2 1.1 chuck 3 1.1 chuck # @(#)Makefile.hp300 8.2 (Berkeley) 1/23/94 4 1.1 chuck # 5 1.1 chuck # Makefile for NetBSD 6 1.1 chuck # 7 1.1 chuck # This makefile is constructed from a machine description: 8 1.1 chuck # config machineid 9 1.1 chuck # Most changes should be made in the machine description 10 1.1 chuck # /sys/arch/mvme68k/conf/``machineid'' 11 1.1 chuck # after which you should do 12 1.1 chuck # config.new machineid 13 1.1 chuck # Machine generic makefile changes should be made in 14 1.1 chuck # /sys/arch/mvme68k/conf/Makefile.mvme68k 15 1.1 chuck # after which config should be rerun for all machines of that type. 16 1.1 chuck # 17 1.1 chuck # N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 18 1.1 chuck # IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 19 1.1 chuck # 20 1.1 chuck # -DTRACE compile in kernel tracing hooks 21 1.1 chuck # -DQUOTA compile in file system quotas 22 1.1 chuck 23 1.1 chuck 24 1.1 chuck # DEBUG is set to -g by config if debugging is requested (config -g). 25 1.1 chuck # PROF is set to -pg by config if profiling is requested (config -p). 26 1.1 chuck AS= as ${DEBUG} 27 1.1 chuck CC= cc ${DEBUG} 28 1.1 chuck CPP= cpp 29 1.1 chuck LD= ld 30 1.1 chuck TOUCH= touch -f -c 31 1.1 chuck AWK= awk 32 1.1 chuck 33 1.1 chuck # source tree is located via $S relative to the compilation directory 34 1.1 chuck S= ../../../.. 35 1.1 chuck MVME68K= ../.. 36 1.1 chuck 37 1.1 chuck INCLUDES= -I. -I$S/arch -I$S -I$S/sys 38 1.1 chuck COPTS= ${INCLUDES} ${IDENT} -D_KERNEL -Dmc68020 -Dmvme68k -DFPCOPROC 39 1.1 chuck CFLAGS= -O ${COPTS} 40 1.1 chuck 41 1.1 chuck ### find out what to use for libkern 42 1.1 chuck .include "$S/lib/libkern/Makefile.inc" 43 1.1 chuck .ifndef PROF 44 1.1 chuck LIBKERN= ${KERNLIB} 45 1.1 chuck .else 46 1.1 chuck LIBKERN= ${KERNLIB_PROF} 47 1.1 chuck .endif 48 1.1 chuck 49 1.1 chuck ### find out what to use for libcompat 50 1.1 chuck .include "$S/compat/common/Makefile.inc" 51 1.1 chuck .ifndef PROF 52 1.1 chuck LIBCOMPAT= ${COMPATLIB} 53 1.1 chuck .else 54 1.1 chuck LIBCOMPAT= ${COMPATLIB_PROF} 55 1.1 chuck .endif 56 1.1 chuck 57 1.1 chuck ### for the Motorola 68040 Floating Point Software Product 58 1.1 chuck .include "$S/arch/m68k/fpsp/Makefile.inc" 59 1.1 chuck 60 1.1 chuck # compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 61 1.1 chuck # where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, 62 1.1 chuck # capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 63 1.1 chuck # is marked as config-dependent. 64 1.1 chuck 65 1.1 chuck NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 66 1.1 chuck NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 67 1.1 chuck 68 1.1 chuck DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 69 1.1 chuck DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 70 1.1 chuck 71 1.1 chuck PROFILE_C= ${CC} -S -c ${COPTS} $<; \ 72 1.1 chuck sed -e s/_mcount/mcount/ -e s/subrmcount/subr_mcount/ <$*.s | \ 73 1.1 chuck ${AS} -o $@; \ 74 1.1 chuck rm -f $*.s 75 1.1 chuck 76 1.1 chuck NORMAL_S= ${CPP} ${COPTS} $< | ${AS} -o $@ 77 1.1 chuck NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ 78 1.1 chuck 79 1.1 chuck %OBJS 80 1.1 chuck 81 1.1 chuck %CFILES 82 1.1 chuck 83 1.1 chuck # load lines for config "xxx" will be emitted as: 84 1.1 chuck # xxx: ${SYSTEM_DEP} swapxxx.o 85 1.1 chuck # ${SYSTEM_LD_HEAD} 86 1.1 chuck # ${SYSTEM_LD} swapxxx.o 87 1.1 chuck # ${SYSTEM_LD_TAIL} 88 1.1 chuck DEBUG?= 89 1.1 chuck .if ${DEBUG} == "-g" 90 1.1 chuck LDX=-X 91 1.1 chuck .else 92 1.1 chuck LDX=-x 93 1.1 chuck .endif 94 1.1 chuck SYSTEM_OBJ= locore.o ${FPSP} vnode_if.o ${OBJS} param.o ioconf.o \ 95 1.1 chuck ${LIBKERN} ${LIBCOMPAT} 96 1.1 chuck SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 97 1.1 chuck SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 98 1.1 chuck SYSTEM_LD= @${LD} ${LDX} -Ttext 0x8000 -n -o $@ -e start \ 99 1.1 chuck ${SYSTEM_OBJ} vers.o 100 1.1 chuck SYSTEM_LD_TAIL= @echo rearranging symbols; size $@; chmod 755 $@ 101 1.1 chuck 102 1.1 chuck %LOAD 103 1.1 chuck 104 1.1 chuck newvers: vers.o 105 1.1 chuck 106 1.1 chuck vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 107 1.1 chuck sh $S/conf/newvers.sh 108 1.1 chuck ${CC} ${CFLAGS} -c vers.c 109 1.1 chuck 110 1.1 chuck clean:: 111 1.1 chuck rm -f eddep *netbsd netbsd.gdb tags vnode_if.[ch] *.o locore.i \ 112 1.1 chuck [a-z]*.s [Ee]rrs linterrs makelinks genassym 113 1.1 chuck 114 1.1 chuck lint: /tmp param.c 115 1.1 chuck @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \ 116 1.1 chuck ${MVME68K}/mvme68k/Locore.c ${CFILES} ${MVME68K}/mvme68k/swapgeneric.c \ 117 1.1 chuck ioconf.c param.c | \ 118 1.1 chuck grep -v 'struct/union .* never defined' | \ 119 1.1 chuck grep -v 'possible pointer alignment problem' 120 1.1 chuck 121 1.1 chuck locore.o: assym.s ${MVME68K}/mvme68k/vectors.s ${MVME68K}/mvme68k/locore.s 122 1.1 chuck locore.o: ${MVME68K}/include/trap.h ${MVME68K}/include/psl.h ${MVME68K}/include/pte.h 123 1.1 chuck locore.o: ${MVME68K}/include/cpu.h 124 1.1 chuck ${CPP} -DLOCORE ${COPTS} ${MVME68K}/mvme68k/locore.s | ${AS} -o locore.o 125 1.1 chuck 126 1.1 chuck # depend on maxusers 127 1.1 chuck assym.s: Makefile 128 1.1 chuck 129 1.1 chuck assym.s: genassym 130 1.1 chuck ./genassym > assym.s 131 1.1 chuck 132 1.1 chuck genassym: ${MVME68K}/mvme68k/genassym.c Makefile 133 1.1 chuck cc ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Dmvme68k -o genassym \ 134 1.1 chuck ${MVME68K}/mvme68k/genassym.c 135 1.1 chuck 136 1.1 chuck depend: assym.s param.c vnode_if.h 137 1.1 chuck mkdep ${COPTS} ${CFILES} ioconf.c param.c 138 1.1 chuck mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${MVME68K}/mvme68k/genassym.c 139 1.1 chuck 140 1.1 chuck links: 141 1.1 chuck egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 142 1.1 chuck sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 143 1.1 chuck echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 144 1.1 chuck sort -u | comm -23 - dontlink | \ 145 1.1 chuck sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 146 1.1 chuck sh makelinks && rm -f dontlink 147 1.1 chuck 148 1.1 chuck tags: 149 1.1 chuck @echo "see $S/kern/Makefile for tags" 150 1.1 chuck 151 1.1 chuck ioconf.o: ioconf.c 152 1.1 chuck ${CC} -c ${CFLAGS} ioconf.c 153 1.1 chuck 154 1.1 chuck param.c: $S/conf/param.c 155 1.1 chuck rm -f param.c 156 1.1 chuck cp $S/conf/param.c . 157 1.1 chuck 158 1.1 chuck param.o: param.c Makefile 159 1.1 chuck ${CC} -c ${CFLAGS} ${PARAM} param.c 160 1.1 chuck 161 1.1 chuck vnode_if.c vnode_if.h: $S/kern/vnode_if.sh $S/kern/vnode_if.src 162 1.1 chuck AWK="${AWK}" sh $S/kern/vnode_if.sh $S/kern/vnode_if.src 163 1.1 chuck 164 1.1 chuck %RULES 165