Makefile.am 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198
  1. ## Process this file with automake to produce Makefile.in
  2. # Copyright (C) 2000-2012 Free Software Foundation, Inc.
  3. # Copyright (C) 2020 Maxime Devos
  4. #
  5. # Author (GnuTLS): Nikos Mavrogiannopoulos
  6. # Author (rehash): Maxime Devos
  7. #
  8. # This file is part of GnuTLS.
  9. #
  10. # rehash 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. # rehash 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 rehash. If not, see <http://www.gnu.org/licenses/>.
  22. # This file is partially based upon guile/Makefile.am in GnuTLS.
  23. ACLOCAL_AMFLAGS = -I m4
  24. AM_CPPFLAGS = -I$(top_srcdir)/include
  25. SUFFIXES = .scm .go .html .pdf .ps
  26. libexec_PROGRAMS = \
  27. rehash-service
  28. rehash_service_CFLAGS = $(GNUNETUTIL_CFLAGS) $(GNUNETDATASTORE_CFLAGS) \
  29. $(GNUNETDHT_CFLAGS) -I$(top_srcdir)/include
  30. rehash_service_LDFLAGS = $(GNUNETUTIL_LDFLAGS) $(GNUNETDATASTORE_LDFLAGS) \
  31. $(GNUNETDHT_LDFLAGS) -no-undefined
  32. rehash_service_LDADD = $(GNUNETUTIL_LIBS) $(GNUNETDATASTORE_LIBS) \
  33. $(GNUNETDHT_LIBS) librehash.la
  34. rehash_service_SOURCES = c-code/rehash-service.c c
  35. # that's lib-rehash, not libre-hash
  36. lib_LTLIBRARIES = librehash.la
  37. # gnunet headers depend on libextractor headers
  38. librehash_la_CFLAGS = $(GNUNETUTIL_CFLAGS) $(EXTRACTOR_CFLAGS)
  39. librehash_la_LDFLAGS = $(GNUNETUTIL_LDFLAGS) -no-undefined
  40. librehash_la_LIBADD = $(GNUNETUTIL_LIBS)
  41. librehash_la_SOURCES = c-code/rehash-api.c \
  42. c-code/rehash_dht.c \
  43. c-code/rehash-crypto-from-data.c \
  44. c-code/rehash-crypto-to-data.c \
  45. c-code/rehash-crypto-from-hash.c
  46. scheme-tests/nonetconf.conf: scheme-tests/nonetconf.conf.in
  47. $(SED) -e 's,[@]rehash_binary@,$(abs_builddir)/rehash-service,g' \
  48. "$<" > "$@.tmp" && mv "$@.tmp" "$@"
  49. %.scm: %.scmguix
  50. $(SED) -e 's/guix /remirror /g' "$<" > "$@.tmp" \
  51. && mv "$@.tmp" "$@"
  52. # Scheme code
  53. modules_rehash = \
  54. scheme-binding/rehash/binding-utils.scm \
  55. scheme-binding/rehash/common.scm \
  56. scheme-binding/rehash/configuration.scm \
  57. scheme-binding/rehash/fibers.scm \
  58. scheme-binding/rehash/fs.scm \
  59. scheme-binding/rehash/operations.scm
  60. modules_remirror = \
  61. scheme-binding/remirror/recognise-hash-uri.scm \
  62. scheme-binding/remirror/snakeoil.scm
  63. # Not used at runtime
  64. # scheme-binding/remirror/embed-file.scm
  65. modules_rehash_generated = \
  66. scheme-binding/rehash/config.scm
  67. modules_remirror_generated = \
  68. scheme-binding/remirror/base16.scm \
  69. scheme-binding/remirror/base32.scm
  70. modules_toplevel = \
  71. scheme-binding/rehash.scm
  72. # Install Scheme source code
  73. if HAVE_GUILE
  74. guilesiterehashdir = $(guilesitedir)/rehash
  75. guilesiteremirrordir = $(guilesitedir)/remirror
  76. # rehash
  77. nodist_guilesiterehash_DATA = $(modules_rehash_generated)
  78. dist_guilesiterehash_DATA = $(modules_rehash) scheme-binding/rehash/config.scm.in
  79. # remirror
  80. nodist_guilesiteremirror_DATA = $(modules_remirror_generated)
  81. dist_guilesiteremirror_DATA = $(modules_remirror) \
  82. scheme-binding/remirror/base16.scmguix \
  83. scheme-binding/remirror/base32.scmguix
  84. endif
  85. # Scheme code compilation
  86. if HAVE_GUILD
  87. guilesiteccache_rehashdir = $(guilesiteccachedir)/rehash
  88. guilesiteccache_remirrordir = $(guilesiteccachedir)/remirror
  89. nodist_guilesiteccache_DATA = $(modules_toplevel:%.scm=%.go)
  90. # rehash
  91. nodist_guilesiteccache_rehash_DATA = \
  92. $(modules_rehash:%.scm=%.go) \
  93. scheme-binding/rehash/config.go
  94. # remirror
  95. nodist_guilesiteccache_remirror_DATA = \
  96. $(modules_remirror:%.scm=%.go) \
  97. $(modules_remirror_generated:%.scm=%.go)
  98. # Unset 'GUILE_LOAD_COMPILED_PATH' so we can be sure that any .go file that we
  99. # load comes from the build directory.
  100. # XXX: Use the C locale for when Guile lacks
  101. # <https://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
  102. %.go: %.scm
  103. $(AM_V_GUILEC)$(MKDIR_P) "`dirname "$@"`" ; \
  104. $(AM_V_P) && out=1 || out=- ; \
  105. unset GUILE_LOAD_COMPILED_PATH ; LC_ALL=C \
  106. builddir="$(top_builddir)" \
  107. GUILE_AUTO_COMPILE=0 \
  108. $(GUILD) compile --target="$(host)" \
  109. -L "$(top_builddir)/scheme-binding" \
  110. -L "$(top_srcdir)/scheme-binding" \
  111. -Wformat -Wunbound-variable -Warity-mismatch \
  112. -o "$@" "$<" >&$$out
  113. # Dependency information
  114. # TODO generate automatically
  115. include dependencies.make
  116. endif
  117. TEST_EXTENSIONS = .scm
  118. TESTS =
  119. # Scheme tests
  120. # FIXME ./pre-inst-env & ./test-env
  121. if HAVE_GUILE
  122. SCM_LOG_DRIVER = \
  123. $(GUILE) -L $(top_srcdir)/scheme-binding \
  124. -L $(top_srcdir)/scheme-tests \
  125. -L $(top_srcdir) \
  126. -e main $(top_srcdir)/build-aux/test-driver.scm
  127. SCM_TESTS = \
  128. scheme-tests/operation-store.scm \
  129. scheme-tests/recognise-url.scm
  130. SCM_TESTS_ENVIRONMENT = \
  131. GUILE_AUTO_COMPILE=0
  132. GUILE_WARN_DEPRECATED=detailed
  133. TESTS += $(SCM_TESTS)
  134. endif
  135. # Snakeoil certificates
  136. snakeoil-cert.pem: snakeoil-key.pem snakeoil-templ
  137. certtool --no-text -s --template="$(top_srcdir)/snakeoil-templ" \
  138. --load-privkey="$<" --seed=deadbeef --outfile="$@.tmp" && \
  139. mv -T "$@.tmp" "$@"
  140. snakeoil-key.pem:
  141. certtool --no-text -p --seed=deadbeef --outfile="$@.tmp" && \
  142. mv -T "$@.tmp" "$@"
  143. # Documentation
  144. nodist_html_DATA = doc/rehash.html
  145. nodist_pdf_DATA = doc/rehash.pdf
  146. nodist_ps_DATA = doc/rehash.ps
  147. # TODO proper dependency information
  148. # TODO headless texmacs
  149. # TODO package relevant package for xvfb-run in Guix
  150. # FIXME why does setting the geometry not work?
  151. XVFB_RUN =
  152. TEXMACS = texmacs
  153. TEXMACS_CMD = $(XVFB_RUN) $(TEXMACS) -g 1x1 -b "$(top_srcdir)/build-aux/do-nothing.scm"
  154. %.html: %.tm
  155. $(MKDIR_P) "`dirname "$@"`" && \
  156. $(TEXMACS_CMD) -c "$<" "$@" -q
  157. %.pdf: %.tm
  158. $(MKDIR_P) "`dirname "$@"`" && \
  159. $(TEXMACS_CMD) -c "$<" "$@" -q
  160. %.ps: %.tm
  161. $(MKDIR_P) "`dirname "$@"`" && \
  162. $(TEXMACS_CMD) -c "$<" "$@" -q
  163. html-local: doc/rehash.html
  164. pdf-local: doc/rehash.pdf
  165. ps-local: doc/rehash.ps
  166. install-html-local: install-nodist_htmlDATA
  167. install-pdf-local: install-nodist_pdfDATA
  168. install-ps-local: install-nodist_psDATA