lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 0dfb9cb 2/6: Parameterize directory tested by


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 0dfb9cb 2/6: Parameterize directory tested by 'make check_concinnity'
Date: Wed, 22 May 2019 15:27:39 -0400 (EDT)

branch: master
commit 0dfb9cbf4a49b73ada42ef16476a87c7cc4f41b0
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Parameterize directory tested by 'make check_concinnity'
    
    Reverted commit 0b55f4657b6d of 20120301T1226Z in relevant part (it
    expected this rather unnatural usage:
      cd /path/to/test
      make target -f /somewhere/else/makefile srcdir=/somewhere/else
    to test files in /path/to/test/ , and therefore it had to invoke
      make --directory=this_directory --file=this_makefile some_tool
    which also seemed unnatural), and reimplemented it to support this
    more natural usage instead:
      prefascicle_dir=/path/to/test make target --directory=/somewhere/else
    where the natural invocation
      make some_tool
    suffices to build the required tool.
---
 GNUmakefile      |  9 +++++----
 gwc/develop2.txt | 14 ++++++--------
 hooks/pre-commit |  7 ++++---
 3 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/GNUmakefile b/GNUmakefile
index d38ed5f..ef8d813 100644
--- a/GNUmakefile
+++ b/GNUmakefile
@@ -388,7 +388,7 @@ TEST_CODING_RULES := $(build_dir)/test_coding_rules$(EXEEXT)
 
 .PHONY: custom_tools
 custom_tools:
-       @$(MAKE) --file=$(this_makefile) --directory=$(srcdir) 
test_coding_rules$(EXEEXT)
+       @$(MAKE) test_coding_rules$(EXEEXT)
        @$(MKDIR) --parents $(localbindir)
        @$(CP) --preserve --update $(TEST_CODING_RULES) $(localbindir)
 
@@ -409,7 +409,8 @@ custom_tools:
 # be made for msw '.bat' files, which normally should not be run in a
 # *nix shell.
 
-xml_files := $(wildcard *.cns *.ill *.xml *.xrc *.xsd *.xsl)
+prefascicle_dir ?= $(srcdir)
+xml_files := $(wildcard $(addprefix $(prefascicle_dir)/,*.cns *.ill *.xml 
*.xrc *.xsd *.xsl))
 
 .PHONY: check_concinnity
 check_concinnity: source_clean custom_tools
@@ -430,7 +431,7 @@ check_concinnity: source_clean custom_tools
          | $(MD5SUM) --check --quiet || true
        @for z in $(build_dir)/*.d; do [ -s $$z ]         || echo $$z; done;
        @for z in $(build_dir)/*.o; do [ -f $${z%%.o}.d ] || echo $$z; done;
-       @$(LS) --classify ./* \
+       @$(LS) --classify $(prefascicle_dir)/* \
          | $(SED) -e'/\*$$/!d' -e'/^\.\//!d' -e'/.sh\*$$/d' -e'/.sed\*$$/d' \
          | $(SED) -e's/^/Improperly executable: /'
        @$(ECHO) "  Problems detected by xmllint:"
@@ -446,7 +447,7 @@ check_concinnity: source_clean custom_tools
              || $(ECHO) "... in file $$z"; \
          done;
        @$(ECHO) "  Miscellaneous problems:"
-       @-$(PERFORM) $(TEST_CODING_RULES) *
+       @-$(PERFORM) $(TEST_CODING_RULES) $(prefascicle_dir)/*
 
 
################################################################################
 
diff --git a/gwc/develop2.txt b/gwc/develop2.txt
index 5d20d1a..67fd8d3 100644
--- a/gwc/develop2.txt
+++ b/gwc/develop2.txt
@@ -87,15 +87,13 @@ printf "forcing correct permissions "
   )done; \
 printf "all permissions forced\n"
 
-  # (2) Test concinnity. The git pre-commit hook shows these commands'
-  # output, filtered; these commands show the same thing, unfiltered
-  # so that the diagnostics are easier to understand.
+  # (2) Test concinnity. The git pre-commit hook shows filtered output;
+  # this command shows the same thing, unfiltered so that the diagnostics
+  # are easier to understand.
 
-cd /opt/lmi/proprietary/data/
-cd ../data  ; make srcdir=/opt/lmi/src/lmi -f /opt/lmi/src/lmi/GNUmakefile 
check_concinnity 2>&1 |less -S
-cd ../src   ; make srcdir=/opt/lmi/src/lmi -f /opt/lmi/src/lmi/GNUmakefile 
check_concinnity 2>&1 |less -S
-cd ../test  ; make srcdir=/opt/lmi/src/lmi -f /opt/lmi/src/lmi/GNUmakefile 
check_concinnity 2>&1 |less -S
-cd ../tables; make srcdir=/opt/lmi/src/lmi -f /opt/lmi/src/lmi/GNUmakefile 
check_concinnity 2>&1 |less -S
+for z in src data graphics test tables; do \
+  make --directory=/opt/lmi/src/lmi --no-print-directory check_concinnity \
+  prefascicle_dir=/opt/lmi/proprietary/$z ; done
 
   # To update copyright notices annually
 
diff --git a/hooks/pre-commit b/hooks/pre-commit
index ee0b542..b21edf4 100755
--- a/hooks/pre-commit
+++ b/hooks/pre-commit
@@ -27,8 +27,9 @@ check_concinnity()
 {
     output=$( \
         make \
-          srcdir=/opt/lmi/src/lmi \
-          -f /opt/lmi/src/lmi/GNUmakefile \
+          prefascicle_dir="$1" \
+          --directory=/opt/lmi/src/lmi \
+          --no-print-directory \
           check_concinnity \
         2>&1 | sed \
           -e"/^Is it time to 'make release_candidate'?$/d" \
@@ -45,5 +46,5 @@ check_concinnity()
 }
 
 printf "checking..."
-check_concinnity
+check_concinnity /opt/lmi/src/lmi
 printf "okay\n"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]