Makefile.am 6.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. ## Process this file with automake to produce Makefile.in.
  2. # Copyright © 2003 Dale Mellor <dale_mellor@users.sourceforge.net>
  3. # Copyright © 2015, 2016 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. bin_PROGRAMS = bin/mcron bin/crontab
  20. sbin_PROGRAMS = bin/cron
  21. AM_CPPFLAGS = -DPACKAGE_LOAD_PATH=\"$(moduledir)\"
  22. AM_CFLAGS = @GUILE_CFLAGS@
  23. LDADD = @GUILE_LIBS@
  24. bin_mcron_SOURCES = src/wrapper.c
  25. bin_mcron_CPPFLAGS = $(AM_CPPFLAGS) -DPROGRAM="\"mcron\""
  26. bin_mcron_DEPENDENCIES = $(modules:.scm=.go)
  27. bin_cron_SOURCES = src/wrapper.c
  28. bin_cron_CPPFLAGS = $(AM_CPPFLAGS) -DPROGRAM="\"cron\""
  29. bin_cron_DEPENDENCIES = $(modules:.scm=.go)
  30. bin_crontab_SOURCES = src/wrapper.c
  31. bin_crontab_CPPFLAGS = $(AM_CPPFLAGS) -DPROGRAM="\"crontab\""
  32. bin_crontab_DEPENDENCIES = $(modules:.scm=.go)
  33. dist_mcronmodule_DATA = \
  34. src/mcron/base.scm \
  35. src/mcron/environment.scm \
  36. src/mcron/job-specifier.scm \
  37. src/mcron/redirect.scm \
  38. src/mcron/utils.scm \
  39. src/mcron/vixie-specification.scm \
  40. src/mcron/vixie-time.scm
  41. mcronmodule_DATA = \
  42. $(dist_mcronmodule_DATA:.scm=.go) \
  43. src/mcron/config.scm \
  44. src/mcron/config.go
  45. mcronscriptdir = $(mcronmoduledir)/scripts
  46. dist_mcronscript_DATA = \
  47. src/mcron/scripts/cron.scm \
  48. src/mcron/scripts/crontab.scm \
  49. src/mcron/scripts/mcron.scm
  50. mcronscript_DATA = $(dist_mcronscript_DATA:.scm=.go)
  51. modules = \
  52. $(dist_mcronmodule_DATA) \
  53. $(dist_mcronscript_DATA) \
  54. src/mcron/config.scm
  55. TEST_EXTENSIONS = .scm
  56. AM_TESTS_ENVIRONMENT = env GUILE_AUTO_COMPILE='0'
  57. SCM_LOG_DRIVER = \
  58. $(builddir)/pre-inst-env $(GUILE) \
  59. $(srcdir)/build-aux/test-driver.scm
  60. TESTS = \
  61. tests/environment.scm \
  62. tests/job-specifier.scm
  63. # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if
  64. # $GUILE_LOAD_COMPILED_PATH contains $(mcronmoduledir), we may find .go files
  65. # in there that are newer than the local .scm files (for instance because the
  66. # user ran 'make install' recently). When that happens, we end up loading
  67. # those previously-installed .go files, which may be stale, thereby breaking
  68. # the whole thing. Set GUILE_AUTO_COMPILE to 0 to avoid auto-compiling guild
  69. # as a consequence of the previous hack.
  70. #
  71. # XXX: Use the C locale for when Guile lacks
  72. # <http://git.sv.gnu.org/cgit/guile.git/commit/?h=stable-2.0&id=e2c6bf3866d1186c60bacfbd4fe5037087ee5e3f>.
  73. .scm.go:
  74. $(guilec_verbose)$(MKDIR_P) `dirname "$@"` ; \
  75. export GUILE_AUTO_COMPILE=0 ; unset GUILE_LOAD_COMPILED_PATH ; \
  76. LC_ALL=C \
  77. $(top_builddir)/pre-inst-env $(GUILD) compile \
  78. --load-path="$(top_builddir)/src" \
  79. --load-path="$(top_srcdir)/src" \
  80. --warn=format --warn=unbound-variable --warn=arity-mismatch \
  81. --target="$(host)" --output="$@" "$<" $(devnull_verbose)
  82. SUFFIXES = .go
  83. noinst_SCRIPTS = pre-inst-env
  84. BUILT_SOURCES= .version
  85. .version:
  86. $(AM_V_GEN)echo $(VERSION) > $@-t && mv $@-t $@
  87. dist-hook: gen-ChangeLog
  88. $(AM_V_GEN)echo $(VERSION) > $(distdir)/.tarball-version
  89. gen_start_date = 2015-06-26
  90. .PHONY: gen-ChangeLog
  91. gen-ChangeLog:
  92. $(AM_V_GEN)if test -d $(srcdir)/.git; then \
  93. log_fix="$(srcdir)/build-aux/git-log-fix"; \
  94. test -e "$$log_fix" \
  95. && amend_git_log="--amend=$$log_fix" \
  96. || amend_git_log=; \
  97. $(top_srcdir)/build-aux/gitlog-to-changelog \
  98. $$amend_git_log --since=$(gen_start_date) > $(distdir)/cl-t && \
  99. { rm -f $(distdir)/ChangeLog && \
  100. mv $(distdir)/cl-t $(distdir)/ChangeLog; } \
  101. fi
  102. #full program prefix
  103. fpp = $(DESTDIR)$(bindir)/@real_program_prefix@
  104. install-exec-hook:
  105. @if [ "x@NO_VIXIE_CLOBBER@" != "xyes" -a "`id -u`" -eq "0" ]; then \
  106. rm -f $(fpp)cron$(EXEEXT) > /dev/null 2>&1; \
  107. $(INSTALL) --mode='u=rwx' mcron$(EXEEXT) $(fpp)cron$(EXEEXT); \
  108. rm -f $(fpp)crontab$(EXEEXT) > /dev/null 2>&1; \
  109. $(INSTALL) --mode='u=rwxs,og=rx' mcron$(EXEEXT) $(fpp)crontab$(EXEEXT); \
  110. $(INSTALL) -d --mode='u=rwx' $(DESTDIR)/var/cron; \
  111. $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)/var/run; \
  112. $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)@GUILE_SITE@; \
  113. $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)@GUILE_SITE@/mcron; \
  114. elif [ "x@NO_VIXIE_CLOBBER@" = "xyes" ]; then \
  115. echo "Not installing Vixie-style programs"; \
  116. else \
  117. echo "+++ WARNING: NON-ROOT INSTALL: ONLY mcron WILL BE INSTALLED, NOT ANY OF THE VIXIE REPLACEMENT PROGRAMS"; \
  118. fi
  119. uninstall-hook:
  120. if [ "`id -u`" -eq "0" ]; then \
  121. rm -f $(fpp){cron,crontab}$(EXEEXT); \
  122. fi
  123. EXTRA_DIST = \
  124. build-aux/guix.scm \
  125. .version \
  126. $(TESTS)
  127. MAINTAINERCLEANFILES = $(dist_man_MANS)
  128. DISTCLEANFILES = src/config.scm
  129. CLEANFILES = \
  130. $(modules:.scm=.go) \
  131. src/mcron/config.go
  132. ## --------------- ##
  133. ## Documentation. ##
  134. ## --------------- ##
  135. info_TEXINFOS = doc/mcron.texi
  136. doc_mcron_TEXINFOS = doc/fdl.texi
  137. nodist_doc_mcron_TEXINFOS = doc/config.texi
  138. dist_man_MANS = \
  139. $(srcdir)/doc/mcron.1 \
  140. $(srcdir)/doc/crontab.1 \
  141. $(srcdir)/doc/cron.8
  142. # XXX: Allow the inclusion of 'doc/fdl.texi' and 'doc/config.texi' inside
  143. # 'doc/mcron.texi' for 'dvi' and 'pdf' targets.
  144. TEXI2DVI = texi2dvi -I doc
  145. # The 'case' ensures the man pages are only generated if the corresponding
  146. # source script (the first prerequisite) has been changed. The second
  147. # prerequisites is solely meant to force these docs to be made only after
  148. # executables have been compiled.
  149. gen_man = \
  150. case '$?' in \
  151. *$<*) $(AM_V_P) && set -x || echo " HELP2MAN $@"; \
  152. LANGUAGE= $(top_builddir)/pre-inst-env $(HELP2MAN) \
  153. -s $$man_section -S GNU -p $(PACKAGE_TARNAME) -o $@ $$prog;; \
  154. *) : ;; \
  155. esac
  156. $(srcdir)/doc/mcron.1: src/mcron/scripts/mcron.scm bin/mcron
  157. -@prog="mcron"; man_section=1; $(gen_man)
  158. $(srcdir)/doc/crontab.1: src/mcron/scripts/crontab.scm bin/crontab
  159. -@prog="crontab"; man_section=1; $(gen_man)
  160. $(srcdir)/doc/cron.8: src/mcron/scripts/cron.scm bin/cron
  161. -@prog="cron"; man_section=8; $(gen_man)
  162. ## -------------- ##
  163. ## Silent rules. ##
  164. ## -------------- ##
  165. guilec_verbose = $(guilec_verbose_@AM_V@)
  166. guilec_verbose_ = $(guilec_verbose_@AM_DEFAULT_V@)
  167. guilec_verbose_0 = @echo " GUILEC " $@;
  168. devnull_verbose = $(devnull_verbose_@AM_V@)
  169. devnull_verbose_ = $(devnull_verbose_@AM_DEFAULT_V@)
  170. devnull_verbose_0 = >/dev/null