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.
This commit is contained in:
Huub Van Dam 2011-10-10 06:15:13 +00:00
parent afb6f91ce5
commit 6e1e23b34a
2 changed files with 8 additions and 0 deletions

View file

@ -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... "

6
contrib/add_Id_Makefile Executable file
View file

@ -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