/[MITgcm]/MITgcm/doc/api_reference/configure
ViewVC logotype

Annotation of /MITgcm/doc/api_reference/configure

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.5 - (hide annotations) (download)
Thu Apr 1 05:00:06 2004 UTC (20 years, 1 month ago) by edhill
Branch: MAIN
Changes since 1.4: +4 -4 lines
 o add sections

1 edhill 1.1 #! /usr/bin/env sh
2     #
3 edhill 1.5 # $Header: /u/gcmpack/MITgcm/doc/api_reference/configure,v 1.4 2004/04/01 04:23:33 edhill Exp $
4 edhill 1.1 #
5     # A script to generate the Makefile for the API Reference
6    
7     if ! test -r ./dir_list ; then
8     cat <<EOF
9     ERROR: cannot read the directory list -- please verify that this
10     script is run in MITGCM_ROOT/doc/api_reference and that the
11     "dir_list" file is readable.
12     EOF
13     exit 1
14     fi
15    
16     cat ./dir_list | grep -v '^[ ]*#' | grep -v '^[ ]*$' > ./.dir_list_nocomments
17    
18     name=$0
19     cat <<EOF > Makefile
20     #
21 edhill 1.3 # ================================================
22 edhill 1.2 #
23 edhill 1.3 # CREATED BY "$name" -- DO NOT EDIT !!!
24 edhill 1.1 #
25 edhill 1.3 # ================================================
26 edhill 1.2 #
27    
28     .SUFFIXES:
29 edhill 1.1
30     all: all_protex
31    
32     clean:
33 edhill 1.4 -rm -f *_*.tex *.aux *.dvi *.log *.toc *.out
34 edhill 1.1
35     EOF
36    
37     rm -rf ./.targets
38     cat ./.dir_list_nocomments | while read line ; do
39    
40     echo >> Makefile
41     base_target=`echo $line | awk '{print $1}' | sed -e 's|/|__|g'`
42     target=$base_target".tex"
43     echo "Finding files for \"$target\" in: $line"
44 edhill 1.3 tex_files=""
45     h_files=""
46 edhill 1.1 F_files=""
47     c_files=""
48     for i in $line ; do
49 edhill 1.3 tex_files="$tex_files"`ls -1 ../../$i/*.tex 2>/dev/null`
50     h_files="$h_files"`ls -1 ../../$i/*.h 2>/dev/null`
51 edhill 1.1 F_files="$F_files"`ls -1 ../../$i/*.F 2>/dev/null`
52     c_files="$c_files"`ls -1 ../../$i/*.c 2>/dev/null`
53     done
54    
55 edhill 1.3 # *.tex
56     printf '%s' $base_target"_tex = " >> Makefile
57     for i in $tex_files ; do
58 edhill 1.1 printf '\\\n%s' " $i " >> Makefile
59     done
60     printf '\n' >> Makefile
61    
62     # *.h
63     printf '%s' $base_target"_h = " >> Makefile
64     for i in $h_files ; do
65     printf '\\\n%s' " $i " >> Makefile
66     done
67     printf '\n' >> Makefile
68    
69 edhill 1.3 # *.F
70     printf '%s' $base_target"_F = " >> Makefile
71     for i in $F_files ; do
72     printf '\\\n%s' " $i " >> Makefile
73     done
74     printf '\n' >> Makefile
75    
76 edhill 1.1 # *.c
77     printf '%s' $base_target"_c = " >> Makefile
78     for i in $c_files ; do
79     printf '\\\n%s' " $i " >> Makefile
80     done
81     printf '\n' >> Makefile
82 edhill 1.3 d_tex="\$("$base_target"_tex)"
83     d_h="\$("$base_target"_h)"
84 edhill 1.1 d_F="\$("$base_target"_F)"
85     d_c="\$("$base_target"_c)"
86     cat <<EOF >> Makefile
87 edhill 1.3 $target: $d_tex $d_h $d_F $d_c
88 edhill 1.1 -rm -f $target
89     EOF
90 edhill 1.3 if test ! "x$tex_files" = x ; then
91     printf '\t%s\n' "-cat $d_tex >> $target" >> Makefile
92 edhill 1.1 fi
93     if test ! "x$h_files" = x ; then
94 edhill 1.5 printf '\t%s\n' "-./protex -b7f $d_h >> $target" >> Makefile
95 edhill 1.1 fi
96 edhill 1.3 if test ! "x$F_files" = x ; then
97 edhill 1.5 printf '\t%s\n' "-./protex -b7f $d_F >> $target" >> Makefile
98 edhill 1.3 fi
99 edhill 1.1 if test ! "x$c_files" = x ; then
100 edhill 1.5 printf '\t%s\n' "-./protex -bCf $d_c >> $target" >> Makefile
101 edhill 1.1 fi
102    
103     if test ! "x$target" = x ; then
104     printf '%s' " $target" >> ./.targets
105     fi
106     done
107    
108     alltex=`cat ./.targets`
109     printf '\n%s' "ALLTEX = " >> Makefile
110     for i in $alltex ; do
111     printf '\\\n%s' " $i " >> Makefile
112     done
113     printf '\n\n' >> Makefile
114    
115     cat <<EOF >> Makefile
116    
117     makefile:
118     $0
119    
120 edhill 1.4 api_main.tex: introduction.tex \$(ALLTEX)
121 edhill 1.2 -./build_main \$(ALLTEX)
122 edhill 1.1
123 edhill 1.2 api_main.dvi: api_main.tex
124 edhill 1.3 latex api_main
125 edhill 1.2 latex api_main
126     latex api_main
127     latex api_main
128 edhill 1.1
129 edhill 1.2 all_protex: api_main.dvi
130 edhill 1.1
131     EOF
132    
133     rm -f ./.dir_list_nocomments
134 edhill 1.2 rm -f ./.targets
135 edhill 1.1

  ViewVC Help
Powered by ViewVC 1.1.22