Makefile.am 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253
  1. ## Process this file with automake to produce Makefile.in.
  2. # Copyright © 2003 Dale Mellor <dale_mellor@users.sourceforge.net>
  3. # Copyright © 2015, 2016, 2017, 2018, 2020 Mathieu Lirzin <mthl@gnu.org>
  4. #
  5. # This file is part of GNU Mcron.
  6. #
  7. # GNU Mcron 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 of the License, or
  10. # (at your option) any later version.
  11. #
  12. # GNU Mcron 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 GNU Mcron. If not, see <http://www.gnu.org/licenses/>.
  19. ## ---------- ##
  20. ## Programs. ##
  21. ## ---------- ##
  22. bin_SCRIPTS = bin/mcron
  23. noinst_SCRIPTS =
  24. if MULTI_USER
  25. bin_SCRIPTS += bin/crontab
  26. sbin_SCRIPTS = bin/cron
  27. else
  28. noinst_SCRIPTS += bin/cron bin/crontab
  29. endif
  30. # wrapper to be used in the build environment and for running tests.
  31. noinst_SCRIPTS += pre-inst-env
  32. ## --------------- ##
  33. ## Guile modules. ##
  34. ## --------------- ##
  35. # Root directory used for installing Guile modules.
  36. guilesitedir = $(datarootdir)/guile/site/$(GUILE_EFFECTIVE_VERSION)
  37. # Root directory used for installing Guile compiled modules.
  38. guilesitegodir = $(libdir)/guile/$(GUILE_EFFECTIVE_VERSION)/site-ccache
  39. pkgmoduledir = $(guilesitedir)/$(PACKAGE)
  40. pkgmodule_DATA = src/mcron/config.scm
  41. dist_pkgmodule_DATA = \
  42. src/mcron/base.scm \
  43. src/mcron/environment.scm \
  44. src/mcron/job-specifier.scm \
  45. src/mcron/redirect.scm \
  46. src/mcron/utils.scm \
  47. src/mcron/vixie-specification.scm \
  48. src/mcron/vixie-time.scm
  49. # Alias for 'src/mcron/base.scm' kept for backward compatibility.
  50. dist_pkgmodule_DATA += src/mcron/core.scm
  51. pkgmodulegodir = $(guilesitegodir)/$(PACKAGE)
  52. pkgmodulego_DATA = \
  53. $(dist_pkgmodule_DATA:.scm=.go) \
  54. src/mcron/config.go
  55. pkgscriptdir = $(pkgmoduledir)/scripts
  56. dist_pkgscript_DATA = \
  57. src/mcron/scripts/cron.scm \
  58. src/mcron/scripts/crontab.scm \
  59. src/mcron/scripts/mcron.scm
  60. pkgscriptgodir = $(pkgmodulegodir)/scripts
  61. pkgscriptgo_DATA = $(dist_pkgscript_DATA:.scm=.go)
  62. compiled_modules = \
  63. $(pkgmodulego_DATA) \
  64. $(pkgscriptgo_DATA)
  65. CLEANFILES = $(compiled_modules) bin/crontab bin/cron bin/mcron
  66. DISTCLEANFILES = src/mcron/config.scm
  67. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  68. # $GUILE_LOAD_COMPILED_PATH contains $(pkgmoduledir), we may find .go files
  69. # in there that are newer than the local .scm files (for instance because the
  70. # user ran 'make install' recently). When that happens, we end up loading
  71. # those previously-installed .go files, which may be stale, thereby breaking
  72. # the whole thing. Set GUILE_AUTO_COMPILE to 0 to avoid auto-compiling guild
  73. # as a consequence of the previous hack.
  74. #
  75. # XXX: Use the C locale for when Guile lacks
  76. # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
  77. .scm.go:
  78. $(guilec_verbose)$(MKDIR_P) `dirname "$@"`; \
  79. export GUILE_AUTO_COMPILE=0; unset GUILE_LOAD_COMPILED_PATH; \
  80. LC_ALL=C \
  81. $(top_builddir)/pre-inst-env $(GUILD) compile \
  82. --load-path="$(builddir)/src" \
  83. --load-path="$(srcdir)/src" \
  84. --warn=format --warn=unbound-variable --warn=arity-mismatch \
  85. --target="$(host)" --output="$@" "$<" $(devnull_verbose)
  86. bin/% : src/%.in Makefile
  87. $(AM_V_GEN)$(MKDIR_P) bin ; \
  88. sed -e 's,%PREFIX%,${prefix},g' \
  89. -e 's,%modsrcdir%,${guilesitedir},g' \
  90. -e 's,%modbuilddir%,${guilesitegodir},g' \
  91. -e 's,%localstatedir%,${localstatedir},g' \
  92. -e 's,%pkglibdir%,${pkglibdir},g' \
  93. -e 's,%sysconfdir%,${sysconfdir},g' \
  94. -e 's,%localedir%,${localedir},g' \
  95. -e 's,%VERSION%,@VERSION@,g' \
  96. -e 's,%PACKAGE_BUGREPORT%,@PACKAGE_BUGREPORT@,g' \
  97. -e 's,%PACKAGE_NAME%,@PACKAGE_NAME@,g' \
  98. -e 's,%PACKAGE_URL%,@PACKAGE_URL@,g' \
  99. -e 's,%GUILE%,$(GUILE),g' \
  100. $< > $@ ; \
  101. chmod a+x $@
  102. ## ------------ ##
  103. ## Test suite. ##
  104. ## ------------ ##
  105. TEST_EXTENSIONS = .scm .sh
  106. AM_TESTS_ENVIRONMENT = env GUILE_AUTO_COMPILE='0'
  107. SH_LOG_COMPILER = ./pre-inst-env $(SHELL)
  108. SCM_LOG_DRIVER = \
  109. $(builddir)/pre-inst-env $(GUILE) \
  110. $(srcdir)/build-aux/test-driver.scm
  111. TESTS = \
  112. tests/basic.sh \
  113. tests/schedule.sh \
  114. tests/schedule-2.sh \
  115. tests/base.scm \
  116. tests/environment.scm \
  117. tests/job-specifier.scm \
  118. tests/utils.scm \
  119. tests/vixie-time.scm
  120. ## -------------- ##
  121. ## Distribution. ##
  122. ## -------------- ##
  123. EXTRA_DIST = \
  124. bootstrap \
  125. build-aux/guix.scm \
  126. HACKING \
  127. src/cron.in \
  128. src/crontab.in \
  129. src/mcron.in \
  130. tests/init.sh \
  131. $(TESTS)
  132. ## -------------- ##
  133. ## Installation. ##
  134. ## -------------- ##
  135. # Sed command for Transforming program names.
  136. transform_exe = s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/
  137. install-exec-hook:
  138. if MULTI_USER
  139. tcrontab=`echo crontab | sed '$(transform_exe)'`; \
  140. chmod u+s $(DESTDIR)$(bindir)/$${tcrontab}
  141. tcron=`echo cron | sed '$(transform_exe)'`; \
  142. chmod u+s $(DESTDIR)$(sbindir)/$${tcron}
  143. endif
  144. tmcron=`echo mcron | sed '$(transform_exe)'`;
  145. installcheck-local:
  146. ## Check that only expected programs are installed and configured
  147. tmcron=`echo mcron | sed '$(transform_exe)'`; \
  148. test -e $(DESTDIR)$(bindir)/$${tmcron}
  149. if MULTI_USER
  150. tcrontab=`echo crontab | sed '$(transform_exe)'`; \
  151. test -u $(DESTDIR)$(bindir)/$${tcrontab}
  152. tcron=`echo cron | sed '$(transform_exe)'`; \
  153. test -e $(DESTDIR)$(sbindir)/$${tcron}
  154. else !MULTI_USER
  155. tcrontab=`echo crontab | sed '$(transform_exe)'`; \
  156. test ! -u $(DESTDIR)$(bindir)/$${tcrontab}
  157. tcron=`echo cron | sed '$(transform_exe)'`; \
  158. test ! -f $(DESTDIR)$(sbindir)/$${tcron}
  159. endif !MULTI_USER
  160. ## --------------- ##
  161. ## Documentation. ##
  162. ## --------------- ##
  163. info_TEXINFOS = doc/mcron.texi
  164. doc_mcron_TEXINFOS = doc/fdl.texi
  165. nodist_doc_mcron_TEXINFOS = doc/config.texi
  166. dist_man_MANS = $(srcdir)/doc/mcron.1
  167. extra_mans = \
  168. $(srcdir)/doc/crontab.1 \
  169. $(srcdir)/doc/cron.8
  170. if MULTI_USER
  171. dist_man_MANS += $(extra_mans)
  172. else
  173. # Build, distribute, but do not install the extra man pages.
  174. all-local: $(extra_mans)
  175. EXTRA_DIST += $(extra_mans)
  176. endif
  177. # XXX: Allow the inclusion of 'doc/fdl.texi' and 'doc/config.texi' inside
  178. # 'doc/mcron.texi' for 'dvi' and 'pdf' targets.
  179. TEXI2DVI = texi2dvi -I doc
  180. # The 'case' ensures the man pages are only generated if the corresponding
  181. # source script (the first prerequisite) has been changed. The second
  182. # prerequisites is solely meant to force these docs to be made only after
  183. # executables have been compiled.
  184. gen_man = \
  185. case '$?' in \
  186. *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \
  187. LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \
  188. -s $$man_section -S GNU -p $(PACKAGE_TARNAME) -o $@ $$prog;; \
  189. *) : ;; \
  190. esac
  191. $(srcdir)/doc/mcron.1: src/mcron/scripts/mcron.scm bin/mcron
  192. -@prog="bin/mcron"; man_section=1; $(gen_man)
  193. $(srcdir)/doc/crontab.1: src/mcron/scripts/crontab.scm bin/crontab
  194. -@prog="bin/crontab"; man_section=1; $(gen_man)
  195. $(srcdir)/doc/cron.8: src/mcron/scripts/cron.scm bin/cron
  196. -@prog="cron"; man_section=8; $(gen_man)
  197. MAINTAINERCLEANFILES = $(dist_man_MANS) $(extra_mans)
  198. ## -------------- ##
  199. ## Silent rules. ##
  200. ## -------------- ##
  201. guilec_verbose = $(guilec_verbose_@AM_V@)
  202. guilec_verbose_ = $(guilec_verbose_@AM_DEFAULT_V@)
  203. guilec_verbose_0 = @echo " GUILEC " $@;
  204. devnull_verbose = $(devnull_verbose_@AM_V@)
  205. devnull_verbose_ = $(devnull_verbose_@AM_DEFAULT_V@)
  206. devnull_verbose_0 = >/dev/null
  207. ## ------------- ##
  208. ## Maintenance. ##
  209. ## ------------- ##
  210. @MAINT_MAKEFILE@