1# @(#)Makefile.hp300 7.12 (Berkeley) 12/19/91 2# 3# Makefile for 4.4 BSD 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/conf/``machineid'' 9# after which you should do 10# config machineid 11# Machine generic makefile changes should be made in 12# /sys/conf/Makefile.``machinetype'' 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 22# DEBUG is set to -g by config if debugging is requested (config -g). 23# PROF is set to -pg by config if profiling is requested (config -p). 24AS= as ${DEBUG} 25CC= cc ${DEBUG} 26CPP= cpp 27LD= ld 28TOUCH= touch -f -c 29GPROF.EX=/usr/src/usr.lib/libc/csu/hp300/gmon.ex 30 31# source tree is located via $S relative to the compilation directory 32S= ../.. 33HP300= $S/hp300 34 35INCLUDES= -I. -I$S -I$S/sys 36COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Dhp300 -DFPCOPROC -DREFBIT 37CFLAGS= -O ${COPTS} 38 39# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 40# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, 41# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 42# is marked as config-dependent. 43 44NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 45NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 46 47DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 48DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 49 50PROFILE_C= ${CC} -S -c ${COPTS} $<; \ 51 ex - $*.s < ${GPROF.EX}; \ 52 ${AS} -o $@ $*.s; \ 53 rm -f $*.s 54 55NORMAL_S= ${CPP} ${COPTS} $< | ${AS} -o $@ 56NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ 57 58%OBJS 59 60%CFILES 61 62# load lines for config "xxx" will be emitted as: 63# xxx: ${SYSTEM_DEP} swapxxx.o 64# ${SYSTEM_LD_HEAD} 65# ${SYSTEM_LD} swapxxx.o 66# ${SYSTEM_LD_TAIL} 67SYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o 68#SYSTEM_DEP= Makefile symbols.sort ${SYSTEM_OBJ} 69SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 70SYSTEM_LD_HEAD= rm -f $@ 71SYSTEM_LD= @if [ X${DEBUG} = X-g ]; \ 72 then strip=-X; \ 73 else strip=-x; \ 74 fi; \ 75 echo ${LD} $$strip -n -o $@ -e start '$${SYSTEM_OBJ}' vers.o libquad.a; \ 76 ${LD} $$strip -n -o $@ -e start ${SYSTEM_OBJ} vers.o libquad.a 77#SYSTEM_LD_TAIL= @echo rearranging symbols;\ 78# symorder symbols.sort $@;\ 79SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \ 80 [ X${DEBUG} = X-g ] && { \ 81 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 82 echo strip -d $@; strip -d $@; } || true 83 84%LOAD 85 86newvers: 87 sh $S/conf/newvers.sh 88 ${CC} $(CFLAGS) -c vers.c 89 90clean: 91 rm -f eddep *vmunix vmunix.gdb tags *.o locore.i [a-z]*.s \ 92 Errs errs linterrs makelinks 93 94lint: /tmp param.c 95 @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \ 96 ${HP300}/hp300/Locore.c ${CFILES} ${HP300}/hp300/swapgeneric.c \ 97 ioconf.c param.c| \ 98 grep -v 'struct/union .* never defined' | \ 99 grep -v 'possible pointer alignment problem' 100 101symbols.sort: ${HP300}/hp300/symbols.raw 102 grep -v '^#' ${HP300}/hp300/symbols.raw \ 103 | sed 's/^ //' | sort -u > symbols.sort 104 105locore.o: assym.s ${HP300}/hp300/vectors.s ${HP300}/hp300/locore.s 106locore.o: ${HP300}/include/trap.h ${HP300}/include/psl.h ${HP300}/hp300/pte.h 107locore.o: ${HP300}/include/cpu.h 108 ${CPP} -DLOCORE ${COPTS} ${HP300}/hp300/locore.s | ${AS} -o locore.o 109 110# the following is necessary because autoconf.o depends on #if GENERIC 111autoconf.o: Makefile 112 113# the following are necessary because the files depend on the types of 114# hp cpu's included in the system configuration 115clock.o machdep.o autoconf.o conf.o: Makefile 116 117# depend on network configuration 118af.o uipc_proto.o locore.o: Makefile 119 120# depend on maxusers 121assym.s: Makefile 122 123assym.s: genassym 124 ./genassym >assym.s 125 126genassym: 127 ${CC} ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Dhp300 -o genassym \ 128 ${HP300}/hp300/genassym.c 129 130depend: assym.s param.c 131 mkdep ${COPTS} ${CFILES} ioconf.c param.c 132 mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${HP300}/hp300/genassym.c 133 134links: 135 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 136 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 137 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 138 sort -u | comm -23 - dontlink | \ 139 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 140 sh makelinks && rm -f dontlink 141 142tags: 143 @echo "see $S/kern/Makefile for tags" 144 145ioconf.o: ioconf.c 146 ${CC} -c ${CFLAGS} ioconf.c 147 148param.c: $S/conf/param.c 149 rm -f param.c 150 cp $S/conf/param.c . 151 152param.o: param.c Makefile 153 ${CC} -c ${CFLAGS} ${PARAM} param.c 154 155%RULES 156