lmi
[Top][All Lists]
Advanced

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

[lmi] Makefile.am backslashes and check_concinnity


From: Vadim Zeitlin
Subject: [lmi] Makefile.am backslashes and check_concinnity
Date: Mon, 1 Sep 2008 19:19:27 +0200

 Hello,

 I was getting strange errors from automake after updating to latest cvs
and it took me some time to realize that they were due to extraneous line
continuations characters in Makefile.am and that this patch is needed to
fix them:

--- Makefile.am 2008-08-11 19:56:19 +0000
+++ Makefile.am 2008-09-01 17:13:57 +0000
@@ -428,7 +428,7 @@
     my_fund.cpp \
     my_prod.cpp \
     my_rnd.cpp \
-    my_tier.cpp \
+    my_tier.cpp
 product_files_LDADD = \
     liblmi.la   \
     $(BOOST_LIBS) \
@@ -519,7 +519,7 @@
 test_commutation_functions_SOURCES =    \
   $(common_test_objects) \
   commutation_functions_test.cpp \
-  ihs_commfns.cpp \
+  ihs_commfns.cpp
 test_commutation_functions_CXXFLAGS = $(AM_CXXFLAGS)

 test_comma_punct_SOURCES =  \

I hope there is no objection to committing this but beyond fixing it this
time I'd like to ensure that this problem doesn't happen again in the
future (or, at least, make it less likely that it happens) so I'd also like
to propose this patch:

--- GNUmakefile 2008-07-19 14:50:18 +0000
+++ GNUmakefile 2008-09-01 17:14:07 +0000
@@ -342,6 +342,8 @@
          done;
        @$(ECHO) "  Miscellaneous problems:"
        @-$(TEST_CODING_RULES) *
+       @perl -Mstrict -we 'undef $$/;exit(<>=~/\\\n[^ \t]/)' Makefile.am \
+           || $(ECHO) "Makefile.am contains incorrect continuation lines."

 
################################################################################

This obviously doesn't look very readable (not only I compressed the check
in a one-liner but I also had to quote dollars and backslashes to protect
them from the shell) and it also doesn't show where exactly the incorrect
continuations are but at least it detects them. If you prefer, I could
create a separate check_makefile_am.pl script which could be more readable
and output the line numbers where the problems occur but IMO it's somewhat
an overkill so I didn't do it for now. And if there is a better place to
check this, please let me know.

 Thanks,
VZ

reply via email to

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