Makefile 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. # $OpenBSD: Makefile,v 1.76 2015/08/19 17:06:51 naddy Exp $
  2. .if !defined(BSD_OWN_MK)
  3. . include <bsd.own.mk>
  4. .endif
  5. PKGPATH =
  6. MIRROR_MK ?= ${.CURDIR}/distfiles/Makefile
  7. DISTFILES_DB ?= ${.CURDIR}/infrastructure/db/locate.database
  8. .if defined(SUBDIR)
  9. # nothing to do
  10. .elif defined(key) || defined(name) || defined(category) || defined(author)
  11. # set up subdirs from the index, assume it's up-to-date
  12. _CMD = perl ${.CURDIR}/infrastructure/bin/retrieve-index index='${.CURDIR}/INDEX'
  13. . if defined(key)
  14. _CMD += key='${key}'
  15. . endif
  16. . if defined(name)
  17. _CMD += maintainer='${name}'
  18. . endif
  19. . if defined(category)
  20. _CMD += category='${category}'
  21. . endif
  22. . if defined(maintainer)
  23. _CMD += maintainer='${maintainer}'
  24. . endif
  25. SUBDIR != ${_CMD}
  26. .elif defined(SUBDIRLIST)
  27. SUBDIR != sed -e 's,[ ]*\#.*,,' -e '/^[ ]*$$/d' ${SUBDIRLIST}
  28. .else
  29. SUBDIR += archivers
  30. SUBDIR += astro
  31. SUBDIR += audio
  32. SUBDIR += benchmarks
  33. SUBDIR += biology
  34. SUBDIR += books
  35. SUBDIR += cad
  36. SUBDIR += chinese
  37. SUBDIR += comms
  38. SUBDIR += converters
  39. SUBDIR += databases
  40. SUBDIR += devel
  41. SUBDIR += editors
  42. SUBDIR += education
  43. SUBDIR += emulators
  44. SUBDIR += fonts
  45. SUBDIR += games
  46. SUBDIR += geo
  47. SUBDIR += graphics
  48. SUBDIR += inputmethods
  49. SUBDIR += japanese
  50. SUBDIR += java
  51. SUBDIR += korean
  52. SUBDIR += lang
  53. SUBDIR += mail
  54. SUBDIR += math
  55. SUBDIR += meta
  56. SUBDIR += misc
  57. SUBDIR += multimedia
  58. SUBDIR += net
  59. SUBDIR += news
  60. SUBDIR += plan9
  61. SUBDIR += print
  62. SUBDIR += productivity
  63. SUBDIR += security
  64. SUBDIR += shells
  65. SUBDIR += sysutils
  66. SUBDIR += telephony
  67. SUBDIR += textproc
  68. SUBDIR += www
  69. SUBDIR += x11
  70. .endif
  71. .include <bsd.port.subdir.mk>
  72. index:
  73. @rm -f ${.CURDIR}/INDEX
  74. @${_MAKE} USE_CCACHE=No ${.CURDIR}/INDEX
  75. ${.CURDIR}/INDEX:
  76. @echo "Generating INDEX..."
  77. @${_MAKE} describe MACHINE_ARCH=amd64 ARCH=amd64 ECHO_MSG="echo 1>&2" > ${.CURDIR}/INDEX
  78. @echo "Done."
  79. print-index: ${.CURDIR}/INDEX
  80. @awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10); }' < ${.CURDIR}/INDEX
  81. print-licenses: ${.CURDIR}/INDEX
  82. @printf "Port PC PF DC DF Maint\n"
  83. @awk -F\| '{printf("%-40.39s%-3.2s%-3.2s%-3.2s%-3.2s%-25.25s\n",$$2,$$12,$$13,$$14,$$15,$$6);}' < ${.CURDIR}/INDEX
  84. search: ${.CURDIR}/INDEX
  85. .if !defined(key) && !defined(name)
  86. @echo "The search target requires a keyword or name parameter,"
  87. @echo "e.g.: \"make search key=somekeyword\" \"make search name=somename\""
  88. .else
  89. . if defined(key)
  90. @egrep -i -- "${key}" ${.CURDIR}/INDEX | awk -F\| '{ printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }'
  91. . else
  92. @awk -F\| '$$1 ~ /${name}/ { printf("Port:\t%s\nPath:\t%s\nInfo:\t%s\nMaint:\t%s\nIndex:\t%s\nL-deps:\t%s\nB-deps:\t%s\nR-deps:\t%s\nArchs:\t%s\n\n", $$1, $$2, $$4, $$6, $$7, $$8, $$9, $$10, $$11); }' ${.CURDIR}/INDEX
  93. . endif
  94. .endif
  95. homepages.html:
  96. @echo '<html><ul>' >$@
  97. @${_MAKE} homepage-links ECHO_MSG='echo >&2' >>$@
  98. @echo '</ul></html>' >>$@
  99. distfiles-update-locatedb:
  100. @PORTSDIR=${.CURDIR} /bin/sh ${.CURDIR}/infrastructure/fetch/distfiles-update-locatedb ${DISTFILES_DB}
  101. pkglocatedb:
  102. @pkg_mklocatedb -a -d ${.CURDIR}/packages/${MACHINE_ARCH}/all/ \
  103. >${.CURDIR}/packages/${MACHINE_ARCH}/ftp/pkglocatedb
  104. .PHONY: index search distfiles-update-locatedb \
  105. pkglocatedb print-licenses print-index