Source code pulled from OpenBSD for OpenNTPD. The place to contribute to this code is via the OpenBSD CVS tree.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

279 lines
10 KiB

9 years ago
16 years ago
11 years ago
10 years ago
10 years ago
10 years ago
22 years ago
  1. # $OpenBSD: Makefile,v 1.404 2015/07/03 22:05:53 millert Exp $
  2. TZDIR= /usr/share/zoneinfo
  3. LOCALTIME= Canada/Mountain
  4. MTREEDIR= /etc/mtree
  5. NOOBJ=
  6. KERNELS = GENERIC bsd
  7. .if exists(etc.${MACHINE}/Makefile.inc)
  8. .include "etc.${MACHINE}/Makefile.inc"
  9. .endif
  10. .for CONF K in ${KERNELS}
  11. . if !target($K)
  12. $K:
  13. cd ../sys/arch/${MACHINE}/conf && config ${CONF}
  14. cd ../sys/arch/${MACHINE}/compile/${CONF} && \
  15. ${MAKE} clean && exec ${MAKE}
  16. . endif
  17. ALL_KERNELS += $K
  18. .endfor
  19. kernels: bootblocks ${ALL_KERNELS}
  20. .for CONF K in ${KERNELS}
  21. cp ../sys/arch/${MACHINE}/compile/${CONF}/bsd ${RELEASEDIR}/$K
  22. .endfor
  23. # -rw-r--r--
  24. BINOWN= root
  25. BINGRP= wheel
  26. MUTABLE=changelist csh.cshrc csh.login csh.logout daily \
  27. etc.${MACHINE}/disktab etc.${MACHINE}/login.conf ftpusers \
  28. gettytab group ksh.kshrc locate.rc mailer.conf \
  29. moduli monthly netstart networks newsyslog.conf ntpd.conf \
  30. pf.os protocols rc rc.conf rpc services shells syslog.conf weekly
  31. # -rw-r--r--
  32. EXAMPLES=chio.conf dhclient.conf dhcpd.conf exports ftpchroot hosts.lpd \
  33. httpd.conf ifstated.conf inetd.conf \
  34. man.conf mixerctl.conf mrouted.conf \
  35. ntpd.conf printcap rbootd.conf remote sensorsd.conf
  36. .if ${MACHINE} != "aviion"
  37. EXAMPLES+= wsconsctl.conf
  38. .endif
  39. # -rw-------
  40. EXAMPLES_600=bgpd.conf dvmrpd.conf hostapd.conf iked.conf ipsec.conf \
  41. ldapd.conf ldpd.conf ospf6d.conf ospfd.conf pf.conf rc.local \
  42. rc.securelevel rc.shutdown relayd.conf ripd.conf \
  43. sasyncd.conf snmpd.conf ypldap.conf
  44. # -r-xr-xr-x
  45. RCDAEMONS=amd apmd bgpd bootparamd cron dhcpd dhcrelay dvmrpd ftpd ftpproxy \
  46. hostapd hotplugd httpd identd ifstated iked inetd isakmpd iscsid \
  47. ldapd ldattach ldomd ldpd lockd lpd mopd mountd mrouted nfsd \
  48. npppd nsd ntpd ospf6d ospfd pflogd portmap rarpd rbootd relayd \
  49. ripd route6d rtadvd sasyncd sensorsd slowcgi smtpd sndiod \
  50. snmpd spamd spamlogd sshd statd syslogd tftpd tftpproxy unbound \
  51. watchdogd wsmoused xdm ypbind ypldap yppasswdd ypserv
  52. MISETS= base${OSrev}.tgz comp${OSrev}.tgz man${OSrev}.tgz game${OSrev}.tgz
  53. all clean cleandir depend etc install lint:
  54. install-mtree:
  55. ${INSTALL} -c -o root -g wheel -m 600 mtree/special \
  56. ${DESTDIR}${MTREEDIR}
  57. ${INSTALL} -c -o root -g wheel -m 444 mtree/4.4BSD.dist \
  58. ${DESTDIR}${MTREEDIR}
  59. ${INSTALL} -c -o root -g wheel -m 444 mtree/BSD.x11.dist \
  60. ${DESTDIR}${MTREEDIR}
  61. .ifndef DESTDIR
  62. distribution-etc-root-var distribution distrib-dirs release:
  63. @echo setenv DESTDIR before doing that!
  64. @false
  65. .else
  66. distribution-etc-root-var: distrib-dirs
  67. ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${MUTABLE} ${DESTDIR}/etc
  68. sh ttys.pty | cat etc.${MACHINE}/ttys - > ${DESTDIR}/etc/ttys && \
  69. chown ${BINOWN} ${DESTDIR}/etc/ttys && \
  70. chgrp ${BINGRP} ${DESTDIR}/etc/ttys && \
  71. chmod 644 ${DESTDIR}/etc/ttys
  72. cat examples/sysctl.conf etc.${MACHINE}/sysctl.conf > \
  73. ${DESTDIR}/etc/examples/sysctl.conf && \
  74. chown ${BINOWN} ${DESTDIR}/etc/examples/sysctl.conf && \
  75. chgrp ${BINGRP} ${DESTDIR}/etc/examples/sysctl.conf && \
  76. chmod 644 ${DESTDIR}/etc/examples/sysctl.conf
  77. cat fbtab.head etc.${MACHINE}/fbtab fbtab.tail > ${DESTDIR}/etc/fbtab && \
  78. chown ${BINOWN} ${DESTDIR}/etc/fbtab && \
  79. chgrp ${BINGRP} ${DESTDIR}/etc/fbtab && \
  80. chmod 644 ${DESTDIR}/etc/fbtab
  81. ${INSTALL} -c -o ${BINOWN} -g operator -m 664 motd ${DESTDIR}/etc
  82. ${INSTALL} -c -o root -g crontab -m 600 crontab ${DESTDIR}/var/cron/tabs/root
  83. ${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
  84. pwd_mkdb -p -d ${DESTDIR}/etc /etc/master.passwd
  85. ${INSTALL} -c -o root -g wheel -m 600 pf.conf ${DESTDIR}/etc
  86. ${INSTALL} -c -o root -g _nsd -m 640 nsd.conf ${DESTDIR}/var/nsd/etc
  87. ${INSTALL} -c -o root -g wheel -m 644 unbound.conf ${DESTDIR}/var/unbound/etc
  88. ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
  89. etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
  90. cd root; \
  91. ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
  92. ${DESTDIR}/root/.cshrc; \
  93. ${INSTALL} -c -o root -g wheel -m 644 dot.login \
  94. ${DESTDIR}/root/.login; \
  95. ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
  96. ${DESTDIR}/root/.profile; \
  97. ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
  98. ${DESTDIR}/root/.Xdefaults; \
  99. ${INSTALL} -c -o root -g wheel -m 644 dot.cvsrc \
  100. ${DESTDIR}/root/.cvsrc; \
  101. rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
  102. ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
  103. ${DESTDIR}/.cshrc; \
  104. ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
  105. ${DESTDIR}/.profile
  106. cd skel; \
  107. ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
  108. ${DESTDIR}/etc/skel/.cshrc; \
  109. ${INSTALL} -c -o root -g wheel -m 644 dot.login \
  110. ${DESTDIR}/etc/skel/.login; \
  111. ${INSTALL} -c -o root -g wheel -m 644 dot.mailrc \
  112. ${DESTDIR}/etc/skel/.mailrc; \
  113. ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
  114. ${DESTDIR}/etc/skel/.profile; \
  115. ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
  116. ${DESTDIR}/etc/skel/.Xdefaults; \
  117. ${INSTALL} -c -o root -g wheel -m 644 dot.cvsrc \
  118. ${DESTDIR}/etc/skel/.cvsrc; \
  119. ${INSTALL} -c -o root -g wheel -m 600 /dev/null \
  120. ${DESTDIR}/etc/skel/.ssh/authorized_keys
  121. cd amd; \
  122. ${INSTALL} -c -o root -g wheel -m 644 master.sample \
  123. ${DESTDIR}/etc/amd
  124. cd ppp; \
  125. ${INSTALL} -c -o root -g wheel -m 600 chap-secrets \
  126. ${DESTDIR}/etc/ppp; \
  127. ${INSTALL} -c -o root -g wheel -m 600 options \
  128. ${DESTDIR}/etc/ppp; \
  129. ${INSTALL} -c -o root -g wheel -m 600 options.sample \
  130. ${DESTDIR}/etc/ppp; \
  131. ${INSTALL} -c -o root -g wheel -m 600 chatscript.sample \
  132. ${DESTDIR}/etc/ppp; \
  133. ${INSTALL} -c -o root -g wheel -m 600 pap-secrets \
  134. ${DESTDIR}/etc/ppp
  135. cd examples; \
  136. ${INSTALL} -c -o root -g wheel -m 644 ${EXAMPLES} \
  137. ${DESTDIR}/etc/examples; \
  138. ${INSTALL} -c -o root -g wheel -m 600 ${EXAMPLES_600} \
  139. ${DESTDIR}/etc/examples; \
  140. chgrp operator ${DESTDIR}/etc/examples/chio.conf
  141. cd signify; \
  142. ${INSTALL} -c -o root -g wheel -m 644 *.pub \
  143. ${DESTDIR}/etc/signify
  144. cd systrace; \
  145. ${INSTALL} -c -o root -g wheel -m 600 usr_sbin_lpd \
  146. ${DESTDIR}/etc/systrace; \
  147. ln -fs ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
  148. ln -fs /usr/sbin/rmt ${DESTDIR}/etc/rmt
  149. ${INSTALL} -c -o root -g wheel -m 644 minfree \
  150. ${DESTDIR}/var/crash
  151. ${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
  152. ${DESTDIR}/etc/dumpdates
  153. ${INSTALL} -c -o root -g crontab -m 660 /dev/null \
  154. ${DESTDIR}/var/cron/at.deny
  155. ${INSTALL} -c -o root -g crontab -m 660 /dev/null \
  156. ${DESTDIR}/var/cron/cron.deny
  157. ${INSTALL} -c -o root -g wheel -m 600 /dev/null \
  158. ${DESTDIR}/var/cron/log
  159. ${INSTALL} -c -o root -g wheel -m 444 /dev/null \
  160. ${DESTDIR}/var/db/locate.database
  161. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  162. ${DESTDIR}/var/log/authlog
  163. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  164. ${DESTDIR}/var/log/daemon
  165. ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
  166. ${DESTDIR}/var/log/failedlogin
  167. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  168. ${DESTDIR}/var/log/ftpd
  169. ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
  170. ${DESTDIR}/var/log/lastlog
  171. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  172. ${DESTDIR}/var/log/lpd-errs
  173. ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
  174. ${DESTDIR}/var/log/maillog
  175. ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
  176. ${DESTDIR}/var/log/messages
  177. ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
  178. ${DESTDIR}/var/log/secure
  179. ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
  180. ${DESTDIR}/var/log/wtmp
  181. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  182. ${DESTDIR}/var/log/xferlog
  183. cd ../usr.sbin/ypserv/ypinit && exec ${MAKE} distribution
  184. cd ../usr.bin/ssh && exec ${MAKE} distribution
  185. cd ../lib/libcrypto && exec ${MAKE} distribution
  186. cd ../usr.bin/bgplg && exec ${MAKE} distribution
  187. cd ../usr.bin/mail && exec ${MAKE} distribution
  188. cd ../usr.sbin/ldapd && exec ${MAKE} distribution
  189. cd ../usr.sbin/npppd && exec ${MAKE} distribution
  190. cd mail && exec ${MAKE} distribution
  191. ${INSTALL} -c -o root -g wheel -m 600 root/root.mail \
  192. ${DESTDIR}/var/mail/root
  193. cd rc.d; \
  194. ${INSTALL} -c -o root -g wheel -m 644 rc.subr \
  195. ${DESTDIR}/etc/rc.d && \
  196. ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 ${RCDAEMONS} \
  197. ${DESTDIR}/etc/rc.d
  198. cd ${DESTDIR}/var; ln -fs ../tmp
  199. touch ${DESTDIR}/usr/share/sysmerge/etcsum
  200. touch ${DESTDIR}/usr/share/sysmerge/examplessum
  201. cd ${DESTDIR}/ && \
  202. sort ${.CURDIR}/../distrib/sets/lists/etc/{mi,md.${MACHINE}} | \
  203. xargs sha256 -h ${DESTDIR}/usr/share/sysmerge/etcsum || true
  204. cd ${DESTDIR}/ && \
  205. grep -h '/etc/examples/' \
  206. ${.CURDIR}/../distrib/sets/lists/base/{mi,md.${MACHINE}} | \
  207. sort | \
  208. xargs sha256 -h ${DESTDIR}/usr/share/sysmerge/examplessum || true
  209. cd ${DESTDIR}/ && \
  210. sort ${.CURDIR}/../distrib/sets/lists/etc/{mi,md.${MACHINE}} | \
  211. pax -w -d | gzip -9 > ${DESTDIR}/usr/share/sysmerge/etc.tgz
  212. distribution:
  213. exec ${SUDO} ${MAKE} distribution-etc-root-var
  214. cd .. && exec ${SUDO} ${MAKE} install
  215. distrib-dirs:
  216. if [ ! -d ${DESTDIR}/. ]; then \
  217. ${INSTALL} -d -o root -g wheel -m 755 ${DESTDIR}; \
  218. fi
  219. mtree -qdef mtree/4.4BSD.dist -p ${DESTDIR}/ -U
  220. if [ ! -d ${DESTDIR}/usr/src ]; then \
  221. ${INSTALL} -d -o root -g wsrc -m 775 ${DESTDIR}/usr/src; \
  222. fi
  223. cd ${DESTDIR}/; ln -fhs usr/src/sys sys
  224. .ifndef RELEASEDIR
  225. release:
  226. @echo setenv RELEASEDIR before building a release.
  227. @false
  228. .else
  229. release-sets:
  230. cd ${RELEASEDIR} && rm -f SHA256
  231. cd ../distrib/sets && exec ${SUDO} sh maketars ${OSrev}
  232. sha:
  233. -cd ${RELEASEDIR}; \
  234. cksum -a sha256 INSTALL.`arch -ks` \
  235. ${ALL_KERNELS} ${MDEXT} ${MISETS} | sort > SHA256
  236. release: sha
  237. sha: distrib
  238. distrib: release-sets kernels
  239. release-sets: distribution kernels
  240. .endif
  241. .endif # DESTDIR check
  242. distrib:
  243. cd ../distrib && \
  244. ${MAKE} && exec ${SUDO} ${MAKE} install
  245. .PHONY: distribution-etc-root-var distribution distrib-dirs \
  246. release allarchs kernels release-sets m4 install-mtree \
  247. bootblocks ${ALL_KERNELS}
  248. SUBDIR+= etc.alpha etc.amd64 etc.armish etc.armv7 etc.aviion
  249. SUBDIR+= etc.hppa etc.hppa64 etc.i386 etc.landisk etc.loongson etc.luna88k
  250. SUBDIR+= etc.macppc etc.octeon
  251. SUBDIR+= etc.sgi etc.socppc etc.sparc etc.sparc64 etc.vax etc.zaurus
  252. .include <bsd.subdir.mk>
  253. .include <bsd.prog.mk>