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

Diff of /MITgcm/doc/api_reference/configure

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

revision 1.2 by edhill, Fri Mar 26 23:46:11 2004 UTC revision 1.7 by edhill, Fri Apr 2 05:13:33 2004 UTC
# Line 18  cat ./dir_list | grep -v '^[ ]*#' | grep Line 18  cat ./dir_list | grep -v '^[ ]*#' | grep
18  name=$0  name=$0
19  cat <<EOF > Makefile  cat <<EOF > Makefile
20  #  #
21  #  ========================================  #  ================================================
22  #  #
23  #  CREATED BY $name -- DO NOT EDIT !!!  #  CREATED BY "$name" -- DO NOT EDIT !!!
24  #  #
25  #  ========================================  #  ================================================
26  #  #
27    
28  .SUFFIXES:  .SUFFIXES:
29    
30  all: all_protex  all: all_protex
31    
 clean:  
         -rm -f *.tex *.aux *.dvi *.log *.toc  
   
32  EOF  EOF
33    
34  rm -rf ./.targets  rm -rf ./.targets ./.all_clean
35  cat ./.dir_list_nocomments | while read line ; do  cat ./.dir_list_nocomments | while read line ; do
36    
37      echo >> Makefile      echo >> Makefile
38      base_target=`echo $line | awk '{print $1}' | sed -e 's|/|__|g'`      base_target=`echo $line | awk '{print $1}' | sed -e 's|/|__|g'`
39      target=$base_target".tex"      target=$base_target".tex"
40        printf " $target" >> ./.all_clean
41      echo "Finding files for \"$target\" in: $line"      echo "Finding files for \"$target\" in: $line"
42      F_files=""      tex_files=""
43      h_files=""      h_files=""
44        F_files=""
45      c_files=""      c_files=""
46      for i in $line ; do      for i in $line ; do
47          F_files="$F_files"`ls -1 ../../$i/*.F  2>/dev/null`          tex_files="$tex_files"`ls -1 ../../$i/*.tex  2>/dev/null`
48          h_files="$h_files"`ls -1 ../../$i/*.h  2>/dev/null`          h_files="$h_files"`ls -1 ../../$i/*.h  2>/dev/null`
49            F_files="$F_files"`ls -1 ../../$i/*.F  2>/dev/null`
50          c_files="$c_files"`ls -1 ../../$i/*.c  2>/dev/null`          c_files="$c_files"`ls -1 ../../$i/*.c  2>/dev/null`
51      done      done
52    
53      # *.F      # *.tex
54      printf '%s' $base_target"_F = " >> Makefile      printf '%s' $base_target"_tex = " >> Makefile
55      for i in $F_files ; do      for i in $tex_files ; do
56          printf '\\\n%s' " $i " >> Makefile          printf '\\\n%s' " $i " >> Makefile
57      done      done
58      printf '\n' >> Makefile      printf '\n' >> Makefile
# Line 64  cat ./.dir_list_nocomments | while read Line 64  cat ./.dir_list_nocomments | while read
64      done      done
65      printf '\n' >> Makefile      printf '\n' >> Makefile
66    
67        # *.F
68        printf '%s' $base_target"_F = " >> Makefile
69        for i in $F_files ; do
70            printf '\\\n%s' " $i " >> Makefile
71        done
72        printf '\n' >> Makefile
73    
74      # *.c      # *.c
75      printf '%s' $base_target"_c = " >> Makefile      printf '%s' $base_target"_c = " >> Makefile
76      for i in $c_files ; do      for i in $c_files ; do
77          printf '\\\n%s' " $i " >> Makefile          printf '\\\n%s' " $i " >> Makefile
78      done      done
79      printf '\n' >> Makefile      printf '\n' >> Makefile
80      d_F="\$("$base_target"_F)"      d_tex="\$("$base_target"_tex)"
81      d_h="\$("$base_target"_h)"      d_h="\$("$base_target"_h)"
82        d_F="\$("$base_target"_F)"
83      d_c="\$("$base_target"_c)"      d_c="\$("$base_target"_c)"
84      cat <<EOF >> Makefile      cat <<EOF >> Makefile
85  $target: $d_F $d_h $d_c  $target: $d_tex $d_h $d_F $d_c
86          -rm -f $target          -rm -f $target
87  EOF  EOF
88      if test ! "x$F_files" = x ; then      if test ! "x$tex_files" = x ; then
89          printf '\t%s\n' "-./protex -b7 $d_F >> $target" >> Makefile          printf '\t%s\n' "-cat $d_tex >> $target" >> Makefile
90      fi      fi
91      if test ! "x$h_files" = x ; then      if test ! "x$h_files" = x ; then
92          printf '\t%s\n' "-./protex -b7 $d_h >> $target" >> Makefile          printf '\t%s\n' "-./protex -b7f $d_h >> $target" >> Makefile
93        fi
94        if test ! "x$F_files" = x ; then
95            printf '\t%s\n' "-./protex -b7f $d_F >> $target" >> Makefile
96      fi      fi
97      if test ! "x$c_files" = x ; then      if test ! "x$c_files" = x ; then
98          printf '\t%s\n' "-./protex -bC $d_c >> $target" >> Makefile          printf '\t%s\n' "-./protex -bCf $d_c >> $target" >> Makefile
99      fi      fi
100    
101      if test ! "x$target" = x ; then      if test ! "x$target" = x ; then
# Line 104  cat <<EOF >> Makefile Line 115  cat <<EOF >> Makefile
115  makefile:  makefile:
116          $0          $0
117    
118  api_main.tex: \$(ALLTEX)  api_main.tex: introduction.tex \$(ALLTEX)
119          -./build_main \$(ALLTEX)          -./build_main \$(ALLTEX)
120    
121  api_main.dvi:  api_main.tex  api_main.dvi:  api_main.tex
122          latex api_main          latex api_main
123          latex api_main          latex api_main
124          latex api_main          latex api_main
125            latex api_main
126    
127    api_main.ps: api_main.dvi
128            dvips -Pcmz -Pamz -o api_main.ps api_main.dvi
129    
130  all_protex: api_main.dvi  PDFOPTS = -dMaxSubsetPct=100 -dCompatibilityLevel=1.2 -dSubsetFonts=true -dEmbedAllFonts=true
131    api_main.pdf: api_main.ps
132            ps2pdf \$(PDFOPTS) api_main.ps api_main.pdf
133    
134    all_protex: api_main.pdf
135    
136    distclean:
137            @make clean
138            -rm -f Makefile
139    
140    clean:
141            -rm -f *.aux *.dvi *.log *.toc *.out
142            -rm -f api_main.*
143  EOF  EOF
144    
145    printf "\t-rm -f " >> Makefile
146    cat ./.all_clean >> Makefile
147    
148  rm -f ./.dir_list_nocomments  rm -f ./.dir_list_nocomments
149  rm -f ./.targets  rm -f ./.targets
150    rm -f ./.all_clean

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.7

  ViewVC Help
Powered by ViewVC 1.1.22