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.

176 lines
6.1 KiB

29 years ago
29 years ago
22 years ago
22 years ago
  1. # $OpenBSD: Makefile,v 1.129 2004/10/20 22:12:15 fgsch Exp $
  2. # $NetBSD: Makefile,v 1.59 1996/05/15 21:36:43 jtc Exp $
  3. # @(#)Makefile 5.45.1.1 (Berkeley) 5/6/91
  4. # The ``rm -rf''s used below are safe because rm doesn't follow symbolic
  5. # links.
  6. .include <bsd.own.mk>
  7. USE_GCC3?=No
  8. # Missing: mp.h
  9. FILES= a.out.h ar.h assert.h bitstring.h blf.h bm.h bsd_auth.h cast.h \
  10. cpio.h ctype.h curses.h db.h dbm.h des.h dirent.h disktab.h \
  11. dlfcn.h elf_abi.h err.h fnmatch.h fstab.h fts.h ftw.h getopt.h \
  12. glob.h grp.h ifaddrs.h inttypes.h iso646.h kvm.h langinfo.h \
  13. libgen.h limits.h locale.h login_cap.h malloc.h math.h md4.h \
  14. md5.h memory.h mpool.h ndbm.h netdb.h netgroup.h nlist.h nl_types.h \
  15. ohash.h olf_abi.h paths.h poll.h pwd.h ranlib.h re_comp.h \
  16. readpassphrase.h regex.h resolv.h rmd160.h search.h setjmp.h \
  17. sgtty.h sha1.h sha2.h skipjack.h signal.h stab.h stdbool.h stddef.h \
  18. stdio.h stdlib.h string.h strings.h struct.h sysexits.h tar.h \
  19. time.h ttyent.h tzfile.h unistd.h utime.h utmp.h vis.h
  20. FILES+= link.h link_aout.h link_elf.h
  21. .if (${MACHINE_ARCH} != "vax")
  22. FILES+= ieeefp.h
  23. .endif
  24. MFILES= float.h frame.h
  25. LFILES= errno.h fcntl.h syslog.h termios.h stdarg.h varargs.h
  26. DIRS= arpa protocols rpc rpcsvc
  27. LDIRS= crypto ddb dev isofs miscfs net netatalk netccitt netinet altq \
  28. netinet6 netipx netnatm netns net80211 nfs scsi sys ufs uvm xfs
  29. # Directories with an includes target
  30. RDIRS= ../lib/libpthread ../lib/libcompat ../lib/libcurses \
  31. ../lib/libcurses++ ../lib/libform ../lib/libssl ../lib/libmenu \
  32. ../lib/libocurses ../lib/libossaudio ../lib/libpanel ../lib/librpcsvc \
  33. ../lib/libskey ../lib/libsectok ../lib/libedit ../lib/libpcap \
  34. ../lib/libutil ../lib/libusbhid ../lib/libwrap ../lib/libz \
  35. ../lib/libkeynote ../lib/libevent ../usr.bin/lex \
  36. ../gnu/lib/libreadline ../gnu/usr.sbin/sendmail/libmilter \
  37. ../sys/arch/${MACHINE}
  38. # Places using Makefile that needs a prerequisite target met before includes
  39. PRDIRS=
  40. # Directories with an includes target that use Makefile.bsd-wrapper
  41. WDIRS= ../usr.sbin/httpd ../gnu/usr.bin/binutils
  42. # Places using Makefile.bsd-wrapper that needs a prerequisite target met
  43. # before includes
  44. PWDIRS= ../usr.sbin/httpd ../gnu/usr.bin/binutils
  45. .if ${USE_GCC3:L} == "yes"
  46. WDIRS+= ../gnu/lib/libstdc++ ../gnu/usr.bin/gcc ../gnu/lib/libobjc \
  47. ../gnu/lib/libf2c
  48. PWDIRS+= ../gnu/lib/libstdc++ ../gnu/lib/libf2c
  49. .else
  50. WDIRS+= ../gnu/egcs/libio ../gnu/egcs/libstdc++ \
  51. ../gnu/egcs/libf2c ../gnu/egcs/libobjc ../gnu/egcs/gcc
  52. PWDIRS+= ../gnu/egcs/libf2c
  53. .endif
  54. NOOBJ= noobj
  55. # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
  56. SYS_INCLUDE?= copies
  57. .if ${KERBEROS5:L} == "yes"
  58. RDIRS+= ../lib/libkrb5 ../lib/libgssapi ../lib/libkadm5srv
  59. .endif
  60. prereq:
  61. @for i in ${PRDIRS}; do \
  62. echo preparing in ${.CURDIR}/$$i; \
  63. cd ${.CURDIR}/$$i && ${MAKE} prereq; \
  64. done
  65. @for i in ${PWDIRS}; do \
  66. echo preparing in ${.CURDIR}/$$i; \
  67. cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper prereq; \
  68. done
  69. includes:
  70. @echo installing ${FILES}
  71. @for i in ${FILES}; do \
  72. cmp -s $$i ${DESTDIR}/usr/include/$$i || \
  73. ${INSTALL} ${INSTALL_COPY} -m 444 $$i ${DESTDIR}/usr/include/$$i; \
  74. done
  75. @echo installing ${DIRS}
  76. @for i in ${DIRS}; do \
  77. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  78. ${DESTDIR}/usr/include/$$i; \
  79. cd ${.CURDIR}/$$i && for j in *.[ih]; do \
  80. cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
  81. ${INSTALL} ${INSTALL_COPY} -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
  82. done; \
  83. done
  84. @rm -rf ${DESTDIR}/usr/include/openssl ${DESTDIR}/usr/include/ssl \
  85. ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/ssl \
  86. ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/openssl
  87. @mkdir ${DESTDIR}/usr/include/openssl
  88. @ln -sf openssl ${DESTDIR}/usr/include/ssl
  89. @echo installing ${LFILES}
  90. @for i in ${LFILES}; do \
  91. rm -f ${DESTDIR}/usr/include/$$i && \
  92. ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
  93. done
  94. @echo installing ${MFILES}
  95. @for i in ${MFILES}; do \
  96. rm -f ${DESTDIR}/usr/include/$$i && \
  97. ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
  98. done
  99. chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
  100. find ${DESTDIR}/usr/include -type f | \
  101. xargs chmod a=r
  102. find ${DESTDIR}/usr/include -type d | \
  103. xargs chmod u=rwx,go=rx
  104. @for i in ${RDIRS}; do \
  105. echo installing in ${.CURDIR}/$$i; \
  106. cd ${.CURDIR}/$$i && ${MAKE} includes; \
  107. done
  108. @for i in ${WDIRS}; do \
  109. echo installing in ${.CURDIR}/$$i; \
  110. cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper includes; \
  111. done
  112. copies:
  113. @echo copies: ${LDIRS}
  114. @for i in ${LDIRS}; do \
  115. rm -rf ${DESTDIR}/usr/include/$$i && \
  116. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  117. ${DESTDIR}/usr/include/$$i ; \
  118. done
  119. cd ../sys; \
  120. pax -rw -pa -L \
  121. `find ${LDIRS} -follow -type f -name '*.h' \
  122. '!' -path 'dev/microcode/*' -print` ${DESTDIR}/usr/include
  123. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
  124. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  125. ${DESTDIR}/usr/include/${MACHINE}
  126. pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
  127. ../sys/arch/${MACHINE}/include/*.h \
  128. ${DESTDIR}/usr/include/${MACHINE}
  129. if test ${MACHINE} != ${MACHINE_ARCH} -a \
  130. -d ../sys/arch/${MACHINE_ARCH}/include; then \
  131. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  132. ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
  133. pax -rw -pa -s "|\.\./sys/arch/${MACHINE_ARCH}/include||" \
  134. ../sys/arch/${MACHINE_ARCH}/include/*.h \
  135. ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
  136. fi
  137. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
  138. symlinks:
  139. @echo symlinks: ${LDIRS}
  140. @for i in ${LDIRS}; do \
  141. rm -rf ${DESTDIR}/usr/include/$$i && \
  142. ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
  143. done
  144. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
  145. ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
  146. if test ${MACHINE} != ${MACHINE_ARCH} -a \
  147. -d ../sys/arch/${MACHINE_ARCH}/include ; then \
  148. ln -s /sys/arch/${MACHINE_ARCH}/include \
  149. ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
  150. fi
  151. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
  152. includes: ${SYS_INCLUDE}
  153. .PHONY: prereq includes copies symlink
  154. .include <bsd.prog.mk>