Makefile.am 6.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. ## Process this file with automake to produce Makefile.in.
  2. # Copyright © 1995-2016 Free Software Foundation, Inc.
  3. # Copyright © 2016, 2017 Mathieu Lirzin <mthl@gnu.org>
  4. #
  5. # This file is part of Cuirass.
  6. #
  7. # Cuirass is free software; you can redistribute it and/or modify
  8. # it under the terms of the GNU General Public License as published by
  9. # the Free Software Foundation; either version 3, or (at your option)
  10. # any later version.
  11. #
  12. # Cuirass is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. # GNU General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU General Public License
  18. # along with Cuirass. If not, see <http://www.gnu.org/licenses/>.
  19. bin_SCRIPTS = bin/cuirass bin/evaluate
  20. noinst_SCRIPTS = pre-inst-env
  21. guilesitedir = $(datarootdir)/guile/site/2.0
  22. dist_guilesite_DATA = src/cuirass.scm
  23. nodist_guilesite_DATA = $(dist_guilesite_DATA:.scm=.go)
  24. pkgmoduledir = $(guilesitedir)/$(PACKAGE)
  25. dist_pkgmodule_DATA = \
  26. src/cuirass/base.scm \
  27. src/cuirass/database.scm \
  28. src/cuirass/http.scm \
  29. src/cuirass/repo.scm \
  30. src/cuirass/ui.scm \
  31. src/cuirass/utils.scm
  32. nodist_pkgmodule_DATA = \
  33. $(dist_pkgmodule_DATA:.scm=.go) \
  34. src/cuirass/config.scm \
  35. src/cuirass/config.go
  36. dist_pkgdata_DATA = src/schema.sql
  37. TEST_EXTENSIONS = .scm .sh
  38. AM_TESTS_ENVIRONMENT = \
  39. env GUILE_AUTO_COMPILE='0' \
  40. testsrcdir='$(abs_top_srcdir)/tests' \
  41. testbuilddir='$(abs_top_builddir)/tests'
  42. SCM_LOG_DRIVER = \
  43. $(builddir)/pre-inst-env $(GUILE) \
  44. $(srcdir)/build-aux/test-driver.scm
  45. SH_LOG_COMPILER = $(top_builddir)/pre-inst-env $(SHELL)
  46. AM_SH_LOG_FLAGS = -x -e
  47. TESTS = \
  48. tests/base.scm \
  49. ## tests/basic.sh # takes too long to execute
  50. tests/database.scm \
  51. tests/http.scm \
  52. tests/repo.scm \
  53. tests/ui.scm \
  54. tests/utils.scm
  55. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  56. # $GUILE_LOAD_COMPILED_PATH contains $(pkgmoduledir), we may find .go files in
  57. # there that are newer than the local .scm files (for instance because the
  58. # user ran 'make install' recently). When that happens, we end up loading
  59. # those previously-installed .go files, which may be stale, thereby breaking
  60. # the whole thing. Set GUILE_AUTO_COMPILE to 0 to avoid auto-compiling guild.
  61. #
  62. # XXX: Use the C locale for when Guile lacks
  63. # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
  64. .scm.go:
  65. $(guilec_verbose)$(MKDIR_P) `dirname "$@"`; \
  66. export GUILE_AUTO_COMPILE=0 ; unset GUILE_LOAD_COMPILED_PATH; \
  67. LC_ALL=C \
  68. $(top_builddir)/pre-inst-env $(GUILD) compile \
  69. --load-path="$(top_builddir)/src" \
  70. --load-path="$(top_srcdir)/src" \
  71. --warn=format --warn=unbound-variable --warn=arity-mismatch \
  72. --target="$(host)" --output="$@" "$<" $(devnull_verbose)
  73. CLEANFILES = \
  74. $(nodist_guilesite_DATA) \
  75. $(dist_pkgmodule_DATA:.scm=.go) \
  76. src/cuirass/config.go
  77. .PHONY: sql-check
  78. sql-check: src/schema.sql
  79. @echo "$<"
  80. $(AM_V_at)sqlite3 tmp-$$$.db < $< ; \
  81. rm tmp-$$$.db
  82. ## -------------- ##
  83. ## Distribution. ##
  84. ## -------------- ##
  85. EXTRA_DIST = \
  86. .dir-locals.el \
  87. bin/cuirass.in \
  88. bin/evaluate.in \
  89. bootstrap \
  90. build-aux/guix.scm \
  91. src/cuirass/config.scm.in \
  92. $(TESTS)
  93. dist-hook: gen-ChangeLog
  94. $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
  95. .PHONY: gen-ChangeLog
  96. gen-ChangeLog:
  97. $(AM_V_GEN)if test -d $(srcdir)/.git; then \
  98. log_fix="$(srcdir)/build-aux/git-log-fix"; \
  99. test -e "$$log_fix" \
  100. && amend_git_log="--amend=$$log_fix" \
  101. || amend_git_log=; \
  102. $(top_srcdir)/build-aux/gitlog-to-changelog \
  103. $$amend_git_log > $(distdir)/cl-t && \
  104. { rm -f $(distdir)/ChangeLog && \
  105. mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
  106. fi
  107. ## ----------------- ##
  108. ## Generated files. ##
  109. ## ----------------- ##
  110. # 'AC_CONFIG_FILES' doesn't fully expand variables that depend on ${prefix}.
  111. # To use such variables in source files and scripts while following GNU Coding
  112. # Standards, let 'make' manage their replacement.
  113. # Use config.status to substitute the remainder where a single expansion is
  114. # sufficient. We use a funny notation here to avoid configure substitutions
  115. # in our text.
  116. do_subst = ( $(SED) \
  117. -e "s,@configure_input[@],Generated from $$in. Do not edit by hand.,g" \
  118. -e 's,@datadir[@],$(datadir),g' \
  119. -e 's,@GUILE[@],$(GUILE),g' \
  120. -e 's,@localstatedir[@],$(localstatedir),g' \
  121. -e 's,@PACKAGE_LOAD_COMPILED_PATH[@],$(guilesitedir),g' \
  122. -e 's,@PACKAGE_LOAD_PATH[@],$(guilesitedir),g' \
  123. | $(SHELL) ./config.status --file=- )
  124. # Generic instructions to perform the substitution. Generated files shouldn't
  125. # contain unexpanded '@substitutions@', and should be made read-only, to
  126. # prevent them from being edited by mistake instead of the file they are
  127. # generated from.
  128. generate_file = \
  129. $(AM_V_GEN)rm -f $@ $@-t; \
  130. $(MKDIR_P) $(@D); \
  131. in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t; \
  132. if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' $@-t; then \
  133. echo "$@ contains unexpanded substitution (see lines above)"; \
  134. exit 1; \
  135. fi; \
  136. chmod a-w $@-t; mv -f $@-t $@
  137. # These files depend on Makefile so they are rebuilt if $(VERSION),
  138. # $(datadir) or other do_subst'ituted variables change.
  139. bin/cuirass: $(srcdir)/bin/cuirass.in
  140. bin/evaluate: $(srcdir)/bin/evaluate.in
  141. $(bin_SCRIPTS): Makefile
  142. $(generate_file); chmod +x $@
  143. src/cuirass/config.scm: $(srcdir)/src/cuirass/config.scm.in Makefile
  144. $(generate_file)
  145. # Guile modules require 'src/cuirass/config.scm' to exist before their
  146. # compilation.
  147. BUILT_SOURCES = src/cuirass/config.scm
  148. MOSTLYCLEANFILES = $(bin_SCRIPTS) src/cuirass/config.scm
  149. ## --------------- ##
  150. ## Documentation. ##
  151. ## --------------- ##
  152. info_TEXINFOS = doc/cuirass.texi
  153. doc_cuirass_TEXINFOS = doc/fdl-1.3.texi
  154. # Install the examples.
  155. nobase_dist_pkgdata_DATA = \
  156. examples/gnu-system.scm \
  157. examples/guix-jobs.scm \
  158. examples/hello-singleton.scm \
  159. examples/hello-subset.scm
  160. ## -------------- ##
  161. ## Installation. ##
  162. ## -------------- ##
  163. # Ensure that the scripts will find their module directories.
  164. install-exec-hook:
  165. $(SED) \
  166. -e 's,^#GUILE_LOAD,GUILE_LOAD,g' \
  167. -i $(DESTDIR)$(bindir)/cuirass
  168. ## -------------- ##
  169. ## Silent rules. ##
  170. ## -------------- ##
  171. guilec_verbose = $(guilec_verbose_@AM_V@)
  172. guilec_verbose_ = $(guilec_verbose_@AM_DEFAULT_V@)
  173. guilec_verbose_0 = @echo " GUILEC " $@;
  174. devnull_verbose = $(devnull_verbose_@AM_V@)
  175. devnull_verbose_ = $(devnull_verbose_@AM_DEFAULT_V@)
  176. devnull_verbose_0 = >/dev/null