From c87c643ca19b731ee6c53fbea72af8312ca6a725 Mon Sep 17 00:00:00 2001 From: Mathieu Lirzin Date: Mon, 9 May 2016 14:50:29 +0200 Subject: all: Separate programs in different executables. This improves readability and complies with the GNU Coding Standards by making the behavior of the programs independent of the name used to invoke them. * src/mcron/scripts/cron.scm: New file. * src/mcron/scripts/crontab.scm: Likewise. * src/mcron/scripts/mcron.scm: Likewise. * Makefile.am (dist_mcronmodule_DATA): Remove 'src/mcron/crontab.scm'. (bin_PROGRAMS): Add 'crontab'. (sbin_PROGRAMS): Add 'cron'. (mcron_CFLAGS, mcron_LDADD): Rename to ... (AM_CFLAGS, LDADD): ... these. (cron_SOURCES, cron_CPPFLAGS, cron_DEPENDENCIES) (crontab_SOURCES, crontab_CPPFLAGS, crontab_DEPENDENCIES) (mcron_CPPFLAGS, mcronscriptdir, dist_mcronscript_DATA): New variables. (modules): Redefine it in terms of other '_DATA' variables. * src/mcron/crontab.scm: Remove file. * src/mcron/main.scm (parse-args): New procedure. (command-name, command-type, options): Remove. (show-version): Adapt. (show-help, process-files-in-system-directory, cron-file-descriptors) (main, process-user-file, process-files-in-user-directory): Move procedures in the new files. * src/mcron.c (inner_main): Define the current module at compile time. * TODO: Update. * .gitignore: Likewise. --- Makefile.am | 39 ++++++++++++++++++++++++++++++--------- 1 file changed, 30 insertions(+), 9 deletions(-) (limited to 'Makefile.am') diff --git a/Makefile.am b/Makefile.am index 8c105e9..dc47945 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,13 +16,25 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . -bin_PROGRAMS = mcron +bin_PROGRAMS = mcron crontab +sbin_PROGRAMS = cron + +AM_CFLAGS = @GUILE_CFLAGS@ +LDADD = @GUILE_LIBS@ + mcron_SOURCES = src/mcron.c -mcron_CFLAGS = @GUILE_CFLAGS@ -mcron_DEPENDENCIES = $(mcronmodule_DATA) -mcron_LDADD = @GUILE_LIBS@ +mcron_CPPFLAGS = -DPROGRAM="\"mcron\"" +mcron_DEPENDENCIES = $(modules:%.scm=%.go) -modules = \ +cron_SOURCES = src/mcron.c +cron_CPPFLAGS = -DPROGRAM="\"cron\"" +cron_DEPENDENCIES = $(modules:%.scm=%.go) + +crontab_SOURCES = src/mcron.c +crontab_CPPFLAGS = -DPROGRAM="\"crontab\"" +crontab_DEPENDENCIES = $(modules:%.scm=%.go) + +dist_mcronmodule_DATA = \ src/mcron/base.scm \ src/mcron/environment.scm \ src/mcron/job-specifier.scm \ @@ -32,13 +44,22 @@ modules = \ src/mcron/vixie-time.scm mcronmodule_DATA = \ - $(modules:%.scm=%.go) \ + $(dist_mcronmodule_DATA:%.scm=%.go) \ src/mcron/config.scm \ src/mcron/config.go -dist_mcronmodule_DATA = \ - $(modules) \ - src/mcron/crontab.scm +mcronscriptdir = $(mcronmoduledir)/scripts +dist_mcronscript_DATA = \ + src/mcron/scripts/cron.scm \ + src/mcron/scripts/crontab.scm \ + src/mcron/scripts/mcron.scm + +mcronscript_DATA = $(dist_mcronscript_DATA:%.scm=%.go) + +modules = \ + $(dist_mcronmodule_DATA) \ + $(dist_mcronscript_DATA) \ + src/mcron/config.scm # Unset 'GUILE_LOAD_COMPILED_PATH' altogether while compiling. Otherwise, if # $GUILE_LOAD_COMPILED_PATH contains $(mcronmoduledir), we may find .go files -- cgit v1.2.3