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.

177 lines
6.1 KiB

29 years ago
29 years ago
19 years ago
19 years ago
22 years ago
22 years ago
  1. # $OpenBSD: Makefile,v 1.140 2007/06/06 20:44:06 deraadt 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 errno.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. wchar.h wctype.h
  21. FILES+= link.h link_aout.h link_elf.h
  22. .if (${MACHINE_ARCH} != "vax")
  23. FILES+= ieeefp.h
  24. .endif
  25. MFILES= float.h frame.h
  26. LFILES= fcntl.h syslog.h termios.h stdarg.h stdint.h varargs.h
  27. DIRS= arpa protocols rpc rpcsvc
  28. LDIRS= crypto ddb dev isofs miscfs net netatalk netinet altq \
  29. netinet6 netnatm net80211 netbt nfs scsi sys ufs uvm xfs
  30. # Directories with an includes target
  31. RDIRS= ../lib/libpthread ../lib/libcompat ../lib/libcurses \
  32. ../lib/libform ../lib/libssl ../lib/libmenu \
  33. ../lib/libocurses ../lib/libossaudio ../lib/libpanel ../lib/librpcsvc \
  34. ../lib/libskey ../lib/libsectok ../lib/libedit ../lib/libpcap \
  35. ../lib/libutil ../lib/libusbhid ../lib/libwrap ../lib/libz \
  36. ../lib/libkeynote ../lib/libevent ../usr.bin/lex \
  37. ../gnu/lib/libreadline ../gnu/usr.sbin/sendmail/libmilter \
  38. ../sys/arch/${MACHINE}
  39. # Places using Makefile that needs a prerequisite target met before includes
  40. PRDIRS=
  41. # Directories with an includes target that use Makefile.bsd-wrapper
  42. WDIRS= ../usr.sbin/httpd ../gnu/usr.bin/binutils
  43. # Places using Makefile.bsd-wrapper that needs a prerequisite target met
  44. # before includes
  45. PWDIRS= ../gnu/usr.bin/binutils
  46. .if ${USE_GCC3:L} == "yes"
  47. WDIRS+= ../gnu/lib/libstdc++ ../gnu/usr.bin/gcc ../gnu/lib/libobjc \
  48. ../gnu/lib/libf2c
  49. PWDIRS+= ../gnu/lib/libstdc++ ../gnu/lib/libf2c
  50. .else
  51. WDIRS+= ../gnu/egcs/libio ../gnu/egcs/libstdc++ \
  52. ../gnu/egcs/libf2c ../gnu/lib/libobjc ../gnu/egcs/gcc
  53. PWDIRS+= ../gnu/egcs/libf2c
  54. .endif
  55. NOOBJ= noobj
  56. # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
  57. SYS_INCLUDE?= copies
  58. .if ${KERBEROS5:L} == "yes"
  59. RDIRS+= ../lib/libkrb5 ../lib/libgssapi ../lib/libkadm5srv
  60. .endif
  61. prereq:
  62. @for i in ${PRDIRS}; do \
  63. echo preparing in ${.CURDIR}/$$i; \
  64. cd ${.CURDIR}/$$i && ${MAKE} prereq; \
  65. done
  66. @for i in ${PWDIRS}; do \
  67. echo preparing in ${.CURDIR}/$$i; \
  68. cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper prereq; \
  69. done
  70. includes:
  71. @echo installing ${FILES}
  72. @for i in ${FILES}; do \
  73. cmp -s $$i ${DESTDIR}/usr/include/$$i || \
  74. ${INSTALL} ${INSTALL_COPY} -m 444 $$i ${DESTDIR}/usr/include/$$i; \
  75. done
  76. @echo installing ${DIRS}
  77. @for i in ${DIRS}; do \
  78. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  79. ${DESTDIR}/usr/include/$$i; \
  80. cd ${.CURDIR}/$$i && for j in *.[ih]; do \
  81. cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
  82. ${INSTALL} ${INSTALL_COPY} -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
  83. done; \
  84. done
  85. @rm -rf ${DESTDIR}/usr/include/openssl ${DESTDIR}/usr/include/ssl \
  86. ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/ssl \
  87. ${DESTDIR}/usr/libdata/perl5/site_perl/${MACHINE_ARCH}-openbsd/openssl
  88. @mkdir ${DESTDIR}/usr/include/openssl
  89. @ln -sf openssl ${DESTDIR}/usr/include/ssl
  90. @echo installing ${LFILES}
  91. @for i in ${LFILES}; do \
  92. rm -f ${DESTDIR}/usr/include/$$i && \
  93. ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
  94. done
  95. @echo installing ${MFILES}
  96. @for i in ${MFILES}; do \
  97. rm -f ${DESTDIR}/usr/include/$$i && \
  98. ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
  99. done
  100. chown -R ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
  101. find ${DESTDIR}/usr/include -type f -print0 | \
  102. xargs -0r chmod a=r
  103. find ${DESTDIR}/usr/include -type d -print0 | \
  104. xargs -0r chmod u=rwx,go=rx
  105. @for i in ${RDIRS}; do \
  106. echo installing in ${.CURDIR}/$$i; \
  107. cd ${.CURDIR}/$$i && ${MAKE} includes; \
  108. done
  109. @for i in ${WDIRS}; do \
  110. echo installing in ${.CURDIR}/$$i; \
  111. cd ${.CURDIR}/$$i && ${MAKE} -f Makefile.bsd-wrapper includes; \
  112. done
  113. copies:
  114. @echo copies: ${LDIRS}
  115. @for i in ${LDIRS}; do \
  116. rm -rf ${DESTDIR}/usr/include/$$i && \
  117. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  118. ${DESTDIR}/usr/include/$$i ; \
  119. done
  120. cd ../sys; \
  121. pax -rw -pa -L \
  122. `find ${LDIRS} -follow -type f -name '*.h' \
  123. '!' -path 'dev/microcode/*' -print` ${DESTDIR}/usr/include
  124. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
  125. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  126. ${DESTDIR}/usr/include/${MACHINE}
  127. pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
  128. ../sys/arch/${MACHINE}/include/*.h \
  129. ${DESTDIR}/usr/include/${MACHINE}
  130. if test ${MACHINE} != ${MACHINE_ARCH} -a \
  131. -d ../sys/arch/${MACHINE_ARCH}/include; then \
  132. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  133. ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
  134. pax -rw -pa -s "|\.\./sys/arch/${MACHINE_ARCH}/include||" \
  135. ../sys/arch/${MACHINE_ARCH}/include/*.h \
  136. ${DESTDIR}/usr/include/${MACHINE_ARCH}; \
  137. fi
  138. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
  139. symlinks:
  140. @echo symlinks: ${LDIRS}
  141. @for i in ${LDIRS}; do \
  142. rm -rf ${DESTDIR}/usr/include/$$i && \
  143. ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
  144. done
  145. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_ARCH} machine
  146. ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
  147. if test ${MACHINE} != ${MACHINE_ARCH} -a \
  148. -d ../sys/arch/${MACHINE_ARCH}/include ; then \
  149. ln -s /sys/arch/${MACHINE_ARCH}/include \
  150. ${DESTDIR}/usr/include/${MACHINE_ARCH} ; \
  151. fi
  152. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
  153. includes: ${SYS_INCLUDE}
  154. .PHONY: prereq includes copies symlink
  155. .include <bsd.prog.mk>