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