Makefile revision 1.85
1#	$NetBSD: Makefile,v 1.85 1997/12/18 06:31:33 mikel Exp $
2#	from: @(#)Makefile	8.7 (Berkeley) 5/25/95
3
4TZDIR=		/usr/share/zoneinfo
5LOCALTIME=	US/Pacific
6
7# setting NOOBJ prevents "make obj" from doing anything;
8# an objdir would break the installation stuff below
9NOOBJ=	oobj
10
11# MD Makefile.inc may append MD targets to BIN[123].  Make sure all
12# are empty, to preserve the old semantics of setting them below with "=".
13BIN1=	
14BIN2=
15BIN3=
16
17.if exists(etc.${MACHINE}/Makefile.inc)
18.include "etc.${MACHINE}/Makefile.inc"
19.endif
20
21# -rw-r--r--
22BINOWN= root
23BINGRP= wheel
24BIN1+=	aliases bootptab changelist csh.cshrc csh.login csh.logout daily \
25	daily.conf dm.conf floppytab ftpchroot ftpusers ftpwelcome \
26	gettytab group hosts hosts.lpd inetd.conf ld.so.conf lkm.conf \
27	man.conf monthly monthly.conf mrouted.conf netstart networks \
28	newsyslog.conf phones printcap profile protocols rbootd.conf rc \
29	rc.conf rc.lkm rc.local rc.subr remote rpc security security.conf \
30	services shells syslog.conf weekly weekly.conf etc.${MACHINE}/ttys \
31	etc.${MACHINE}/disktab
32
33# -rw-rw-r--
34BIN2+=	motd
35
36# -rw-------
37BIN3+=	hosts.equiv
38
39NAMEDB=	localhost.rev named.boot root.cache
40PCS=	pcs750.bin
41
42all clean cleandir depend etc includes install lint:
43
44.ifndef DESTDIR
45distribution distrib-dirs snapshot:
46	@echo setenv DESTDIR before doing that!
47	@false
48.else
49distribution: distrib-dirs
50	(cd ..; ${MAKE} includes)
51	(cd ..; ${MAKE} install)
52	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
53	sendmail -bi -oA${DESTDIR}/etc/aliases
54	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
55	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 ${BIN3} ${DESTDIR}/etc
56	${INSTALL} -c -o root -g wheel -m 600 crontab \
57	    ${DESTDIR}/var/cron/tabs/root
58	${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
59	pwd_mkdb -p -d ${DESTDIR}/ ${DESTDIR}/etc/master.passwd
60	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
61	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
62	${INSTALL} -c -o root -g wheel -m 600 minfree \
63	    ${DESTDIR}/var/crash
64	(cd root; \
65		${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
66		    ${DESTDIR}/root/.cshrc; \
67		${INSTALL} -c -o root -g wheel -m 600 dot.klogin \
68		    ${DESTDIR}/root/.klogin; \
69		${INSTALL} -c -o root -g wheel -m 644 dot.login \
70		    ${DESTDIR}/root/.login; \
71		${INSTALL} -c -o root -g wheel -m 644 dot.profile \
72		    ${DESTDIR}/root/.profile; \
73		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
74		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
75		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
76	(cd mtree; ${MAKE} install)
77	(cd namedb; \
78		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
79		    ${DESTDIR}/etc/namedb)
80	/bin/rm -f ${DESTDIR}/etc/localtime
81	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
82	/bin/rm -f ${DESTDIR}/etc/rmt
83	ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt
84	${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
85		${DESTDIR}/etc/dumpdates
86	${INSTALL} -c -o ${BINOWN} -g operator -m 644 /dev/null \
87		${DESTDIR}/etc/skeykeys
88	${INSTALL} -c -o root -g wheel -m 600 /dev/null \
89		${DESTDIR}/var/cron/log
90	${INSTALL} -c -o nobody -g ${BINGRP} -m 664 /dev/null \
91		${DESTDIR}/var/db/locate.database
92	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
93		${DESTDIR}/var/log/authlog
94	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
95		${DESTDIR}/var/log/lastlog
96	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
97		${DESTDIR}/var/log/lpd-errs
98	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
99		${DESTDIR}/var/log/maillog
100	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
101		${DESTDIR}/var/log/messages
102	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
103		${DESTDIR}/var/log/secure
104	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
105		${DESTDIR}/var/log/wtmp
106	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
107		${DESTDIR}/var/log/xferlog
108	${INSTALL} -c -o daemon -g staff -m 664 /dev/null \
109		${DESTDIR}/var/msgs/bounds
110	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
111		${DESTDIR}/var/run/utmp
112	${INSTALL} -c -o games -g games -m 664 /dev/null \
113		${DESTDIR}/var/games/atc_scores
114	${INSTALL} -c -o games -g games -m 664 /dev/null \
115		${DESTDIR}/var/games/battlestar.log
116	${INSTALL} -c -o games -g games -m 664 /dev/null \
117		${DESTDIR}/var/games/cfscores
118	${INSTALL} -c -o games -g games -m 664 /dev/null \
119		${DESTDIR}/var/games/criblog
120	${INSTALL} -c -o games -g games -m 664 /dev/null \
121		${DESTDIR}/var/games/robots_roll
122	${INSTALL} -c -o games -g games -m 664 /dev/null \
123		${DESTDIR}/var/games/rogue.scores
124	${INSTALL} -c -o games -g games -m 664 /dev/null \
125		${DESTDIR}/var/games/saillog
126	${INSTALL} -c -o games -g games -m 664 /dev/null \
127		${DESTDIR}/var/games/snakerawscores
128	${INSTALL} -c -o games -g games -m 664 /dev/null \
129		${DESTDIR}/var/games/snake.log
130	${INSTALL} -c -o games -g games -m 664 /dev/null \
131		${DESTDIR}/var/games/tetris.scores
132	${INSTALL} -c -o games -g games -m 664 /dev/null \
133		${DESTDIR}/var/games/larn/llog12.0
134	${INSTALL} -c -o games -g games -m 664 /dev/null \
135		${DESTDIR}/var/games/larn/lscore12.0
136	${INSTALL} -c -o games -g games -m 664 /dev/null \
137		${DESTDIR}/var/games/larn/playerids
138	(cd etc.${MACHINE}; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
139	    fstab.* ${DESTDIR}/etc)
140	(cd ${DESTDIR}/dev; ./MAKEDEV all)
141	(cd ../usr.bin/mail; ${MAKE} distribution)
142	(cd ../usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
143
144
145distrib-dirs:
146	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}
147	-mtree -def mtree/NetBSD.dist -p ${DESTDIR}/ -u
148	cd ${DESTDIR}; rm -f sys; ln -s usr/src/sys sys
149
150snapshot: distribution snap_pre snap_tar snap_md
151	cd ${DESTDIR}/snapshot && cksum * > CKSUMS
152
153snap_pre:
154	/bin/rm -rf ${DESTDIR}/snapshot
155	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}/snapshot
156
157snap_tar:
158	cd ${DESTDIR} && tar cf - bin | gzip -9 > snapshot/bin.tar.gz
159	cd ${DESTDIR} && tar cf - dev | gzip -9 > snapshot/dev.tar.gz
160	cd ${DESTDIR} && tar cf - .profile .cshrc etc mnt root sys tmp | \
161	    gzip -9 > snapshot/etc.tar.gz
162	cd ${DESTDIR} && tar cf - sbin | gzip -9 > snapshot/sbin.tar.gz
163	cd ${DESTDIR} && tar cf - usr/bin | gzip -9 > snapshot/usr.bin.tar.gz
164	cd ${DESTDIR} && tar cf - usr/games | gzip -9 > \
165	    snapshot/usr.games.tar.gz
166	cd ${DESTDIR} && tar cf - usr/include | gzip -9 > \
167	    snapshot/usr.include.tar.gz
168	cd ${DESTDIR} && tar cf - usr/lib | gzip -9 > snapshot/usr.lib.tar.gz
169	cd ${DESTDIR} && tar cf - usr/libexec | gzip -9 > \
170	    snapshot/usr.libexec.tar.gz
171	cd ${DESTDIR} && tar cf - usr/mdec usr/libdata usr/local usr/src \
172	    usr/obj | gzip -9 > snapshot/usr.misc.tar.gz
173	cd ${DESTDIR} && tar cf - usr/sbin | gzip -9 > snapshot/usr.sbin.tar.gz
174	cd ${DESTDIR} && tar cf - usr/share | gzip -9 > \
175	    snapshot/usr.share.tar.gz
176	cd ${DESTDIR} && tar cf - var | gzip -9 > snapshot/var.tar.gz
177
178snap_md:
179# nothing here -- look in the machine-dependent Makefile.inc
180
181.endif	# DESTDIR check
182
183.include <bsd.prog.mk>
184