1 | # $Id: Makefile,v 1.15 2003-07-24 18:46:23 ghudson Exp $ |
---|
2 | |
---|
3 | SHELL=/bin/sh |
---|
4 | ATHETCDIR=/usr/athena/etc |
---|
5 | ATHLIBDIR=/usr/athena/lib |
---|
6 | UPDATE=${ATHLIBDIR}/update |
---|
7 | CFLAGS=-g |
---|
8 | |
---|
9 | all: fix_owners rvdinfo |
---|
10 | cd os/${OS} && ${MAKE} $@ |
---|
11 | |
---|
12 | fix_owners: fix_owners.o |
---|
13 | ${CC} -o $@ fix_owners.o |
---|
14 | |
---|
15 | rvdinfo: |
---|
16 | version="$$ATHENA_MAJOR_VERSION.$$ATHENA_MINOR_VERSION"; \ |
---|
17 | version="$$version.$$ATHENA_PATCH_VERSION"; \ |
---|
18 | echo "Athena RVD ($$ATHENA_HOSTTYPE) Version $$version `date`" > $@ |
---|
19 | |
---|
20 | check: |
---|
21 | cd os/${OS} && ${MAKE} $@ |
---|
22 | |
---|
23 | # We generate FILES at install time, which is a violation of the normal |
---|
24 | # build system rules. It needs to wait until after everything is put |
---|
25 | # in place on the packs, including the other things we install. |
---|
26 | install: |
---|
27 | @if [ -r ${DESTDIR}/.rvdinfo ]; then \ |
---|
28 | dvers=`sed -e 's/^.* \([0-9]*\.[0-9]*\)\..*/\1/' \ |
---|
29 | ${DESTDIR}/.rvdinfo`; \ |
---|
30 | vers=$$ATHENA_MAJOR_VERSION.$$ATHENA_MINOR_VERSION; \ |
---|
31 | if [ "$$dvers" != "$$vers" ]; then \ |
---|
32 | echo "Error: major or minor version mismatch."; \ |
---|
33 | exit 1; \ |
---|
34 | fi; \ |
---|
35 | fi |
---|
36 | cd os/${OS} && ${MAKE} $@ |
---|
37 | mkdir -p ${DESTDIR}${ATHLIBDIR}/stats |
---|
38 | rm -f ${DESTDIR}/patch |
---|
39 | vers="$$ATHENA_MAJOR_VERSION.$$ATHENA_MINOR_VERSION"; \ |
---|
40 | ln -s /afs/athena.mit.edu/system/patch-$$vers/${ATHENA_SYS} \ |
---|
41 | ${DESTDIR}/patch |
---|
42 | ./fix_owners ${DESTDIR} |
---|
43 | chmod go-w ${DESTDIR} |
---|
44 | ${DESTDIR}${ATHETCDIR}/track -w -F${DESTDIR} -W${DESTDIR}${ATHLIBDIR} \ |
---|
45 | -s stats/sys_rvd slists/sys_rvd |
---|
46 | [ ! -r ${DESTDIR}${ATHLIBDIR}/slists/sys_rvd.big ] || \ |
---|
47 | ${DESTDIR}${ATHETCDIR}/track -w -F${DESTDIR} \ |
---|
48 | -W${DESTDIR}${ATHLIBDIR} \ |
---|
49 | -s stats/sys_rvd.big slists/sys_rvd.big |
---|
50 | chown 0 ${DESTDIR}${ATHLIBDIR}/stats/* |
---|
51 | chgrp 0 ${DESTDIR}${ATHLIBDIR}/stats/* |
---|
52 | (cd ${DESTDIR} && find . -print | sort) > FILES |
---|
53 | install -c -m 444 -o 0 -g 0 FILES ${DESTDIR}${UPDATE}/FILES |
---|
54 | install -c -m 444 -o 0 -g 0 rvdinfo ${DESTDIR}/.rvdinfo |
---|
55 | |
---|
56 | clean: |
---|
57 | rm -f fix_owners.o fix_owners rvdinfo FILES |
---|
58 | cd os/${OS} && ${MAKE} $@ |
---|
59 | |
---|
60 | distclean: |
---|
61 | rm -f fix_owners.o fix_owners rvdinfo FILES |
---|
62 | cd os/${OS} && ${MAKE} $@ |
---|