xref: /netbsd-src/etc/Makefile (revision 037708cbd4616ccd0d7d0381ebd3964d6696c188)
1#	$NetBSD: Makefile,v 1.69 1997/04/02 05:23:49 perry 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.if exists(etc.${MACHINE}/Makefile.inc)
12.include "etc.${MACHINE}/Makefile.inc"
13.endif
14
15# -rw-r--r--
16BINOWN= root
17BINGRP= wheel
18BIN1=	aliases bootptab changelist csh.cshrc csh.login csh.logout daily \
19	daily.conf dm.conf floppytab ftpchroot ftpusers ftpwelcome \
20	gettytab group hosts hosts.equiv hosts.lpd inetd.conf lkm.conf \
21	man.conf monthly monthly.conf mrouted.conf myname netstart networks \
22	newsyslog.conf phones printcap protocols rbootd.conf rc rc.conf \
23	rc.lkm rc.local remote rpc security security.conf services shells \
24	syslog.conf weekly weekly.conf etc.${MACHINE}/ttys \
25	etc.${MACHINE}/disktab
26
27# -rw-rw-r--
28BIN2=	motd
29
30NAMEDB=	localhost.rev named.boot root.cache
31PCS=	pcs750.bin
32
33all clean cleandir depend etc includes install lint:
34
35.ifndef DESTDIR
36distribution distrib-dirs snapshot:
37	@echo setenv DESTDIR before doing that!
38	@false
39.else
40distribution: distrib-dirs
41	(cd ..; ${MAKE} includes)
42	(cd ..; ${MAKE} install)
43	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${BIN1} ${DESTDIR}/etc
44	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 ${BIN2} ${DESTDIR}/etc
45	${INSTALL} -c -o root -g wheel -m 600 crontab \
46	    ${DESTDIR}/var/cron/tabs/root
47	${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
48	pwd_mkdb -p -d ${DESTDIR}/ ${DESTDIR}/etc/master.passwd
49	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
50	     MAKEDEV.local etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
51	(cd root; \
52		${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
53		    ${DESTDIR}/root/.cshrc; \
54		${INSTALL} -c -o root -g wheel -m 600 dot.klogin \
55		    ${DESTDIR}/root/.klogin; \
56		${INSTALL} -c -o root -g wheel -m 644 dot.login \
57		    ${DESTDIR}/root/.login; \
58		${INSTALL} -c -o root -g wheel -m 644 dot.profile \
59		    ${DESTDIR}/root/.profile; \
60		rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
61		ln ${DESTDIR}/root/.cshrc ${DESTDIR}/.cshrc; \
62		ln ${DESTDIR}/root/.profile ${DESTDIR}/.profile)
63	(cd mtree; \
64		${INSTALL} -c -o root -g wheel -m 600 special \
65		    ${DESTDIR}/etc/mtree; \
66		${INSTALL} -c -o root -g wheel -m 444 NetBSD.dist \
67		    ${DESTDIR}/etc/mtree)
68	(cd namedb; \
69		${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${NAMEDB} \
70		    ${DESTDIR}/etc/namedb)
71	/bin/rm -f ${DESTDIR}/etc/localtime
72	ln -s ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
73	/bin/rm -f ${DESTDIR}/etc/rmt
74	ln -s /usr/sbin/rmt ${DESTDIR}/etc/rmt
75	${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
76		${DESTDIR}/etc/dumpdates
77	${INSTALL} -c -o ${BINOWN} -g operator -m 644 /dev/null \
78		${DESTDIR}/etc/skeykeys
79	${INSTALL} -c -o root -g wheel -m 600 /dev/null \
80		${DESTDIR}/var/cron/log
81	${INSTALL} -c -o nobody -g ${BINGRP} -m 664 /dev/null \
82		${DESTDIR}/var/db/locate.database
83	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
84		${DESTDIR}/var/log/authlog
85	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
86		${DESTDIR}/var/log/lastlog
87	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 640 /dev/null \
88		${DESTDIR}/var/log/lpd-errs
89	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
90		${DESTDIR}/var/log/maillog
91	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
92		${DESTDIR}/var/log/messages
93	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
94		${DESTDIR}/var/log/secure
95	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 /dev/null \
96		${DESTDIR}/var/log/wtmp
97	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 600 /dev/null \
98		${DESTDIR}/var/log/xferlog
99	${INSTALL} -c -o daemon -g staff -m 664 /dev/null \
100		${DESTDIR}/var/msgs/bounds
101	${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 664 /dev/null \
102		${DESTDIR}/var/run/utmp
103	(cd etc.${MACHINE}; ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 444 \
104	    fstab.* ${DESTDIR}/etc)
105	(cd ${DESTDIR}/dev; ./MAKEDEV all)
106	(cd ../usr.bin/mail; ${MAKE} distribution)
107	(cd ../usr.sbin/sendmail/cf/cf; ${MAKE} distribution)
108
109
110distrib-dirs:
111	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}
112	-mtree -def mtree/NetBSD.dist -p ${DESTDIR}/ -u
113	cd ${DESTDIR}; rm -f sys; ln -s usr/src/sys sys
114
115snapshot: distribution snap_pre snap_tar snap_md
116	cd ${DESTDIR}/snapshot && cksum * > CKSUMS
117
118snap_pre:
119	/bin/rm -rf ${DESTDIR}/snapshot
120	${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}/snapshot
121
122snap_tar:
123	cd ${DESTDIR} && tar cf - bin | gzip -9 > snapshot/bin.tar.gz
124	cd ${DESTDIR} && tar cf - dev | gzip -9 > snapshot/dev.tar.gz
125	cd ${DESTDIR} && tar cf - .profile .cshrc etc mnt root sys tmp | \
126	    gzip -9 > snapshot/etc.tar.gz
127	cd ${DESTDIR} && tar cf - sbin | gzip -9 > snapshot/sbin.tar.gz
128	cd ${DESTDIR} && tar cf - usr/bin | gzip -9 > snapshot/usr.bin.tar.gz
129	cd ${DESTDIR} && tar cf - usr/games | gzip -9 > \
130	    snapshot/usr.games.tar.gz
131	cd ${DESTDIR} && tar cf - usr/include | gzip -9 > \
132	    snapshot/usr.include.tar.gz
133	cd ${DESTDIR} && tar cf - usr/lib | gzip -9 > snapshot/usr.lib.tar.gz
134	cd ${DESTDIR} && tar cf - usr/libexec | gzip -9 > \
135	    snapshot/usr.libexec.tar.gz
136	cd ${DESTDIR} && tar cf - usr/mdec usr/libdata usr/local usr/src \
137	    usr/obj | gzip -9 > snapshot/usr.misc.tar.gz
138	cd ${DESTDIR} && tar cf - usr/sbin | gzip -9 > snapshot/usr.sbin.tar.gz
139	cd ${DESTDIR} && tar cf - usr/share | gzip -9 > \
140	    snapshot/usr.share.tar.gz
141	cd ${DESTDIR} && tar cf - var | gzip -9 > snapshot/var.tar.gz
142
143snap_md:
144# nothing here -- look in the machine-dependent Makefile.inc
145
146.endif	# DESTDIR check
147
148.include <bsd.prog.mk>
149