source: Sophya/trunk/SophyaLib/Manual/mkmf@ 2717

Last change on this file since 2717 was 2416, checked in by cmv, 22 years ago

fabrication de piapp.ps rz+cmv 21/7/2003

  • Property svn:executable set to *
File size: 6.0 KB
RevLine 
[891]1#!/bin/csh
[976]2#####################################################
[891]3if( $#argv >= 1 ) then
4 if( "$1" == "-h" ) then
[976]5 echo "mkmf [-options] [-o dir] [module1] [module2] [...]"
[891]6 echo " generate documentation for all Sophya"
[976]7 echo " or only for module [module...]"
8 echo " **** [-options] :"
[2266]9 echo " -libmod : generate doc for library modules (default)"
10 echo " -prgmod : generate doc for program modules"
11 echo " -allmod : generate doc for library+program modules"
[976]12 echo " -html : generate HTML doc"
13 echo " -latex : generate LATEX doc"
14 echo " -man : generate MAN doc"
15 echo " -rtf : generate RTF doc"
16 echo " default is : html + latex"
17 echo " **** [-o dir] : directory where doc have to be put"
18 echo " default is ."
19 exit -1
[891]20 endif
21endif
[976]22#####################################################
[891]23
[976]24##################################
25######## Decode arguments ########
26##################################
[2266]27set libmodules = ( \
[1625]28 BaseTools HiStats NTools Samba SkyMap SUtils SysTools TArray \
[2266]29 SkyT FitsIOServer IFFTW LinAlg XAstroPack \
[1000]30 )
[2266]31set prgmodules = ( PMixer PrgMap PrgUtil ProgPI )
32
33set allmodules = ( $libmodules $prgmodules )
34
[976]35unset modules; unset latex; unset html; unset man; unset rtf
36set outdir = "."
37if( $#argv >= 1 ) then
38 while ( $#argv > 0)
39 if( "$1" == "-o" ) then
40 shift
41 set outdir = $1
42 else if( "$1" == "-html" ) then
43 set html
44 else if( "$1" == "-latex" ) then
45 set latex
46 else if( "$1" == "-man" ) then
47 set man
48 else if( "$1" == "-rtf" ) then
49 set rtf
[2266]50 else if( "$1" == "-libmod" ) then
[2276]51 set modules = ( $libmodules )
[2266]52 else if( "$1" == "-prgmod" ) then
[2276]53 set modules = ( $prgmodules )
[2266]54 else if( "$1" == "-allmod" ) then
[2276]55 set modules = ( $allmodules )
[976]56 else
57 if( ! $?modules ) set modules
58 set modules = ( $modules $1 )
59 endif
60 shift
61 end
62endif
63if( ! $?html && ! $?latex && ! $?man && ! $?rtf ) then
64 set html
65 set latex
66endif
67if( ! $?modules ) then
[2276]68 set modules = ( $allmodules )
[976]69endif
70
[891]71##########################################
72######## Test de la configuration ########
73##########################################
74
[976]75#------------
[891]76# mydoxy.conf
[976]77#------------
[891]78cp dox_sophya.conf mydoxy.conf
79
[976]80#----------
[891]81# doxygen ?
[976]82#----------
[891]83which doxygen >! /dev/null
84if( $status != 0 ) then
85 echo 'ERROR: doxygen is not installed...'
86 exit -1
87endif
88
[976]89#-------------
[891]90# doxysearch ?
[976]91#-------------
[891]92which doxysearch >! /dev/null
93if( $status != 0 ) then
94 echo 'ERROR: doxysearch is not installed...'
95 exit -2
96else
97 set s = `which doxysearch`
[976]98 echo 'doxysearch is installed in : ' $s:h
[891]99 echo 'mkmf will automatically update the config file.'
100 echo "BIN_ABSPATH = $s:h" >> mydoxy.conf
101 grep 'BIN_ABSPATH' mydoxy.conf | grep -v ^\#
102endif
103
[976]104#-----------------
105# Version number ?
106#-----------------
[1606]107set f = ../BaseTools/sversion.h
[976]108if( -e $f ) then
109 set v = `grep 'SOPHYA_VERSION' $f | awk '{print $3}'`
110 set r = `grep 'SOPHYA_REVISION' $f | awk '{print $3}'`
111 set t = `grep 'SOPHYA_TAG' $f | awk '{print $3}'`
112 echo "PROJECT_NUMBER = V${v}_R${r}_${t}" >> mydoxy.conf
113else
114 echo "PROJECT_NUMBER = Not_Defined" >> mydoxy.conf
[891]115endif
[976]116grep 'PROJECT_NUMBER = ' mydoxy.conf | tail -1
[891]117
[976]118#---------------
119# What modules ?
120#---------------
121set lf =
122foreach f ( $modules )
123 echo "... Generating doc for ../$f"
124 set lf = ( ../$f $lf )
125end
126echo "INPUT = $lf" >> mydoxy.conf
127grep 'INPUT = ' mydoxy.conf | tail -1
128
129set lf =
130foreach f ( $allmodules )
131 set lf = ( ../$f $lf )
132end
133echo "EXAMPLE_PATH = $lf" >> mydoxy.conf
134
135#-------------------
136# What kind of doc ?
137#-------------------
138if( $?html ) then
139 echo "GENERATE_HTML = YES" >> mydoxy.conf
140 echo "...... generating HTML"
141else
142 echo "GENERATE_HTML = NO" >> mydoxy.conf
143endif
144if( $?latex ) then
145 echo "GENERATE_LATEX = YES" >> mydoxy.conf
146 echo "...... generating LATEX"
147else
148 echo "GENERATE_LATEX = NO" >> mydoxy.conf
149endif
150if( $?man ) then
151 echo "GENERATE_MAN = YES" >> mydoxy.conf
152 echo "...... generating MAN"
153else
154 echo "GENERATE_MAN = NO" >> mydoxy.conf
155endif
156if( $?rtf ) then
157 echo "GENERATE_RTF = YES" >> mydoxy.conf
158 echo "...... generating RTF"
159else
160 echo "GENERATE_RTF = NO" >> mydoxy.conf
161endif
162
163#------------------------
164# What output directory ?
165#------------------------
[1453]166if( ! -d $outdir ) then
167 echo ERROR: Not existing directory : $outdir
168 exit -1
169endif
[976]170echo "OUTPUT_DIRECTORY = $outdir" >> mydoxy.conf
171grep 'OUTPUT_DIRECTORY = ' mydoxy.conf | tail -1
172
173#--------------------------
174# Configuration file update
175#--------------------------
176doxygen -u mydoxy.conf >! /dev/null
177rm -f mydoxy.conf.bak
178
[891]179#########################################
180######## Creation de la Makefile ########
181#########################################
182
183rm -f Makefile
184touch Makefile
185chmod +x Makefile
186cat >> Makefile << EOF_
187
[1453]188#-------------------------------------------------------
[2416]189all: doc sophya pmixer piapp
[1453]190
191#-------------------------------------------------------
[891]192clean:
[1453]193 rm -rf *.o dox_filter
194 if [ -d ${outdir} ] ; then cd ${outdir}/ ; rm -rf html latex man rtf; fi
[891]195
[1453]196#-------------------------------------------------------
197copy:
198 if [ ! -d ${outdir}/latex ] ; then mkdir ${outdir}/latex; fi
199 cp -p *.tex *.sty *.eps *.inc ${outdir}/latex/.
200
201#-------------------------------------------------------
[891]202doc: filter
203 doxygen mydoxy.conf
204
[1453]205#-------------------------------------------------------
[891]206filter: dox_filter
207
208dox_filter : dox_filter.o
209
210dox_filter.o : dox_filter.c
211
[1453]212#-------------------------------------------------------
213sophya: copy ${outdir}/latex/sophya.ps
214
215${outdir}/latex/sophya.ps: sophya.tex defsophya.sty blue_sophya_400.eps ex1.inc
[2137]216 cd ${outdir}/latex/; \
217 latex sophya.tex; \
218 makeindex sophya; \
219 latex sophya; \
220 dvips -o sophya.ps sophya.dvi
[1453]221
[2416]222piapp: copy ${outdir}/latex/piapp.ps
223
224${outdir}/latex/piapp.ps: piapp.tex piahelp.tex defsophya.sty
225 cd ${outdir}/latex/; \
226 latex piapp.tex; \
227 makeindex piapp; \
228 latex piapp; \
229 dvips -o piapp.ps piapp.dvi
230
[1453]231pmixer: copy ${outdir}/latex/pmixer.ps
232
233${outdir}/latex/pmixer.ps: pmixer.tex
[2137]234 cd ${outdir}/latex/; \
235 latex pmixer.tex; \
236 latex pmixer; \
237 dvips -o pmixer.ps pmixer.dvi
[1453]238
[891]239EOF_
240
241exit 0
Note: See TracBrowser for help on using the repository browser.