clean up awk syntax
[unix-history] / usr / src / sys / tahoe / conf / Makefile.tahoe
# @(#)Makefile.tahoe 1.8 (Berkeley) %G%
#
# Makefile for 4.3 BSD
#
# This makefile is constructed from a machine description:
# config machineid
# Most changes should be made in the machine description
# /sys/conf/``machineid''
# after which you should do
# config machineid
# Generic makefile changes should be made in
# /sys/conf/Makefile.``machinetype''
# after which config should be rerun for all machines.
#
# N.B.: NO DEPENDENCIES ON FOLLOWING FLAGS ARE INVISIBLE TO MAKEFILE
# IF YOU CHANGE THE DEFINITION OF ANY OF THESE RECOMPILE EVERYTHING
#
# -DTRACE compile in kernel tracing hooks
# -DQUOTA compile in file system quotas
#
C2= /lib/c2
LD= /bin/ld
TOUCH= touch -f -c
INDIR= ../tahoe/inline
INLINE= ${INDIR}/inline
INCLUDES= -I. -I../h
COPTS= ${INCLUDES} ${IDENT} -DKERNEL
CFLAGS= -O ${COPTS}
%OBJS
%CFILES
%LOAD
clean:
rm -f eddep *vmunix tags *.o locore.i [a-uw-z]*.s \
errs linterrs makelinks
lint: /tmp param.c
@lint -hbxn -I. -DGENERIC ${COPTS} ${PARAM} ../tahoe/Locore.c \
${CFILES} ../tahoe/swapgeneric.c ioconf.c param.c | \
grep -v 'struct/union .* never defined' | \
grep -v 'possible pointer alignment problem'
../tahoe/symbols.sort: ../tahoe/symbols.raw
grep -v '^#' ../tahoe/symbols.raw \
| sed 's/^ //' | sort -u > ../tahoe/symbols.sort
${INLINE}: ${INDIR}/inline.h ${INDIR}/langpats.c
${INLINE}: ${INDIR}/libcpats.c ${INDIR}/machdep.c
${INLINE}: ${INDIR}/machpats.c ${INDIR}/main.c
cd ${INDIR}; make
locore.o: assym.s ../tahoe/scb.s vbvec.s ../tahoe/locore.s \
vbglue.s ../tahoe/mtpr.h ../tahoe/trap.h ../tahoe/psl.h \
../tahoe/pte.h ../tahoe/cp.h ../tahoe/mem.h
cat assym.s ../tahoe/scb.s vbvec.s ../tahoe/locore.s \
vbglue.s > locore.c
${CC} -E -I. -DLOCORE ${COPTS} locore.c > locore.i
@echo 'as -o locore.o locore.i'
@${AS} -o locore.o locore.i
@rm locore.i
# the following is necessary because autoconf.o depends on #if GENERIC
autoconf.o: Makefile
# depend on network configuration
af.o uipc_proto.o locore.o: Makefile
# depend on maxusers
assym.s machdep.o: Makefile
# depends on KDB (cons.o also depends on GENERIC)
trap.o cons.o: Makefile
assym.s: ../h/param.h ../tahoe/pte.h ../h/buf.h ../h/vmparam.h \
../h/vmmeter.h ../h/dir.h ../h/cmap.h ../h/map.h ../tahoevba/vbavar.h \
../h/proc.h ../h/msgbuf.h ../tahoe/scb.h
${CC} ${INCLUDES} -DKERNEL ${IDENT} ${PARAM} ../tahoe/genassym.c
./a.out >assym.s; rm -f a.out
depend: assym.s
${CC} -M ${COPTS} ${CFILES} | \
sed -e ':loop' \
-e 's/\.\.\/[^ /]*\/\.\./../' \
-e 't loop' | \
awk ' { if ($$1 != prev) { print rec; rec = $$0; prev = $$1; } \
else { if (length(rec $$2) > 78) { print rec; rec = $$0; } \
else rec = rec " " $$2 } } ; \
END { print rec } ' > makedep
echo '/^# DO NOT DELETE THIS LINE/+1,$$d' >eddep
echo '$$r makedep' >>eddep
echo 'w' >>eddep
cp Makefile Makefile.bak
ex - Makefile < eddep
rm eddep makedep
links:
egrep '#if' ${CFILES} | sed -f ../conf/defines | \
sed -e 's/:.*//' -e 's/\.c/.o/' | sort -u > dontlink
echo ${CFILES} | tr -s ' ' '\12' | sed 's/\.c/.o/' | \
sort -u | comm -23 - dontlink | \
sed 's,../.*/\(.*.o\),rm -f \1;ln -s ../GENERIC/\1 \1,' > makelinks
echo 'rm -f udiv.o;ln -s ../GENERIC/udiv.o udiv.o' >> makelinks
echo 'rm -f urem.o;ln -s ../GENERIC/urem.o urem.o' >> makelinks
sh makelinks && rm -f dontlink
tags:
/usr/ucb/ctags ${CFILES}
print:
@pr -f Makefile ../sys/TODO linterrs
@/usr/ucb/ctags -x ${CFILES} | pr -f -h XREF
@(size vmunix *.o) | pr -f -h sizes
@ls -ls | pr -f
@cd ../h; ls -ls | pr -f ; pr -f *.m *.h
@echo 'once upon a time ...'
@cd ../tahoe; pr -f Locore.c scb.s locore.s
@cd ${INDIR}; make print
@pr -f ${CFILES}
ioconf.o: ioconf.c ../h/param.h ../tahoe/pte.h ../h/buf.h ../h/map.h \
../h/vm.h ../tahoevba/vbavar.h
param.c: ../conf/param.c
-rm -f param.c
cp ../conf/param.c .
param.o: param.c Makefile
${CC} -c ${CFLAGS} ${PARAM} param.c
%RULES
# DO NOT DELETE THIS LINE -- make depend uses it