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.

163 lines
5.2 KiB

28 years ago
5 years ago
8 years ago
8 years ago
22 years ago
  1. # $OpenBSD: Makefile,v 1.225 2019/04/06 02:56:16 jsg 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. FILES= a.out.h ar.h asr.h assert.h \
  8. bitstring.h blf.h bsd_auth.h \
  9. complex.h cpio.h ctype.h curses.h \
  10. db.h dirent.h disktab.h dlfcn.h \
  11. elf.h elf_abi.h err.h errno.h \
  12. fenv.h float.h fnmatch.h fstab.h fts.h ftw.h \
  13. getopt.h glob.h grp.h \
  14. icdb.h ieeefp.h ifaddrs.h inttypes.h iso646.h \
  15. kvm.h \
  16. langinfo.h libgen.h limits.h link.h link_elf.h locale.h login_cap.h \
  17. math.h md5.h memory.h \
  18. ndbm.h netdb.h netgroup.h nlist.h nl_types.h \
  19. paths.h poll.h pthread.h pthread_np.h pwd.h \
  20. ranlib.h readpassphrase.h regex.h resolv.h rmd160.h \
  21. sched.h search.h setjmp.h semaphore.h sha1.h sha2.h \
  22. signal.h siphash.h sndio.h spawn.h stdbool.h stddef.h \
  23. stdio.h stdlib.h string.h strings.h sysexits.h \
  24. tar.h tgmath.h tib.h time.h ttyent.h \
  25. unistd.h utime.h utmp.h uuid.h \
  26. vis.h \
  27. wchar.h wctype.h
  28. MFILES= frame.h
  29. LFILES= endian.h fcntl.h syslog.h termios.h stdarg.h stdint.h varargs.h
  30. DIRS= arpa protocols rpc rpcsvc
  31. LDIRS= crypto ddb dev isofs miscfs msdosfs net netinet netinet6 \
  32. netmpls net80211 nfs ntfs scsi sys ufs uvm
  33. # Places that need a prerequisite target met before includes
  34. PRDIRS= ../lib/libcrypto ../lib/librpcsvc
  35. # Directories with an includes target
  36. RDIRS= ../lib/libcurses ../lib/libedit ../lib/libelf \
  37. ../lib/libevent ../lib/libexpat ../lib/libform \
  38. ../lib/libfuse ../lib/libkeynote ../lib/libmenu \
  39. ../lib/libossaudio ../lib/libpanel ../lib/libpcap \
  40. ../lib/libradius \
  41. ../lib/libskey ../lib/libssl ../lib/libtls \
  42. ../lib/libusbhid ../lib/libutil ../lib/libz \
  43. ../usr.bin/lex ../gnu/lib/libreadline \
  44. ../sys/arch/${MACHINE}
  45. .if ${BUILD_GCC3:L} == "yes"
  46. RDIRS+= ../gnu/usr.bin/gcc
  47. PRDIRS+= ../gnu/lib/libstdc++
  48. .endif
  49. .if ${BUILD_GCC4:L} == "yes"
  50. PRDIRS+= ../gnu/lib/libstdc++-v3 ../gnu/usr.bin/cc/include
  51. .endif
  52. .if ${BUILD_CLANG:L} == "yes"
  53. RDIRS+= ../lib/libcxxabi ../lib/libcxx \
  54. ../gnu/usr.bin/clang/libLLVM
  55. .endif
  56. # prereq implies includes
  57. RDIRS += ${PRDIRS}
  58. NOOBJ= noobj
  59. # Change SYS_INCLUDE in bsd.own.mk to "symlinks" if you don't want copies
  60. SYS_INCLUDE?= copies
  61. RUN_MAKE = if test -f Makefile.bsd-wrapper; then ${MAKE} -f Makefile.bsd-wrapper $@; else ${MAKE} $@; fi
  62. prereq:
  63. @for i in ${PRDIRS}; do \
  64. echo preparing in ${.CURDIR}/$$i; \
  65. cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
  66. done
  67. includes:
  68. @echo installing ${FILES}
  69. @for i in ${FILES}; do \
  70. cmp -s $$i ${DESTDIR}/usr/include/$$i || \
  71. ${INSTALL} ${INSTALL_COPY} -m 444 $$i ${DESTDIR}/usr/include/$$i; \
  72. done
  73. @echo installing ${DIRS}
  74. @for i in ${DIRS}; do \
  75. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  76. ${DESTDIR}/usr/include/$$i; \
  77. cd ${.CURDIR}/$$i && for j in *.[ih]; do \
  78. cmp -s $$j ${DESTDIR}/usr/include/$$i/$$j || \
  79. ${INSTALL} ${INSTALL_COPY} -m 444 $$j ${DESTDIR}/usr/include/$$i/$$j; \
  80. done; \
  81. done
  82. @echo installing ${LFILES}
  83. @for i in ${LFILES}; do \
  84. rm -f ${DESTDIR}/usr/include/$$i && \
  85. ln -s sys/$$i ${DESTDIR}/usr/include/$$i; \
  86. done
  87. @echo installing ${MFILES}
  88. @for i in ${MFILES}; do \
  89. rm -f ${DESTDIR}/usr/include/$$i && \
  90. ln -s machine/$$i ${DESTDIR}/usr/include/$$i; \
  91. done
  92. @for i in ${RDIRS}; do \
  93. echo installing in ${.CURDIR}/$$i; \
  94. cd ${.CURDIR}/$$i && ${RUN_MAKE}; \
  95. done
  96. chown -RP ${BINOWN}:${BINGRP} ${DESTDIR}/usr/include
  97. find ${DESTDIR}/usr/include \
  98. -type f -exec chmod a=r {} + -o \
  99. \( -type d -o -type l \) -exec chmod -h u=rwx,go=rx {} +
  100. copies:
  101. @echo copies: ${LDIRS}
  102. @for i in ${LDIRS}; do \
  103. rm -rf ${DESTDIR}/usr/include/$$i && \
  104. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  105. ${DESTDIR}/usr/include/$$i ; \
  106. done
  107. cd ../sys; \
  108. pax -rw -pa -L \
  109. `find ${LDIRS} -follow -type f -name '*.h' '!' \
  110. '(' -path 'dev/microcode/*' -or -path 'dev/pci/drm/*' ')' \
  111. -print` ${DESTDIR}/usr/include
  112. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
  113. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  114. ${DESTDIR}/usr/include/${MACHINE}
  115. pax -rw -pa -s "|\.\./sys/arch/${MACHINE}/include||" \
  116. ../sys/arch/${MACHINE}/include/*.h \
  117. ${DESTDIR}/usr/include/${MACHINE}
  118. if test ${MACHINE} != ${MACHINE_CPU} -a \
  119. -d ../sys/arch/${MACHINE_CPU}/include; then \
  120. ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} -m 755 \
  121. ${DESTDIR}/usr/include/${MACHINE_CPU}; \
  122. pax -rw -pa -s "|\.\./sys/arch/${MACHINE_CPU}/include||" \
  123. ../sys/arch/${MACHINE_CPU}/include/*.h \
  124. ${DESTDIR}/usr/include/${MACHINE_CPU}; \
  125. fi
  126. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine; \
  127. symlinks:
  128. @echo symlinks: ${LDIRS}
  129. @for i in ${LDIRS}; do \
  130. rm -rf ${DESTDIR}/usr/include/$$i && \
  131. ln -s /sys/$$i ${DESTDIR}/usr/include/$$i; \
  132. done
  133. cd ${DESTDIR}/usr/include && rm -rf ${MACHINE} ${MACHINE_CPU} machine
  134. ln -s /sys/arch/${MACHINE}/include ${DESTDIR}/usr/include/${MACHINE}
  135. if test ${MACHINE} != ${MACHINE_CPU} -a \
  136. -d ../sys/arch/${MACHINE_CPU}/include ; then \
  137. ln -s /sys/arch/${MACHINE_CPU}/include \
  138. ${DESTDIR}/usr/include/${MACHINE_CPU} ; \
  139. fi
  140. ln -sf ${MACHINE} ${DESTDIR}/usr/include/machine
  141. includes: ${SYS_INCLUDE}
  142. .PHONY: prereq includes copies symlink
  143. .include <bsd.prog.mk>