Mike Gerwitz

Activist for User Freedom

aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-11-08 11:05:38 -0500
committerMike Gerwitz <mike.gerwitz@rtspecialty.com>2018-11-08 11:05:38 -0500
commit62089877b2aa0bc126a8ae8b1dbf5998064ee666 (patch)
tree636a48ae9fc962c6494ab8a12de770e0f00d5581 /build-aux
parent5cb78cc47dfc5f8234e502749112f7bce9a816dd (diff)
downloadtame-62089877b2aa0bc126a8ae8b1dbf5998064ee666.tar.gz
tame-62089877b2aa0bc126a8ae8b1dbf5998064ee666.tar.bz2
tame-62089877b2aa0bc126a8ae8b1dbf5998064ee666.zip
Expose CALCROOT and new SRCPATHS to build scripts
This begins to decouple the rater directory conventions using an incremental approach, defaulting to the existing structure. Not all things were modified (for example, cleaning will not work properly with a custom SRCPATHS if those directories do not exist); WIP. * build-aux/Makefile.am (path_dsl): Use `CALCROOT'. (suppliers.mk): Test for existence of program.dep and c1map directory before acting on them. * build-aux/m4/calcdsl.m4: Default SRCPATHS. Output it during configure. Expose CALCROOT and SRCPATHS using AC_SUBST. Invoke suppmk-gen using SRCPATHS. * build-aux/suppmk-gen: Use arguments (SRCPATHS) in place of hard-coded paths.
Diffstat (limited to 'build-aux')
-rw-r--r--build-aux/Makefile.am8
-rw-r--r--build-aux/m4/calcdsl.m411
-rwxr-xr-xbuild-aux/suppmk-gen4
3 files changed, 15 insertions, 8 deletions
diff --git a/build-aux/Makefile.am b/build-aux/Makefile.am
index f6f41ae..caa8644 100644
--- a/build-aux/Makefile.am
+++ b/build-aux/Makefile.am
@@ -21,7 +21,7 @@
path_rates := $(path_suppliers)/rates
path_map := map
path_c1map := $(path_map)/c1
-path_dsl := rater
+path_dsl := $(CALCROOT)
path_tame := $(path_dsl)/tame
path_ui := ui
path_tests := test
@@ -189,9 +189,9 @@ clean:
# an explanation
suppliers.mk:
$(ant) pkg-dep
- mv $(path_ui)/program.dep $(path_ui)/package-dfns.dep
- ./rater/tame/build-aux/gen-make common/ $(path_suppliers)/ $(path_dsl)/ $(path_map)/ $(path_ui)/ >$@
- ./rater/tame/build-aux/gen-c1make $(path_c1map)/*.xml >>$@
+ test ! -f $(path_ui)/program.dep || mv $(path_ui)/program.dep $(path_ui)/package-dfns.dep
+ $(path_dsl)/tame/build-aux/gen-make $(SRCPATHS) > $@
+ test ! -d $(path_c1map) || $(path_dsl)/tame/build-aux/gen-c1make $(path_c1map)/*.xml >> $@
program-data-copy: standalones program-ui c1map .version.xml
mkdir -p "$(path_lv)/src/node/program/rater/programs/@program@"
diff --git a/build-aux/m4/calcdsl.m4 b/build-aux/m4/calcdsl.m4
index d846fa0..6810750 100644
--- a/build-aux/m4/calcdsl.m4
+++ b/build-aux/m4/calcdsl.m4
@@ -1,6 +1,6 @@
# Common build configuration for TAME-based build systems
#
-# Copyright (C) 2017 R-T Specialty, LLC.
+# Copyright (C) 2017, 2018 R-T Specialty, LLC.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@ -49,6 +49,13 @@ AS_IF([test "$ANT"],,
# Automake runs before shell is available, thus the separate m4 variable
CALCROOT="m4_defn(`calc_root')"
+# Default source paths for BC
+test -n "$SRCPATHS" || SRCPATHS='common/ suppliers/ map/ ui/ rater/'
+AC_MSG_NOTICE([using source paths: $SRCPATHS])
+
+AC_SUBST([CALCROOT], [$CALCROOT])
+AC_SUBST([SRCPATHS], [$SRCPATHS])
+
# Checks to ensure that dslc is built, and gives instructions on how to
# build it otherwise. We do not want to build that for them---that can be
# added to a bootstrap script, but isn't permissible in build scripts.
@@ -79,7 +86,7 @@ AC_OUTPUT
# we want this to run as part of the configure script, not during M4
# expansion
-"$CALCROOT/build-aux/suppmk-gen"
+"$CALCROOT/build-aux/suppmk-gen" $SRCPATHS
AC_MSG_NOTICE([complete
diff --git a/build-aux/suppmk-gen b/build-aux/suppmk-gen
index 36d5717..4cdf993 100755
--- a/build-aux/suppmk-gen
+++ b/build-aux/suppmk-gen
@@ -27,7 +27,7 @@ while read csv; do
csvbase="${csv%%.*}"
echo "$csvbase.xmlo: $csvbase.xml"
echo "$csvbase.xml: $csvbase.csvo"
-done < <( find suppliers common -regex '^.+\.csv.?$' ) \
+done < <( find "$@" -regex '^.+\.csv.?$' ) \
>> suppliers.mk
while read tdat; do
@@ -35,6 +35,6 @@ while read tdat; do
echo "$tbase.xmlo: $tbase.xml rater/core/tdat.xmlo"
echo "$tbase.xml: $tdat"
echo -e "\trater/tools/tdat2xml \$< > \$@"
-done < <( find suppliers common -regex '^.+territories/.+\.dat$' ) \
+done < <( find "$@" -regex '^.+territories/.+\.dat$' ) \
>> suppliers.mk