SummaryRefsLogTreeCommitDiffStats
path: root/makefile.am
blob: 1fcf32ec7d9f9352ede703a1ea81502298f50bee (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
## Makefile for the toplevel directory of mcron.
## Copyright (C) 2003 Dale Mellor
## Copyright (C) 2015 Mathieu Lirzin
##
#    This file is part of GNU mcron.
# 
#    GNU mcron is free software: you can redistribute it and/or modify it under
#    the terms of the GNU General Public License as published by the Free
#    Software Foundation, either version 3 of the License, or (at your option)
#    any later version.
# 
#    GNU mcron is distributed in the hope that it will be useful, but WITHOUT
#    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
#    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
#    more details.
# 
#    You should have received a copy of the GNU General Public License along
#    with GNU mcron.  If not, see <http://www.gnu.org/licenses/>.

## Process this file with automake to produce Makefile.in

SUBDIRS = scm/mcron .

CP = @CP@

EXTRA_DIST = BUGS ChangeLog.old

info_TEXINFOS = doc/mcron.texi
doc_mcron_TEXINFOS = doc/fdl.texi
dist_man_MANS = doc/mcron.1

bin_PROGRAMS = mcron
mcron_SOURCES = mcron.c
mcron_LDADD = @GUILE_LIBS@

# The second option is so that we can execute the binary in the local directory,
# in turn so that we can do mcron --help during the build process.
mcron_CFLAGS  = @GUILE_CFLAGS@ -DGUILE_LOAD_PATH=\"$(datadir):./scm:...\"

dist-hook: gen-ChangeLog

gen_start_date = 2015-06-26
.PHONY: gen-ChangeLog
gen-ChangeLog:
	$(AM_V_GEN)if test -d $(srcdir)/.git; then			\
	  log_fix="$(srcdir)/build-aux/git-log-fix";			\
	  test -e "$$log_fix"						\
	    && amend_git_log="--amend=$$log_fix"			\
	    || amend_git_log=;						\
	  $(top_srcdir)/build-aux/gitlog-to-changelog			\
	    $$amend_git_log --since=$(gen_start_date) > $(distdir)/cl-t && \
	    { rm -f $(distdir)/ChangeLog &&				\
	      mv $(distdir)/cl-t $(distdir)/ChangeLog; }		\
	fi

#full program prefix
fpp = $(DESTDIR)$(bindir)/@real_program_prefix@


install-exec-hook:
	@if [ "x@NO_VIXIE_CLOBBER@" != "xyes"   -a   "`id -u`" -eq "0" ]; then \
       rm -f $(fpp)cron$(EXEEXT) > /dev/null 2>&1; \
       $(INSTALL) --mode='u=rwx' mcron$(EXEEXT) $(fpp)cron$(EXEEXT); \
       rm -f $(fpp)crontab$(EXEEXT) > /dev/null 2>&1; \
       $(INSTALL) --mode='u=rwxs,og=rx' mcron$(EXEEXT) $(fpp)crontab$(EXEEXT); \
       $(INSTALL) -d --mode='u=rwx' $(DESTDIR)/var/cron; \
       $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)/var/run; \
       $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)@GUILE_SITE@; \
       $(INSTALL) -d --mode='u=rwx,og=rx' $(DESTDIR)@GUILE_SITE@/mcron; \
    elif [ "x@NO_VIXIE_CLOBBER@" = "xyes" ]; then \
       echo "Not installing Vixie-style programs"; \
    else \
       echo "+++ WARNING: NON-ROOT INSTALL: ONLY mcron WILL BE INSTALLED, NOT ANY OF THE VIXIE REPLACEMENT PROGRAMS"; \
    fi


uninstall-hook:
	if [ "`id -u`" -eq "0" ]; then \
        rm -f $(fpp){cron,crontab}$(EXEEXT); \
    fi

# Extend silent rules to help2man.
AM_V_HELP2MAN = $(AM_V_HELP2MAN_$(V))
AM_V_HELP2MAN_ = $(AM_V_HELP2MAN_$(AM_DEFAULT_VERBOSITY))
AM_V_HELP2MAN_0 = @echo "  HELP2MAN" $@;

# Not part of formal package building, but a rule for manual use to get the
# elemental man page.  Will only work once the mcron program is installed.
doc/mcron.1: mcron.c
	-$(AM_V_HELP2MAN)$(MKDIR_P) `dirname "$@"` ; 			\
	$(HELP2MAN)							\
	  -n 'a program to run tasks at regular (or not) intervals'	\
	  ./mcron > $@