Makefile.am 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  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. # Copyright © 2018 Ludovic Courtès <ludo@gnu.org>
  5. # Copyright © 2018 Clément Lassieur <clement@lassieur.org>
  6. # Copyright © 2018 Tatiana Sholokhova <tanja201396@gmail.com>
  7. # Copyright © 2020 Mathieu Othacehe <othacehe@gnu.org>
  8. #
  9. # This file is part of Cuirass.
  10. #
  11. # Cuirass is free software; you can redistribute it and/or modify
  12. # it under the terms of the GNU General Public License as published by
  13. # the Free Software Foundation; either version 3, or (at your option)
  14. # any later version.
  15. #
  16. # Cuirass is distributed in the hope that it will be useful,
  17. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. # GNU General Public License for more details.
  20. #
  21. # You should have received a copy of the GNU General Public License
  22. # along with Cuirass. If not, see <http://www.gnu.org/licenses/>.
  23. bin_SCRIPTS = \
  24. bin/cuirass
  25. noinst_SCRIPTS = pre-inst-env
  26. guilesitedir = $(datarootdir)/guile/site/@GUILE_EFFECTIVE_VERSION@
  27. guileobjectdir = $(libdir)/guile/@GUILE_EFFECTIVE_VERSION@/site-ccache
  28. dist_guilesite_DATA = src/cuirass.scm
  29. nodist_guileobject_DATA = $(dist_guilesite_DATA:.scm=.go)
  30. pkgmoduledir = $(guilesitedir)/$(PACKAGE)
  31. pkgobjectdir = $(guileobjectdir)/$(PACKAGE)
  32. webmoduledir = $(guilesitedir)/web/server
  33. webobjectdir = $(guileobjectdir)/web/server
  34. scriptsmoduledir = $(guilesitedir)/$(PACKAGE)/scripts
  35. scriptsobjectdir = $(guileobjectdir)/$(PACKAGE)/scripts
  36. sqldir = $(pkgdatadir)/sql
  37. staticdir = $(pkgdatadir)/static
  38. cssdir = $(staticdir)/css
  39. fontsdir = $(staticdir)/fonts
  40. imagesdir = $(staticdir)/images
  41. jsdir = $(staticdir)/js
  42. dist_pkgmodule_DATA = \
  43. src/cuirass/base.scm \
  44. src/cuirass/database.scm \
  45. src/cuirass/http.scm \
  46. src/cuirass/logging.scm \
  47. src/cuirass/mail.scm \
  48. src/cuirass/mastodon.scm \
  49. src/cuirass/metrics.scm \
  50. src/cuirass/notification.scm \
  51. src/cuirass/parameters.scm \
  52. src/cuirass/remote.scm \
  53. src/cuirass/rss.scm \
  54. src/cuirass/specification.scm \
  55. src/cuirass/ui.scm \
  56. src/cuirass/utils.scm \
  57. src/cuirass/templates.scm \
  58. src/cuirass/watchdog.scm \
  59. src/cuirass/zabbix.scm
  60. dist_scriptsmodule_DATA = \
  61. src/cuirass/scripts/evaluate.scm \
  62. src/cuirass/scripts/register.scm \
  63. src/cuirass/scripts/remote-server.scm \
  64. src/cuirass/scripts/remote-worker.scm \
  65. src/cuirass/scripts/web.scm
  66. nodist_pkgmodule_DATA = \
  67. src/cuirass/config.scm
  68. nodist_pkgobject_DATA = \
  69. $(dist_pkgmodule_DATA:.scm=.go) \
  70. src/cuirass/config.go
  71. dist_webmodule_DATA = \
  72. src/web/server/fiberized.scm
  73. nodist_webobject_DATA = \
  74. $(dist_webmodule_DATA:.scm=.go)
  75. dist_pkgdata_DATA = src/schema.sql
  76. dist_sql_DATA = \
  77. src/sql/upgrade-1.sql
  78. dist_css_DATA = \
  79. src/static/css/choices.min.css \
  80. src/static/css/cuirass.css \
  81. src/static/css/bootstrap.css \
  82. src/static/css/datatables.min.css \
  83. src/static/css/open-iconic-bootstrap.css
  84. dist_fonts_DATA = \
  85. src/static/fonts/open-iconic.eot \
  86. src/static/fonts/open-iconic.otf \
  87. src/static/fonts/open-iconic.svg \
  88. src/static/fonts/open-iconic.ttf \
  89. src/static/fonts/open-iconic.woff
  90. dist_images_DATA = \
  91. src/static/images/guix.png \
  92. src/static/images/icon.png
  93. dist_js_DATA = \
  94. src/static/js/chart.js \
  95. src/static/js/choices.min.js \
  96. src/static/js/datatables.min.js \
  97. src/static/js/jquery-3.6.0.min.js
  98. TEST_EXTENSIONS = .scm .sh
  99. AM_TESTS_ENVIRONMENT = \
  100. env GUILE_AUTO_COMPILE='0' \
  101. testsrcdir='$(abs_top_srcdir)/tests' \
  102. testbuilddir='$(abs_top_builddir)/tests'
  103. SCM_LOG_DRIVER = \
  104. $(top_builddir)/pre-inst-env $(GUILE) \
  105. -L "$(abs_top_srcdir)" -e main \
  106. $(top_srcdir)/build-aux/test-driver.scm
  107. SH_LOG_COMPILER = $(top_builddir)/pre-inst-env $(SHELL)
  108. AM_SH_LOG_FLAGS = -x -e
  109. TESTS = \
  110. tests/base.scm \
  111. ## tests/basic.sh # takes too long to execute
  112. tests/database.scm \
  113. tests/http.scm \
  114. tests/metrics.scm \
  115. tests/remote.scm \
  116. tests/utils.scm
  117. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  118. # $GUILE_LOAD_COMPILED_PATH contains $(pkgmoduledir), we may find .go files in
  119. # there that are newer than the local .scm files (for instance because the
  120. # user ran 'make install' recently). When that happens, we end up loading
  121. # those previously-installed .go files, which may be stale, thereby breaking
  122. # the whole thing. Set GUILE_AUTO_COMPILE to 0 to avoid auto-compiling guild.
  123. #
  124. # XXX: Use the C locale for when Guile lacks
  125. # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
  126. .scm.go:
  127. $(guilec_verbose)$(MKDIR_P) `dirname "$@"`; \
  128. export GUILE_AUTO_COMPILE=0 ; unset GUILE_LOAD_COMPILED_PATH; \
  129. LC_ALL=C \
  130. $(top_builddir)/pre-inst-env $(GUILD) compile \
  131. --load-path="$(top_builddir)/src" \
  132. --load-path="$(top_srcdir)/src" \
  133. --warn=format --warn=unbound-variable --warn=arity-mismatch \
  134. --target="$(host)" --output="$@" "$<" $(devnull_verbose)
  135. CLEANFILES = \
  136. $(nodist_guilesite_DATA) \
  137. $(dist_pkgmodule_DATA:.scm=.go) \
  138. $(nodist_webobject_DATA) \
  139. $(nodist_guileobject_DATA) \
  140. src/cuirass/config.go
  141. ## -------------- ##
  142. ## Distribution. ##
  143. ## -------------- ##
  144. EXTRA_DIST = \
  145. .dir-locals.el \
  146. bin/cuirass.in \
  147. bootstrap \
  148. build-aux/guix.scm \
  149. src/cuirass/config.scm.in \
  150. $(TESTS)
  151. dist-hook: gen-ChangeLog
  152. $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
  153. .PHONY: gen-ChangeLog
  154. gen-ChangeLog:
  155. $(AM_V_GEN)if test -d $(srcdir)/.git; then \
  156. log_fix="$(srcdir)/build-aux/git-log-fix"; \
  157. test -e "$$log_fix" \
  158. && amend_git_log="--amend=$$log_fix" \
  159. || amend_git_log=; \
  160. $(top_srcdir)/build-aux/gitlog-to-changelog \
  161. $$amend_git_log > $(distdir)/cl-t && \
  162. { rm -f $(distdir)/ChangeLog && \
  163. mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
  164. fi
  165. ## ----------------- ##
  166. ## Generated files. ##
  167. ## ----------------- ##
  168. # 'AC_CONFIG_FILES' doesn't fully expand variables that depend on ${prefix}.
  169. # To use such variables in source files and scripts while following GNU Coding
  170. # Standards, let 'make' manage their replacement.
  171. # Use config.status to substitute the remainder where a single expansion is
  172. # sufficient. We use a funny notation here to avoid configure substitutions
  173. # in our text.
  174. do_subst = ( $(SED) \
  175. -e "s,@configure_input[@],Generated from $$in. Do not edit by hand.,g" \
  176. -e 's,@datadir[@],$(datadir),g' \
  177. -e 's,@GUILE[@],$(GUILE),g' \
  178. -e 's,@localstatedir[@],$(localstatedir),g' \
  179. -e 's,@PACKAGE_LOAD_COMPILED_PATH[@],$(guileobjectdir),g' \
  180. -e 's,@PACKAGE_LOAD_PATH[@],$(guilesitedir),g' \
  181. | $(SHELL) ./config.status --file=- )
  182. # Generic instructions to perform the substitution. Generated files shouldn't
  183. # contain unexpanded '@substitutions@', and should be made read-only, to
  184. # prevent them from being edited by mistake instead of the file they are
  185. # generated from.
  186. generate_file = \
  187. $(AM_V_GEN)rm -f $@ $@-t; \
  188. $(MKDIR_P) $(@D); \
  189. in=$@.in && $(do_subst) <$(srcdir)/$$in >$@-t; \
  190. if LC_ALL=C grep '@[a-zA-Z0-9_][a-zA-Z0-9_]*@' $@-t; then \
  191. echo "$@ contains unexpanded substitution (see lines above)"; \
  192. exit 1; \
  193. fi; \
  194. chmod a-w $@-t; mv -f $@-t $@
  195. # These files depend on Makefile so they are rebuilt if $(VERSION),
  196. # $(datadir) or other do_subst'ituted variables change.
  197. bin/cuirass: $(srcdir)/bin/cuirass.in
  198. $(bin_SCRIPTS): Makefile
  199. $(generate_file); chmod +x $@
  200. src/cuirass/config.scm: $(srcdir)/src/cuirass/config.scm.in Makefile
  201. $(generate_file)
  202. # Guile modules require 'src/cuirass/config.scm' to exist before their
  203. # compilation.
  204. BUILT_SOURCES = src/cuirass/config.scm
  205. MOSTLYCLEANFILES = $(bin_SCRIPTS) src/cuirass/config.scm
  206. ## --------------- ##
  207. ## Documentation. ##
  208. ## --------------- ##
  209. info_TEXINFOS = doc/cuirass.texi
  210. doc_cuirass_TEXINFOS = doc/fdl-1.3.texi
  211. ## -------------- ##
  212. ## Installation. ##
  213. ## -------------- ##
  214. # Ensure that the scripts will find their module directories.
  215. install-exec-hook:
  216. @find $(DESTDIR)$(bindir) -type f -exec \
  217. $(SED) -i -e 's,^#GUILE_LOAD,GUILE_LOAD,g' {} ';'
  218. ## -------------- ##
  219. ## Silent rules. ##
  220. ## -------------- ##
  221. guilec_verbose = $(guilec_verbose_@AM_V@)
  222. guilec_verbose_ = $(guilec_verbose_@AM_DEFAULT_V@)
  223. guilec_verbose_0 = @echo " GUILEC " $@;
  224. devnull_verbose = $(devnull_verbose_@AM_V@)
  225. devnull_verbose_ = $(devnull_verbose_@AM_DEFAULT_V@)
  226. devnull_verbose_0 = >/dev/null