Makefile.sun3 revision 1.8
1# 2# Makefile for 4.4 BSD 3# 4# This makefile is constructed from a machine description: 5# config machineid 6# Most changes should be made in the machine description 7# /sys/conf/``machineid'' 8# after which you should do 9# config machineid 10# Machine generic makefile changes should be made in 11# /sys/conf/Makefile.``machinetype'' 12# after which config should be rerun for all machines of that type. 13# 14# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 15# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 16# 17# -DTRACE compile in kernel tracing hooks 18# -DQUOTA compile in file system quotas 19 20 21# DEBUG is set to -g by config if debugging is requested (config -g). 22# PROF is set to -pg by config if profiling is requested (config -p). 23AS= gas 24CC= gcc ${DEBUG} 25CPP= gcpp -traditional 26LD= ld 27TOUCH= touch -f -c 28GPROF.EX=/usr/src/usr.lib/libc/csu/sun3/gmon.ex 29 30# source tree is located via $S relative to the compilation directory 31S= ../../../.. 32SUN3= ../.. 33 34INCLUDES= -I. -I$S -I$S/sys 35COPTS= ${INCLUDES} ${IDENT} -DKERNEL -Dmc68020 -Dsun3 36CFLAGS= ${COPTS} 37 38# compile rules: rules are named ${TYPE}_${SUFFIX}${CONFIG_DEP} 39# where TYPE is NORMAL, DRIVER, or PROFILE}; SUFFIX is the file suffix, 40# capitalized (e.g. C for a .c file), and CONFIG_DEP is _C if the file 41# is marked as config-dependent. 42 43NORMAL_C= ${CC} -c ${CFLAGS} ${PROF} $< 44NORMAL_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 45 46DRIVER_C= ${CC} -c ${CFLAGS} ${PROF} $< 47DRIVER_C_C= ${CC} -c ${CFLAGS} ${PROF} ${PARAM} $< 48 49PROFILE_C= ${CC} -S -c ${COPTS} $<; \ 50 ex - $*.s < ${GPROF.EX}; \ 51 ${AS} -o $@ $*.s; \ 52 rm -f $*.s 53 54NORMAL_S= ${CPP} ${COPTS} $< | ${AS} -o $@ 55NORMAL_S_C= ${CPP} ${COPTS} ${PARAM} $< | ${AS} -o $@ 56 57%OBJS 58 59%CFILES 60 61# load lines for config "xxx" will be emitted as: 62# xxx: ${SYSTEM_DEP} swapxxx.o 63# ${SYSTEM_LD_HEAD} 64# ${SYSTEM_LD} swapxxx.o 65# ${SYSTEM_LD_TAIL} 66SYSTEM_OBJ= locore.o ${OBJS} param.o ioconf.o 67#SYSTEM_DEP= Makefile symbols.sort ${SYSTEM_OBJ} 68SYSTEM_DEP= Makefile ${SYSTEM_OBJ} 69SYSTEM_LD_HEAD= @echo loading $@; rm -f $@ 70SYSTEM_LD= @strip=-x; [ X${DEBUG} = X-g ] && strip=-X; \ 71 ${LD} -n -o $@ -e _start -N -T 0E004000 ${SYSTEM_OBJ} vers.o 72#SYSTEM_LD= @strip=-x; [ X${DEBUG} = X-g ] && strip=-X; \ 73# ${LD} $$strip -n -o $@ -e _start -N -X -T 0E004000 ${SYSTEM_OBJ} vers.o 74 75#SYSTEM_LD_TAIL= @echo rearranging symbols;\ 76# symorder symbols.sort $@;\ 77SYSTEM_LD_TAIL= @size $@; chmod 755 $@; \ 78 [ X${DEBUG} = X-g ] && { \ 79 echo cp $@ $@.gdb; rm -f $@.gdb; cp $@ $@.gdb; \ 80 echo strip $@; strip $@; } || true 81 82%LOAD 83 84newvers: 85 sh $S/conf/newvers.sh 86 ${CC} $(CFLAGS) -c vers.c 87 88clean: 89 rm -f eddep netbsd* tags *.o locore.i [a-z]*.s \ 90 Errs errs linterrs makelinks 91 92lint: /tmp param.c 93 @lint -hbxn -DGENERIC -Dvolatile= ${COPTS} ${PARAM} -UKGDB \ 94 ${SUN3}/sun3/Locore.c ${CFILES} ${SUN3}/sun3/swapgeneric.c \ 95 ioconf.c param.c| \ 96 grep -v 'struct/union .* never defined' | \ 97 grep -v 'possible pointer alignment problem' 98 99symbols.sort: ${SUN3}/sun3/symbols.raw 100 grep -v '^#' ${SUN3}/sun3/symbols.raw \ 101 | sed 's/^ //' | sort -u > symbols.sort 102 103locore.o: assym.s ${SUN3}/sun3/locore.s 104locore.o: ${SUN3}/include/trap.h ${SUN3}/include/psl.h 105locore.o: ${SUN3}/include/cpu.h ${SUN3}/include/control.h 106#locore.o: assym.s ${SUN3}/sun3/vectors.s ${SUN3}/sun3/locore.s 107#locore.o: ${SUN3}/include/trap.h ${SUN3}/include/psl.h ${SUN3}/sun3/pte.h 108#locore.o: ${SUN3}/include/cpu.h 109 ${CPP} -DLOCORE ${COPTS} ${SUN3}/sun3/locore.s > plocore.s 110 echo "" >>plocore.s 111 ${AS} -o locore.o plocore.s 112 113# the following is necessary because autoconf.o depends on #if GENERIC 114autoconf.o: Makefile 115 116sun3_startup.o: Makefile 117 118# depend on network configuration 119af.o uipc_proto.o locore.o: Makefile 120 121# depend on maxusers 122assym.s: Makefile 123 124assym.s: genassym 125 ./genassym >assym.s 126 127genassym: 128 ${CC} ${INCLUDES} ${IDENT} ${PARAM} -Dmc68020 -Dsun3 -o genassym \ 129 ${SUN3}/sun3/genassym.c 130 131depend: assym.s param.c 132 mkdep ${COPTS} ${CFILES} ioconf.c param.c 133 mkdep -a -p ${INCLUDES} ${IDENT} ${PARAM} ${SUN3}/sun3/genassym.c ${SUN3}/sun3/locore.s 134 135links: 136 egrep '#if' ${CFILES} | sed -f $S/conf/defines | \ 137 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 138 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 139 sort -u | comm -23 - dontlink | \ 140 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 141 sh makelinks && rm -f dontlink 142 143tags: 144 @echo "see $S/kern/Makefile for tags" 145 146ioconf.o: ioconf.c 147 ${CC} -c ${CFLAGS} ioconf.c 148 149param.c: $S/conf/param.c 150 rm -f param.c 151 cp $S/conf/param.c . 152 153param.o: param.c Makefile 154 ${CC} -c ${CFLAGS} ${PARAM} param.c 155 156vers.o: ${SYSTEM_DEP} ${SYSTEM_SWAP_DEP} 157 sh $S/conf/newvers.sh ${KERN_IDENT} ${IDENT} 158 ${CC} ${CFLAGS} -c vers.c 159 160%RULES 161