1# makefile.tahoe 1.2 85/04/22 2# makefile.tahoe 6.3 9/25/83 3# 4# Makefile for 4.2 BSD 5# 6# This makefile is constructed from a machine description: 7# config machine 8# Most changes should be made in the machine description 9# /sys/conf/``machineid'' 10# after which you should do 11# config machineid 12# Generic makefile changes should be made in 13# /sys/conf/makefile 14# after which config should be rerun for all machines. 15# 16# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE VISIBLE TO MAKEFILE 17# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING 18# 19# -DTRACE compile in kernel tracing hooks 20# -DQUOTA compile in file system quotas 21# -DSWABIPS compile in code to byte swap ip packets on 3Mb/s Ethernet 22# 23DESTDIR= 24AS=/bin/as 25CC=/bin/cc 26LD=/bin/ld 27INCLDIR=${DESTDIR}/usr/include 28LIBDIR=${DESTDIR}/lib 29ULIBDIR=${DESTDIR}/usr/lib 30 31LCC=/bin/cc 32TOUCH= touch -c 33 34COPTS= ${IDENT} -DKERNEL 35CFLAGS= -O ${COPTS} 36 37%OBJS 38 39%CFILES 40 41%LOAD 42 43clean: 44 rm -f eddep *vmunix tags *.o locore.i [a-tv-z]*.s \ 45 errs linterrs makelinks 46 47lint: /tmp 48 @lint -hbxn -I. -DGENERIC ${COPTS} ../machine/Locore.c \ 49 ${CFILES} ../machine/swapgeneric.c ioconf.c | \ 50 grep -v 'struct/union .* never defined' | \ 51 grep -v 'possible pointer alignment problem' 52 53../machine/symbols.sort: ../machine/symbols.raw 54 grep -v '^#' ../machine/symbols.raw \ 55 | sed 's/^ //' | sort -u > ../machine/symbols.sort 56 57locore.o: assym.s ../machine/scb.s ../machine/locore.s \ 58 ubglue.s ../machine/mtpr.h ../machine/trap.h ../machine/psl.h \ 59 ../machine/pte.h ../machine/cp.h ../machine/mem.h 60 cat assym.s ../machine/scb.s ../machine/locore.s \ 61 ubglue.s > locore.c 62 ${CC} -E -I. -DLOCORE ${COPTS} locore.c > locore.i 63 @echo 'as -o locore.o locore.i' 64 @${AS} -o locore.o locore.i 65 @rm locore.i 66 67# the following is necessary because autoconf.o depends on #if GENERIC 68autoconf.o tu.o: makefile 69 70# depend on network configuration 71af.o : makefile 72# depend on maxusers 73assym.s: makefile 74 75assym.s: ../h/param.h ../machine/pte.h ../h/buf.h ../h/vmparam.h \ 76 ../h/vmmeter.h ../h/dir.h ../h/cmap.h ../h/map.h ../vba/vbavar.h \ 77 ../h/proc.h ../h/msgbuf.h 78 ${LCC} -I/DIST/usr/include ${IDENT} ${PARAM} ../machine/genassym.c; ./a.out >assym.s; rm -f a.out 79 80../h/param.h: ../machine/param.h ../h/signal.h ../h/types.h 81 ${TOUCH} ../h/param.h 82../h/tty.h: ../h/ttychars.h ../h/ttydev.h 83 ${TOUCH} ../h/tty.h 84../h/ioctl.h: /usr/include/sgtty.h ../h/ttychars.h ../h/ttydev.h 85 ${TOUCH} ../h/ioctl.h 86../h/user.h: ../machine/pcb.h ../h/dmap.h ../h/time.h ../h/resource.h \ 87 /usr/include/errno.h 88 ${TOUCH} ../h/user.h 89../h/vm.h: ../h/vmmac.h ../h/vmmeter.h ../h/vmparam.h ../h/vmsystm.h 90 ${TOUCH} ../h/vm.h 91../h/vmparam.h: ../machine/vmparam.h 92 ${TOUCH} ../h/vmparam.h 93 94depend: 95 grep '^#include' ${CFILES} | grep -v '<' | \ 96 sed -e 's/:[^"]*"\([^"]*\)".*/: \1/' \ 97 -e 's/\.c/.o/' \ 98 -e 's,../[a-zA-Z]*/,,' | \ 99 awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \ 100 else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \ 101 else rec = rec " " $$2 } } \ 102 END { print rec } ' > makedep 103 echo '$$r makedep' >>eddep 104 echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep 105 echo '$$r makedep' >>eddep 106 echo 'w' >>eddep 107 cp makefile makefile.bak 108 ed - makefile < eddep 109 rm eddep makedep 110 111 112links: 113 egrep '#if' ${CFILES} | sed -f ../conf/defines | \ 114 sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink 115 echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \ 116 sort -u | comm -23 - dontlink | \ 117 sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks 118 echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks 119 echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks 120 sh makelinks && rm -f dontlink 121 122tags: 123 /usr/ucb/ctags ${CFILES} 124 125print: 126 @pr -f makefile ../sys/TODO linterrs 127 @/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF 128 @(size vmunix *.o) | pr -f -h sizes 129 @ls -ls | pr -f 130 @cd ../h; ls -ls | pr -f ; pr -f *.m *.h 131 @echo 'once upon a time ...' 132 @cd ../sys; pr -f asm.sed Locore.c scb.s locore.s 133 @pr -f ${CFILES} 134 135ioconf.o: ioconf.c ../h/param.h ../machine/pte.h ../h/buf.h ../h/map.h \ 136 ../h/vm.h ../vba/vbavar.h 137 138param.c: ../conf/param.c 139 rm -f param.c 140 cp ../conf/param.c . 141 142param.o: param.c makefile 143 ${CC} -I. -c ${CFLAGS} ${PARAM} param.c 144 145%RULES 146 147# DO NOT DELETE THIS LINE -- make depend uses it 148 149