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.

280 lines
10 KiB

16 years ago
11 years ago
10 years ago
22 years ago
  1. # $OpenBSD: Makefile,v 1.421 2016/03/09 16:28:46 deraadt 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 \
  33. httpd.conf ifstated.conf inetd.conf \
  34. man.conf mixerctl.conf mrouted.conf \
  35. ntpd.conf pkg.conf printcap rbootd.conf \
  36. remote sensorsd.conf wsconsctl.conf
  37. # -rw-------
  38. EXAMPLES_600=bgpd.conf dvmrpd.conf eigrpd.conf hostapd.conf iked.conf \
  39. ipsec.conf ldapd.conf ldpd.conf ospf6d.conf ospfd.conf pf.conf \
  40. radiusd.conf rc.local rc.securelevel rc.shutdown relayd.conf \
  41. ripd.conf sasyncd.conf snmpd.conf vm.conf ypldap.conf
  42. # -r-xr-xr-x
  43. RCDAEMONS=amd apmd bgpd bootparamd cron dhcpd dhcrelay dvmrpd eigrpd ftpd \
  44. ftpproxy ftpproxy6 hostapd hotplugd httpd identd ifstated \
  45. iked inetd isakmpd iscsid ldapd ldattach ldomd ldpd lockd \
  46. lpd mopd mountd mrouted nfsd npppd nsd ntpd ospf6d ospfd \
  47. pflogd portmap radiusd rarpd rbootd rebound relayd ripd route6d \
  48. rtadvd sasyncd sensorsd slowcgi smtpd sndiod snmpd spamd \
  49. spamlogd sshd statd syslogd tftpd tftpproxy unbound \
  50. vmd watchdogd wsmoused xdm ypbind ypldap ypserv
  51. MISETS= base${OSrev}.tgz comp${OSrev}.tgz man${OSrev}.tgz game${OSrev}.tgz
  52. all clean cleandir depend etc install lint:
  53. install-mtree:
  54. ${INSTALL} -c -o root -g wheel -m 600 mtree/special \
  55. ${DESTDIR}${MTREEDIR}
  56. ${INSTALL} -c -o root -g wheel -m 444 mtree/4.4BSD.dist \
  57. ${DESTDIR}${MTREEDIR}
  58. ${INSTALL} -c -o root -g wheel -m 444 mtree/BSD.x11.dist \
  59. ${DESTDIR}${MTREEDIR}
  60. .ifndef DESTDIR
  61. distribution-etc-root-var distribution distrib-dirs release:
  62. @echo setenv DESTDIR before doing that!
  63. @false
  64. .else
  65. distribution-etc-root-var: distrib-dirs
  66. ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 644 ${MUTABLE} ${DESTDIR}/etc
  67. sh ttys.pty | cat etc.${MACHINE}/ttys - > ${DESTDIR}/etc/ttys && \
  68. chown ${BINOWN} ${DESTDIR}/etc/ttys && \
  69. chgrp ${BINGRP} ${DESTDIR}/etc/ttys && \
  70. chmod 644 ${DESTDIR}/etc/ttys
  71. cat examples/sysctl.conf etc.${MACHINE}/sysctl.conf > \
  72. ${DESTDIR}/etc/examples/sysctl.conf && \
  73. chown ${BINOWN} ${DESTDIR}/etc/examples/sysctl.conf && \
  74. chgrp ${BINGRP} ${DESTDIR}/etc/examples/sysctl.conf && \
  75. chmod 644 ${DESTDIR}/etc/examples/sysctl.conf
  76. cat fbtab.head etc.${MACHINE}/fbtab fbtab.tail > ${DESTDIR}/etc/fbtab && \
  77. chown ${BINOWN} ${DESTDIR}/etc/fbtab && \
  78. chgrp ${BINGRP} ${DESTDIR}/etc/fbtab && \
  79. chmod 644 ${DESTDIR}/etc/fbtab
  80. ${INSTALL} -c -o ${BINOWN} -g operator -m 664 motd ${DESTDIR}/etc
  81. ${INSTALL} -c -o root -g crontab -m 600 crontab ${DESTDIR}/var/cron/tabs/root
  82. ${INSTALL} -c -o root -g wheel -m 600 master.passwd ${DESTDIR}/etc
  83. pwd_mkdb -p -d ${DESTDIR}/etc /etc/master.passwd
  84. ${INSTALL} -c -o root -g wheel -m 600 pf.conf ${DESTDIR}/etc
  85. ${INSTALL} -c -o root -g _nsd -m 640 nsd.conf ${DESTDIR}/var/nsd/etc
  86. ${INSTALL} -c -o root -g wheel -m 644 unbound.conf ${DESTDIR}/var/unbound/etc
  87. ${INSTALL} -c -o ${BINOWN} -g ${BINGRP} -m 555 \
  88. etc.${MACHINE}/MAKEDEV ${DESTDIR}/dev
  89. cd root; \
  90. ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
  91. ${DESTDIR}/root/.cshrc; \
  92. ${INSTALL} -c -o root -g wheel -m 644 dot.login \
  93. ${DESTDIR}/root/.login; \
  94. ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
  95. ${DESTDIR}/root/.profile; \
  96. ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
  97. ${DESTDIR}/root/.Xdefaults; \
  98. ${INSTALL} -c -o root -g wheel -m 644 dot.cvsrc \
  99. ${DESTDIR}/root/.cvsrc; \
  100. rm -f ${DESTDIR}/.cshrc ${DESTDIR}/.profile; \
  101. ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
  102. ${DESTDIR}/.cshrc; \
  103. ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
  104. ${DESTDIR}/.profile
  105. cd skel; \
  106. ${INSTALL} -c -o root -g wheel -m 644 dot.cshrc \
  107. ${DESTDIR}/etc/skel/.cshrc; \
  108. ${INSTALL} -c -o root -g wheel -m 644 dot.login \
  109. ${DESTDIR}/etc/skel/.login; \
  110. ${INSTALL} -c -o root -g wheel -m 644 dot.mailrc \
  111. ${DESTDIR}/etc/skel/.mailrc; \
  112. ${INSTALL} -c -o root -g wheel -m 644 dot.profile \
  113. ${DESTDIR}/etc/skel/.profile; \
  114. ${INSTALL} -c -o root -g wheel -m 644 dot.Xdefaults \
  115. ${DESTDIR}/etc/skel/.Xdefaults; \
  116. ${INSTALL} -c -o root -g wheel -m 644 dot.cvsrc \
  117. ${DESTDIR}/etc/skel/.cvsrc; \
  118. ${INSTALL} -c -o root -g wheel -m 600 /dev/null \
  119. ${DESTDIR}/etc/skel/.ssh/authorized_keys
  120. cd amd; \
  121. ${INSTALL} -c -o root -g wheel -m 644 master.sample \
  122. ${DESTDIR}/etc/amd
  123. cd ppp; \
  124. ${INSTALL} -c -o root -g wheel -m 600 chap-secrets \
  125. ${DESTDIR}/etc/ppp; \
  126. ${INSTALL} -c -o root -g wheel -m 600 options \
  127. ${DESTDIR}/etc/ppp; \
  128. ${INSTALL} -c -o root -g wheel -m 600 options.sample \
  129. ${DESTDIR}/etc/ppp; \
  130. ${INSTALL} -c -o root -g wheel -m 600 chatscript.sample \
  131. ${DESTDIR}/etc/ppp; \
  132. ${INSTALL} -c -o root -g wheel -m 600 pap-secrets \
  133. ${DESTDIR}/etc/ppp
  134. cd examples; \
  135. ${INSTALL} -c -o root -g wheel -m 644 ${EXAMPLES} \
  136. ${DESTDIR}/etc/examples; \
  137. ${INSTALL} -c -o root -g wheel -m 600 ${EXAMPLES_600} \
  138. ${DESTDIR}/etc/examples; \
  139. chgrp operator ${DESTDIR}/etc/examples/chio.conf
  140. cd signify; \
  141. ${INSTALL} -c -o root -g wheel -m 644 *.pub \
  142. ${DESTDIR}/etc/signify
  143. cd systrace; \
  144. ${INSTALL} -c -o root -g wheel -m 600 usr_sbin_lpd \
  145. ${DESTDIR}/etc/systrace; \
  146. ln -fs ${TZDIR}/${LOCALTIME} ${DESTDIR}/etc/localtime
  147. ln -fs /usr/sbin/rmt ${DESTDIR}/etc/rmt
  148. ${INSTALL} -c -o root -g wheel -m 644 minfree \
  149. ${DESTDIR}/var/crash
  150. ${INSTALL} -c -o ${BINOWN} -g operator -m 664 /dev/null \
  151. ${DESTDIR}/etc/dumpdates
  152. ${INSTALL} -c -o root -g crontab -m 660 /dev/null \
  153. ${DESTDIR}/var/cron/at.deny
  154. ${INSTALL} -c -o root -g crontab -m 660 /dev/null \
  155. ${DESTDIR}/var/cron/cron.deny
  156. ${INSTALL} -c -o root -g wheel -m 600 /dev/null \
  157. ${DESTDIR}/var/cron/log
  158. ${INSTALL} -c -o root -g wheel -m 444 /dev/null \
  159. ${DESTDIR}/var/db/locate.database
  160. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  161. ${DESTDIR}/var/log/authlog
  162. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  163. ${DESTDIR}/var/log/daemon
  164. ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
  165. ${DESTDIR}/var/log/failedlogin
  166. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  167. ${DESTDIR}/var/log/ftpd
  168. ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
  169. ${DESTDIR}/var/log/lastlog
  170. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  171. ${DESTDIR}/var/log/lpd-errs
  172. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  173. ${DESTDIR}/var/log/maillog
  174. ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
  175. ${DESTDIR}/var/log/messages
  176. ${INSTALL} -c -o ${BINOWN} -g wheel -m 600 /dev/null \
  177. ${DESTDIR}/var/log/secure
  178. ${INSTALL} -c -o ${BINOWN} -g wheel -m 644 /dev/null \
  179. ${DESTDIR}/var/log/wtmp
  180. ${INSTALL} -c -o ${BINOWN} -g wheel -m 640 /dev/null \
  181. ${DESTDIR}/var/log/xferlog
  182. cd ../usr.sbin/ypserv/ypinit && exec ${MAKE} distribution
  183. cd ../usr.bin/ssh && exec ${MAKE} distribution
  184. cd ../lib/libcrypto && exec ${MAKE} distribution
  185. cd ../usr.bin/bgplg && exec ${MAKE} distribution
  186. cd ../usr.bin/mail && exec ${MAKE} distribution
  187. cd ../usr.sbin/ikectl && 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}/var/sysmerge/etcsum
  200. touch ${DESTDIR}/var/sysmerge/examplessum
  201. cd ${DESTDIR}/ && \
  202. sort ${.CURDIR}/../distrib/sets/lists/etc/{mi,md.${MACHINE}} | \
  203. xargs sha256 -h ${DESTDIR}/var/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}/var/sysmerge/examplessum || true
  209. cd ${DESTDIR}/ && \
  210. sort ${.CURDIR}/../distrib/sets/lists/etc/{mi,md.${MACHINE}} | \
  211. pax -w -d | gzip -9 > ${DESTDIR}/var/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. date -u "+Build date: %s - %+" > BUILDINFO; \
  235. cksum -a sha256 BUILDINFO INSTALL.`arch -ks` \
  236. ${ALL_KERNELS} ${MDEXT} ${MISETS} | sort > SHA256
  237. release: sha
  238. sha: distrib
  239. distrib: release-sets kernels
  240. release-sets: distribution kernels
  241. .endif
  242. .endif # DESTDIR check
  243. distrib:
  244. cd ../distrib && \
  245. ${MAKE} && exec ${SUDO} ${MAKE} install
  246. .PHONY: distribution-etc-root-var distribution distrib-dirs \
  247. release allarchs kernels release-sets m4 install-mtree \
  248. bootblocks ${ALL_KERNELS}
  249. SUBDIR+= etc.alpha etc.amd64 etc.armish etc.armv7
  250. SUBDIR+= etc.hppa etc.hppa64 etc.i386 etc.landisk etc.loongson etc.luna88k
  251. SUBDIR+= etc.macppc etc.octeon
  252. SUBDIR+= etc.sgi etc.socppc etc.sparc etc.sparc64 etc.zaurus
  253. .include <bsd.subdir.mk>
  254. .include <bsd.prog.mk>