You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
609 B
Bash
17 lines
609 B
Bash
14 years ago
|
#!/bin/bash
|
||
4 years ago
|
hn=amg_const.h
|
||
|
fn=amg_base_prec_type.F90
|
||
14 years ago
|
echo "/* This file was generated by a script using the $fn file as a basis. */" > $hn
|
||
4 years ago
|
echo '#ifndef AMG_CONST_H_' >> $hn
|
||
|
echo '#define AMG_CONST_H_' >> $hn
|
||
14 years ago
|
echo '#ifdef __cplusplus' >> $hn
|
||
|
echo 'extern "C" { ' >> $hn
|
||
|
echo '#endif' >> $hn
|
||
4 years ago
|
cat $fn | sed 's/=/= (/g;s/$/ )/g' | grep '\(^ *!\)\|parameter' | grep '_\>' | sed 's/^\s*//g;s/^.*:://g;s/\s*=\s*/ /g' | sed 's/,/\n/g;s/^ //g' | tr '[:lower:]' '[:upper:]' | grep ^AMG | sed 's/^/#define /g' >> $hn
|
||
14 years ago
|
echo '#ifdef __cplusplus' >> $hn
|
||
|
echo '}' >> $hn
|
||
|
echo '#endif' >> $hn
|
||
14 years ago
|
echo '#endif' >> $hn
|
||
14 years ago
|
exit
|
||
|
|