local.mk 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157
  1. # GNU Guix --- Functional package management for GNU
  2. # Copyright © 2016 Eric Bavier <bavier@member.fsf.org>
  3. # Copyright © 2012, 2013, 2014, 2015, 2016, 2017 Ludovic Courtès <ludo@gnu.org>
  4. # Copyright © 2013 Andreas Enge <andreas@enge.fr>
  5. # Copyright © 2016 Taylan Ulrich Bayırlı/Kammer <taylanbayirli@gmail.com>
  6. # Copyright © 2016 Mathieu Lirzin <mthl@gnu.org>
  7. #
  8. # This file is part of GNU Guix.
  9. #
  10. # GNU Guix is free software; you can redistribute it and/or modify it
  11. # under the terms of the GNU General Public License as published by
  12. # the Free Software Foundation; either version 3 of the License, or (at
  13. # your option) any later version.
  14. #
  15. # GNU Guix is distributed in the hope that it will be useful, but
  16. # WITHOUT ANY WARRANTY; without even the implied warranty of
  17. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  18. # GNU General Public License for more details.
  19. #
  20. # You should have received a copy of the GNU General Public License
  21. # along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
  22. info_TEXINFOS = %D%/guix.texi
  23. DOT_FILES = \
  24. %D%/images/bootstrap-graph.dot \
  25. %D%/images/bootstrap-packages.dot \
  26. %D%/images/coreutils-graph.dot \
  27. %D%/images/coreutils-bag-graph.dot \
  28. %D%/images/service-graph.dot \
  29. %D%/images/shepherd-graph.dot
  30. DOT_VECTOR_GRAPHICS = \
  31. $(DOT_FILES:%.dot=%.eps) \
  32. $(DOT_FILES:%.dot=%.pdf)
  33. EXTRA_DIST += \
  34. %D%/htmlxref.cnf \
  35. %D%/contributing.texi \
  36. %D%/fdl-1.3.texi \
  37. $(DOT_FILES) \
  38. $(DOT_VECTOR_GRAPHICS) \
  39. %D%/images/coreutils-size-map.eps \
  40. %D%/environment-gdb.scm \
  41. %D%/package-hello.scm
  42. OS_CONFIG_EXAMPLES_TEXI = \
  43. %D%/os-config-bare-bones.texi \
  44. %D%/os-config-desktop.texi \
  45. %D%/os-config-lightweight-desktop.texi
  46. # Bundle this file so that makeinfo finds it in out-of-source-tree builds.
  47. BUILT_SOURCES += $(OS_CONFIG_EXAMPLES_TEXI)
  48. EXTRA_DIST += $(OS_CONFIG_EXAMPLES_TEXI)
  49. MAINTAINERCLEANFILES = $(OS_CONFIG_EXAMPLES_TEXI)
  50. %D%/os-config-%.texi: gnu/system/examples/%.tmpl
  51. $(AM_V_GEN)$(MKDIR_P) "`dirname $@`"; \
  52. cp "$<" "$@"
  53. infoimagedir = $(infodir)/images
  54. dist_infoimage_DATA = \
  55. $(DOT_FILES:%.dot=%.png) \
  56. %D%/images/coreutils-size-map.png
  57. # Try hard to obtain an image size and aspect that's reasonable for inclusion
  58. # in an Info or PDF document.
  59. DOT_OPTIONS = \
  60. -Gratio=.9 -Gnodesep=.005 -Granksep=.00005 \
  61. -Nfontsize=9 -Nheight=.1 -Nwidth=.1
  62. .dot.png:
  63. $(AM_V_DOT)$(DOT) -Tpng $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
  64. mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
  65. .dot.pdf:
  66. $(AM_V_DOT)$(DOT) -Tpdf $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
  67. mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
  68. .dot.eps:
  69. $(AM_V_DOT)$(DOT) -Teps $(DOT_OPTIONS) < "$<" > "$(srcdir)/$@.tmp"; \
  70. mv "$(srcdir)/$@.tmp" "$(srcdir)/$@"
  71. .png.eps:
  72. $(AM_V_GEN)convert "$<" "$@-tmp.eps"; \
  73. mv "$@-tmp.eps" "$@"
  74. # We cannot add new dependencies to `%D%/guix.pdf' & co. (info "(automake)
  75. # Extending"). Using the `-local' rules is imperfect, because they may be
  76. # triggered after the main rule. Oh, well.
  77. pdf-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.pdf)
  78. info-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.png)
  79. ps-local: $(DOT_FILES=%.dot=$(top_srcdir)/%.eps) \
  80. $(top_srcdir)/%D%/images/coreutils-size-map.eps
  81. dvi-local: ps-local
  82. ## ----------- ##
  83. ## Man pages. ##
  84. ## ----------- ##
  85. # The man pages are generated using GNU Help2man. In makefiles rules they
  86. # depend not on the binary, but on the source files. This usage allows a
  87. # manual page to be generated by the maintainer and included in the
  88. # distribution without requiring the end-user to have 'help2man' installed.
  89. # They are built in $(srcdir) like info manuals.
  90. sub_commands_mans = \
  91. $(srcdir)/%D%/guix-archive.1 \
  92. $(srcdir)/%D%/guix-build.1 \
  93. $(srcdir)/%D%/guix-challenge.1 \
  94. $(srcdir)/%D%/guix-download.1 \
  95. $(srcdir)/%D%/guix-edit.1 \
  96. $(srcdir)/%D%/guix-environment.1 \
  97. $(srcdir)/%D%/guix-gc.1 \
  98. $(srcdir)/%D%/guix-hash.1 \
  99. $(srcdir)/%D%/guix-import.1 \
  100. $(srcdir)/%D%/guix-lint.1 \
  101. $(srcdir)/%D%/guix-package.1 \
  102. $(srcdir)/%D%/guix-publish.1 \
  103. $(srcdir)/%D%/guix-pull.1 \
  104. $(srcdir)/%D%/guix-refresh.1 \
  105. $(srcdir)/%D%/guix-size.1 \
  106. $(srcdir)/%D%/guix-system.1
  107. dist_man1_MANS = \
  108. $(srcdir)/%D%/guix.1 \
  109. $(sub_commands_mans)
  110. gen_man = \
  111. LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \
  112. $(HELP2MANFLAGS)
  113. HELP2MANFLAGS = --source=GNU --info-page=$(PACKAGE_TARNAME)
  114. $(srcdir)/%D%/guix.1: scripts/guix.in $(sub_commands_mans)
  115. -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
  116. # The 'case' ensures the man pages are only generated if the corresponding
  117. # source script (the first prerequisite) has been changed. The $(GOBJECTS)
  118. # prerequisite is solely meant to force these docs to be made only after all
  119. # Guile modules have been compiled.
  120. $(srcdir)/%D%/guix-%.1: guix/scripts/%.scm $(GOBJECTS)
  121. -@case '$?' in \
  122. *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \
  123. $(gen_man) --output="$@" "guix $*";; \
  124. *) : ;; \
  125. esac
  126. if BUILD_DAEMON
  127. dist_man1_MANS += $(srcdir)/%D%/guix-daemon.1
  128. $(srcdir)/%D%/guix-daemon.1: nix/nix-daemon/guix-daemon.cc
  129. -$(AM_V_HELP2MAN)$(gen_man) --output="$@" `basename "$@" .1`
  130. endif