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

Last change on this file since 988 was 976, checked in by ansari, 25 years ago

modifs doc cmv 27/4/00

  • Property svn:executable set to *
File size: 4.3 KB
Line 
1#!/bin/csh
2#####################################################
3if( $#argv >= 1 ) then
4 if( "$1" == "-h" ) then
5 echo "mkmf [-options] [-o dir] [module1] [module2] [...]"
6 echo " generate documentation for all Sophya"
7 echo " or only for module [module...]"
8 echo " **** [-options] :"
9 echo " -html : generate HTML doc"
10 echo " -latex : generate LATEX doc"
11 echo " -man : generate MAN doc"
12 echo " -rtf : generate RTF doc"
13 echo " default is : html + latex"
14 echo " **** [-o dir] : directory where doc have to be put"
15 echo " default is ."
16 exit -1
17 endif
18endif
19#####################################################
20
21##################################
22######## Decode arguments ########
23##################################
24set allmodules = ( SysTools TArray NTools HiStats )
25unset modules; unset latex; unset html; unset man; unset rtf
26set outdir = "."
27if( $#argv >= 1 ) then
28 while ( $#argv > 0)
29 if( "$1" == "-o" ) then
30 shift
31 set outdir = $1
32 else if( "$1" == "-html" ) then
33 set html
34 else if( "$1" == "-latex" ) then
35 set latex
36 else if( "$1" == "-man" ) then
37 set man
38 else if( "$1" == "-rtf" ) then
39 set rtf
40 else
41 if( ! $?modules ) set modules
42 set modules = ( $modules $1 )
43 endif
44 shift
45 end
46endif
47if( ! $?html && ! $?latex && ! $?man && ! $?rtf ) then
48 set html
49 set latex
50endif
51if( ! $?modules ) then
52 set modules = ( $allmodules )
53endif
54
55##########################################
56######## Test de la configuration ########
57##########################################
58
59#------------
60# mydoxy.conf
61#------------
62cp dox_sophya.conf mydoxy.conf
63
64#----------
65# doxygen ?
66#----------
67which doxygen >! /dev/null
68if( $status != 0 ) then
69 echo 'ERROR: doxygen is not installed...'
70 exit -1
71endif
72
73#-------------
74# doxysearch ?
75#-------------
76which doxysearch >! /dev/null
77if( $status != 0 ) then
78 echo 'ERROR: doxysearch is not installed...'
79 exit -2
80else
81 set s = `which doxysearch`
82 echo 'doxysearch is installed in : ' $s:h
83 echo 'mkmf will automatically update the config file.'
84 echo "BIN_ABSPATH = $s:h" >> mydoxy.conf
85 grep 'BIN_ABSPATH' mydoxy.conf | grep -v ^\#
86endif
87
88#-----------------
89# Version number ?
90#-----------------
91set f = ../SysTools/sversion.h
92if( -e $f ) then
93 set v = `grep 'SOPHYA_VERSION' $f | awk '{print $3}'`
94 set r = `grep 'SOPHYA_REVISION' $f | awk '{print $3}'`
95 set t = `grep 'SOPHYA_TAG' $f | awk '{print $3}'`
96 echo "PROJECT_NUMBER = V${v}_R${r}_${t}" >> mydoxy.conf
97else
98 echo "PROJECT_NUMBER = Not_Defined" >> mydoxy.conf
99endif
100grep 'PROJECT_NUMBER = ' mydoxy.conf | tail -1
101
102#---------------
103# What modules ?
104#---------------
105set lf =
106foreach f ( $modules )
107 echo "... Generating doc for ../$f"
108 set lf = ( ../$f $lf )
109end
110echo "INPUT = $lf" >> mydoxy.conf
111grep 'INPUT = ' mydoxy.conf | tail -1
112
113set lf =
114foreach f ( $allmodules )
115 set lf = ( ../$f $lf )
116end
117echo "EXAMPLE_PATH = $lf" >> mydoxy.conf
118
119#-------------------
120# What kind of doc ?
121#-------------------
122if( $?html ) then
123 echo "GENERATE_HTML = YES" >> mydoxy.conf
124 echo "...... generating HTML"
125else
126 echo "GENERATE_HTML = NO" >> mydoxy.conf
127endif
128if( $?latex ) then
129 echo "GENERATE_LATEX = YES" >> mydoxy.conf
130 echo "...... generating LATEX"
131else
132 echo "GENERATE_LATEX = NO" >> mydoxy.conf
133endif
134if( $?man ) then
135 echo "GENERATE_MAN = YES" >> mydoxy.conf
136 echo "...... generating MAN"
137else
138 echo "GENERATE_MAN = NO" >> mydoxy.conf
139endif
140if( $?rtf ) then
141 echo "GENERATE_RTF = YES" >> mydoxy.conf
142 echo "...... generating RTF"
143else
144 echo "GENERATE_RTF = NO" >> mydoxy.conf
145endif
146
147#------------------------
148# What output directory ?
149#------------------------
150echo "OUTPUT_DIRECTORY = $outdir" >> mydoxy.conf
151grep 'OUTPUT_DIRECTORY = ' mydoxy.conf | tail -1
152
153#--------------------------
154# Configuration file update
155#--------------------------
156doxygen -u mydoxy.conf >! /dev/null
157rm -f mydoxy.conf.bak
158
159#########################################
160######## Creation de la Makefile ########
161#########################################
162
163rm -f Makefile
164touch Makefile
165chmod +x Makefile
166cat >> Makefile << EOF_
167all: doc
168
169clean:
170 rm -rf html latex man rtf *.o dox_filter
171
172doc: filter
173 doxygen mydoxy.conf
174
175filter: dox_filter
176
177dox_filter : dox_filter.o
178
179dox_filter.o : dox_filter.c
180
181EOF_
182
183exit 0
Note: See TracBrowser for help on using the repository browser.