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.

182 lines
6.1 KiB

28 years ago
28 years ago
22 years ago
22 years ago
  1. # $OpenBSD: Makefile,v 1.125 2004/03/08 23:31:51 drahn 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 netiso netnatm netns 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 \
  36. ../usr.bin/lex ../gnu/lib/libreadline \
  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
  42. .if ${MACHINE_ARCH} != "arm"
  43. WDIRS+= ../gnu/usr.bin/binutils
  44. .endif
  45. # Places using Makefile.bsd-wrapper that needs a prerequisite target met
  46. # before includes
  47. PWDIRS= ../usr.sbin/httpd
  48. .if ${MACHINE_ARCH} != "arm"
  49. PWDIRS+= ../gnu/usr.bin/binutils
  50. .endif
  51. .if ${USE_GCC3:L} == "yes"
  52. WDIRS+= ../gnu/lib/libstdc++ ../gnu/usr.bin/gcc ../gnu/lib/libobjc \
  53. ../gnu/lib/libf2c
  54. PWDIRS+= ../gnu/lib/libstdc++ ../gnu/lib/libf2c
  55. .else
  56. WDIRS+= ../gnu/egcs/libio ../gnu/egcs/libstdc++ \
  57. ../gnu/egcs/libf2c ../gnu/egcs/libobjc ../gnu/egcs/gcc
  58. PWDIRS+= ../gnu/egcs/libf2c
  59. .endif
  60. NOOBJ= noobj
  61. # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
  62. SYS_INCLUDE?= copies
  63. .if ${KERBEROS5:L} == "yes"
  64. RDIRS+= ../lib/libkrb5 ../lib/libgssapi ../lib/libkadm5srv
  65. .endif
  66. prereq:
  67. @for i in ${PRDIRS}; do \
  68. echo preparing in ${.CURDIR}/$$i; \
  69. cd ${.CURDIR}/$$i && ${MAKE} prereq; \
  70. done
  71. @for i in ${PWDIRS}; do \
  72. echo preparing in ${.CURDIR}/$$i; \
  73. cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper prereq; \
  74. done
  75. includes:
  76. @echo installing ${FILES}
  77. @for i in ${FILES}; do \
  78. cmp -s $$i ${DESTDIR}/usr/include/$$i || \
  79. ${INSTALL} ${INSTALL_COPY} -m 444 $$i ${DESTDIR}/usr/include/$$i; \
  80. done
  81. @echo installing ${DIRS}
  82. @for i in ${DIRS}; do \
  83. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  84. ${DESTDIR}/usr/include/$$i; \
  85. cd ${.CURDIR}/$$i && for j in *.[ih]; do \
  86. cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
  87. ${INSTALL} ${INSTALL_COPY} -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
  88. done; \
  89. done
  90. @rm -rf ${DESTDIR}/usr/include/openssl ${DESTDIR}/usr/include/ssl \
  91. ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/ssl \
  92. ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/openssl
  93. @mkdir ${DESTDIR}/usr/include/openssl
  94. @ln -sf openssl ${DESTDIR}/usr/include/ssl
  95. @echo installing ${LFILES}
  96. @for i in ${LFILES}; do \
  97. rm -f ${DESTDIR}/usr/include/$$i && \
  98. ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
  99. done
  100. @echo installing ${MFILES}
  101. @for i in ${MFILES}; do \
  102. rm -f ${DESTDIR}/usr/include/$$i && \
  103. ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
  104. done
  105. chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
  106. find ${DESTDIR}/usr/include -type f | \
  107. xargs chmod a=r
  108. find ${DESTDIR}/usr/include -type d | \
  109. xargs chmod u=rwx,go=rx
  110. @for i in ${RDIRS}; do \
  111. echo installing in ${.CURDIR}/$$i; \
  112. cd ${.CURDIR}/$$i && ${MAKE} includes; \
  113. done
  114. @for i in ${WDIRS}; do \
  115. echo installing in ${.CURDIR}/$$i; \
  116. cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper includes; \
  117. done
  118. copies:
  119. @echo copies: ${LDIRS}
  120. @for i in ${LDIRS}; do \
  121. rm -rf ${DESTDIR}/usr/include/$$i && \
  122. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  123. ${DESTDIR}/usr/include/$$i ; \
  124. done
  125. cd ../sys; \
  126. pax -rw -pa -L \
  127. `find ${LDIRS} -follow -type f -name '*.h' \
  128. '!' -path 'dev/microcode/*' -print` ${DESTDIR}/usr/include
  129. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
  130. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  131. ${DESTDIR}/usr/include/${MACHINE}
  132. pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
  133. ../sys/arch/${MACHINE}/include/*.h \
  134. ${DESTDIR}/usr/include/${MACHINE}
  135. if test ${MACHINE} != ${MACHINE_ARCH} -a \
  136. -d ../sys/arch/${MACHINE_ARCH}/include; then \
  137. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  138. ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
  139. pax -rw -pa -s "|\.\./sys/arch/${MACHINE_ARCH}/include||" \
  140. ../sys/arch/${MACHINE_ARCH}/include/*.h \
  141. ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
  142. fi
  143. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
  144. symlinks:
  145. @echo symlinks: ${LDIRS}
  146. @for i in ${LDIRS}; do \
  147. rm -rf ${DESTDIR}/usr/include/$$i && \
  148. ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
  149. done
  150. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
  151. ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
  152. if test ${MACHINE} != ${MACHINE_ARCH} -a \
  153. -d ../sys/arch/${MACHINE_ARCH}/include ; then \
  154. ln -s /sys/arch/${MACHINE_ARCH}/include \
  155. ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
  156. fi
  157. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
  158. includes: ${SYS_INCLUDE}
  159. .PHONY: prereq includes copies symlink
  160. .include <bsd.prog.mk>