From 6e1e23b34a4eda1d0791c22dc0495bc3fcf40374 Mon Sep 17 00:00:00 2001 From: Huub Van Dam Date: Mon, 10 Oct 2011 06:15:13 +0000 Subject: [PATCH] HvD: The makefiles in NWChem often rely on include files. These make include files have an .h extension which makes them difficult to distinguish from C-header files. However, inserting C-style Id: tags breaks violates the makefile syntax and causes the makefiles to break. However all of these makefiles can be found because the name matches the pattern "make*.h". So the solution to the problem is to first find all files that match "make*.h" and insert the appropriate make-style comment line: # $Id: $ Next we search for all "*.h" files that do not include "Id:" and add the C-style comment line: /* $Id: $ */ Because the makefiles now already have "Id:" inserted the C-style modification will not be applied to them, and hence the makefiles won't be broken. And so the problem associated with the original script is fixed. There is no other way to fix this problem as the makefiles in question are typically part of the GA library. So we cannot just change the makefiles and check that in to fix the problem as that would require additional access privileges to the GA repository. --- contrib/add_Id | 2 ++ contrib/add_Id_Makefile | 6 ++++++ 2 files changed, 8 insertions(+) create mode 100755 contrib/add_Id_Makefile diff --git a/contrib/add_Id b/contrib/add_Id index d0502affdd..1d8cd48734 100755 --- a/contrib/add_Id +++ b/contrib/add_Id @@ -8,6 +8,7 @@ # export ADD_ID_FORTRAN=${NWCHEM_TOP}/contrib/add_Id_Fortran export ADD_ID_C=${NWCHEM_TOP}/contrib/add_Id_C +export ADD_ID_MAKEFILE=${NWCHEM_TOP}/contrib/add_Id_Makefile # echo -n "Adding \$Id: \$ to Fortran header files... " find . -name "*.fh" ! -exec grep Id: {} \; -exec $ADD_ID_FORTRAN {} \; 2>&1 > /dev/null @@ -17,6 +18,7 @@ find . -name "*.f" ! -exec grep Id: {} \; -exec $ADD_ID_FORTRAN {} \; 2>&1 > /de find . -name "*.F" ! -exec grep Id: {} \; -exec $ADD_ID_FORTRAN {} \; 2>&1 > /dev/null echo "Done" echo -n "Adding \$Id: \$ to C header files... " +find . -name "make*.h" ! -exec grep Id: {} \; -exec $ADD_ID_MAKEFILE {} \; 2>&1 > /dev/null find . -name "*.h" ! -exec grep Id: {} \; -exec $ADD_ID_C {} \; 2>&1 > /dev/null echo "Done" echo -n "Adding \$Id: \$ to C source files... " diff --git a/contrib/add_Id_Makefile b/contrib/add_Id_Makefile new file mode 100755 index 0000000000..0c0db740f0 --- /dev/null +++ b/contrib/add_Id_Makefile @@ -0,0 +1,6 @@ +#!/bin/bash +# +# Add the $Id: $ construct to a Makefile. For simplicity it is simply appended. +# This is used to avoid adding the C-style construct in Makefile include files. +# +echo "# \$Id: \$" >> $1