source: trunk/etc/YaoI_labo @ 402

Last change on this file since 402 was 285, checked in by lnalod, 14 years ago

Update of YaoI and creation of YaoI_labo in the trunk.

File size: 20.7 KB
Line 
1#!/bin/bash
2
3#######This is a Luigi Nardi improved version of the YaoH script file.
4
5#°°°°°°°°°°°°°°°°°°°°°°Function for move all files generated and quit.
6findir()
7{
8  mkdir -p $YWRKDIR;
9  mv  -f  Yaoext* Y*.cpp Y*~ Y*.o $YWRKDIR
10
11  # si la generation n'est pas demanded, on ne move pas Y1, Y2
12  # et donc, on ne les movent que si la generation est demanded.
13#  if test $OGENER = "1"
14#  then
15    mv -f Y1* Y2* $YWRKDIR
16#  fi
17  exit
18}
19#°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°°
20
21
22#BEGIN of the procédure
23VERS=9
24YNAME=`basename $0`
25VERELDAT="01.11.2008 (release 01.11.2008)"
26
27#=======================================================================
28# Determination de l'architecture materielle pour savoir quelle
29# version de librairies compilees utiliser.
30#=======================================================================
31# Si $YAOARCHI est defini (cela ce fait normalement dans fichier
32# d'environnement .cshrc) ceci definit $MACHINE. Sinon, il faut
33# determiner le type de $MACHINE selon l'architecture materielle :
34#
35#  - Par la commande `uname -s` et,
36#  - si Linux (Mandriva ici au LOCEAN), par le contenu du fichier
37#    /etc/mandriva-release.  Il faut donc adapter cette procedure selon
38#    l'environnement de systeme d'exploitation ...
39MACHINE="UNKNOWN"
40if [ -n "$YAOARCHI" ]; then
41  echo " --> MACHINE TYPE ihnerited from YAOARCHI enviromental variable"
42  MACHINE="$YAOARCHI"
43else
44  echo -n " --> MACHINE TYPE determined now ... "
45  case `uname -s` in
46    Linux)
47    case `cat /etc/mandriva-release` in
48      ( "Mandriva Linux release 2006.0 (Official) for i586" | \
49      "Mandriva Linux release 2006.0 (Community) for i586" ) MACHINE=lnx86 ;;
50      "Mandriva Linux release 2006.0 (Official) for x86_64" ) MACHINE=x86_64 ;;
51      ( "Mandriva Linux release 2007.0 (Official) for i586" | \
52      "Mandriva Linux release 2007.1 (Official) for i586" ) MACHINE=lnx86_Mandriva2007 ;;
53      ( "Mandriva Linux release 2007.0 (Official) for x86_64" | \
54      "Mandriva Linux release 2007.1 (Official) for x86_64" ) MACHINE=x86_64_Mandriva2007 ;;
55      ( "Mandriva Linux release 2008.0 (Official) for i586" | \
56      "Mandriva Linux release 2008.1 (Official) for i586" ) MACHINE=lnx86_Mandriva2008 ;;
57      ( "Mandriva Linux release 2008.0 (Official) for x86_64" | \
58      "Mandriva Linux release 2008.1 (Official) for x86_64" ) MACHINE=x86_64_Mandriva2008 ;;
59      ( "Mandriva Linux release 2009.0 (Official) for i586" | \
60      "Mandriva Linux release 2009.1 (Official) for i586" ) MACHINE=lnx86_Mandriva2009 ;;
61      ( "Mandriva Linux release 2010.0 (Official) for x86_64" | \
62      "Mandriva Linux release 2010.1 (Official) for x86_64" ) MACHINE=x86_64_Mandriva2010 ;;
63      *) cat <<EOF
64
65      ************************************************************
66      *** UNKNOWN LINUX DISTRIBUTION TYPE :
67      ***   <`cat /etc/mandriva-release`>
68      *** See your YAO administrator and give him this message for
69      *** necessary changes in $0 script program.
70      ************************************************************
71
72EOF
73      exit;;
74    esac ;;
75    SunOS)  MACHINE=solaris ;;
76    Darwin) MACHINE=darwin ;;
77    *) cat <<EOF
78
79    ************************************************************
80    *** UNKNOWN LOCAL ARCHITECTURE TYPE (`uname -s`)"
81    *** See your YAO administrator.
82    ************************************************************
83
84EOF
85    exit;;
86  esac
87  echo " <${MACHINE}>."
88fi
89echo
90#============= Traitement des options passées en paramètre =============
91#valeur d'option par defaut
92OHELP="0"
93OGENER="1"
94OPTCPIL=""
95#DBGCPIL=""
96indexec="0"
97indydir="0"
98OCAPSUL="0"
99OECHO="0"
100OLIBFOR="-lgfortran"
101if test $MACHINE = "darwin"
102then
103  OLIBFOR="-L/sw/lib/gcc4.4/lib -lgfortran"
104fi
105
106#verif au moins un parametre
107#nb: le nom du projet est toujours le dernier parametre
108if test -z $1
109then
110  #echo " > missing parameter, syntaxe: $YNAME {-h, [-g][{-O0, -O1, -O2, -O3}] prj}"
111  cat <<EOF
112
113  > Missing parameter, syntaxe:
114  > $YNAME { -h, [+"optionType"] [-x execName] [-d directory] [-s] [-e] [-lg2c] prjName }
115  >
116  > Options:
117  > -h            show a YAO help.
118  > +optionType   option to be added directly at compilation time (it is translated in -optionType), i.e. +g add the option for DBG.
119  > -d            directory to define a different ROOT destination directory. The default ROOT is the current directory.
120  >               The generated files are always created in "ROOT/Yworkdir/".
121  > -x            execName to define a different executable name. The default is the name of the application.
122  > -s            encapsulation (performed with the creation of a namespace).
123  > -e            echo of the compilation and the link.
124  > -lg2c         the specification of the fortran library.
125  > -p            enable the parallelization (openMP must be installed on the machine).
126  > prjName       is the project name.
127EOF
128  exit
129fi
130
131#boucle sur les parametres
132for i
133do
134  #-----> Help required ? on demande juste de l'aide
135  if test $i = "-h"
136  then
137    OHELP="1"
138  fi
139  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
140
141  # -g option for the GNU debuger (GDB). This option is copied directly in the compilation command g++.
142  # It is not needed because if we want the GDB we write the "+g" option and this is copied at compilation time.
143  #if test $i = "-g"
144  #            then
145  #               DBGCPIL="-g"
146  #            fi
147  #            echo "DBGCPIL = " $DBGCPIL
148  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149
150  #  Options de compilation ???????????????
151  if test ${i:0:1} = "+"
152  then
153    OPTCPIL=$OPTCPIL$i
154  fi
155  #echo "OPTCPIL = " $OPTCPIL (cf ci apres, transformation des options de compil
156  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
157  #-----> Avant l'Executable avait le meme nom que prj (=dernier parametre),
158  #maintenant ce sera par default, et il peut etre changed avec l'option -x
159  if test $indexec = "1"
160  then
161    EXECNAME=$i
162    indexec="0"
163  fi
164  if test $i = "-x"
165  then
166    indexec="1"
167  fi
168  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
169  #-----> Changement du Repertoire YAO
170  if test $indydir = "1"
171  then
172    YAODIR=$i
173    indydir="0"
174  fi
175  if test $i = "-d"
176  then
177    indydir="1"
178  fi
179  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
180  #-----> Encapsulation (spacename) ou pas
181  if test $i = "-s"
182  then
183    OCAPSUL="1"
184  fi
185  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
186  #-----> Echo de la Compil et du Link
187  if test $i = "-e"
188  then
189    OECHO="1"
190  fi
191  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
192  #-----> Librairie Fortran
193  if test $i = "-lg2c"
194  then
195    OLIBFOR="-lg2c"
196  fi
197  #^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
198  #-----> Parallelism openMP
199  if test $i = "-p"
200  then
201    PARALLEL="-fopenmp"
202  fi
203   #=====> Fin Boucle de traitement des Parametres
204done
205
206prj=`basename $i .d`
207#=======================================================================
208#bibliothèque YAODIR (pour objets YAO)
209#desormais pour changer le repertoire yao, on peut utiliser l'option -d
210if test ${#YAODIR} -eq 0
211then
212  echo "YAO directory variable not declared...current dir used"
213  YAODIR="."
214fi
215#
216if test ! -d ${YAODIR}
217then
218  echo "$YAODIR : invalid or unavailable YAO directory"
219  exit
220fi
221#-----------------------------------------------------------------------
222#BINDIR=${YAODIR}/yao${VERS}/product/bin/${MACHINE}
223
224#BINDIR=${YAODIR}/yao${VERS}/yao/bin/${MACHINE}
225#INCDIR=${YAODIR}/yao${VERS}/yao/include
226BINDIR=${YAODIR}/yao/bin/${MACHINE}
227INCDIR=${YAODIR}/yao/include
228
229
230
231#BINDIR=${YAODIR}/yao${VERS}/bin/${MACHINE}
232#INCDIR=${YAODIR}/yao${VERS}/include
233#
234#=======================================================================
235# On revient sur le traitement des paramètres
236#----> on demande juste de l'aide
237if test $OHELP = "1"
238then
239  #${BINDIR}/Yao${VERS} -h
240  ${BINDIR}/Yao${VERS}Generator -h
241  #Yao9Generator -h
242  exit
243fi
244
245#----> dernier parametre = prj (doit exister eventuellement avec .d)
246#echo "last parm: $i"
247#prj=$i
248#if !(test -e $prj)
249#then
250if !(test -e $prj.d)
251then
252  echo " description file $prj(.d) not found"
253  exit
254fi
255#fi
256
257#----> nom de l'exe : exename ; s'il n'est pas affected alors c'est prj
258if test -z $EXECNAME
259then
260  EXECNAME=$prj
261fi
262
263#----> on transforme les options de compilation
264OPTCPIL=`echo $OPTCPIL | sed 's/+/ -/g'`
265
266#----> more verif on parameters
267#--> si sans generation, les fichiers Y1 et Y2 doivent etre dans le repertoire courant
268if test $OGENER = "0"
269then
270  if !(test -e Y1$prj.h) || !(test -e Y2$prj.h)
271  then
272    echo "file Y1$prj.h or Y2$prj.h missing"
273    exit
274  fi
275fi
276
277#=======================================================================
278#-----------------------------------------------------------------------
279#bibliotheque YADFDIR pour la derivation automatique
280#YADFDIR=${YAODIR}/etc/bin/${MACHINE}
281#YADFDIR=${YAODIR}/yao${VERS}/etc/bin/${MACHINE}
282YADFDIR=${YAODIR}/etc/bin/${MACHINE}
283
284#-----------------------------------------------------------------------
285#une bibliotheque de travail pour ne pas etre embarassed par les codes generes
286YWRKDIR="./Yworkdir"
287
288#-----------------------------------------------------------------------
289# Compiler Global Variables:
290#-----------------------------------------------------------------------
291CC=
292CFLAGS=
293CXX="g++"
294#CXXFLAGS=" ${OPTCPIL} ${DBGCPIL} -Wall -DLINUXPC -Wno-deprecated -Wno-write-strings -I${INCDIR}"
295CXXFLAGS=" ${OPTCPIL} ${DBGCPIL} -Wall -DLINUXPC -Wno-deprecated -Wno-write-strings -I${INCDIR}"
296if test $MACHINE = "darwin"
297then
298  CXXFLAGS=${CXXFLAGS}" -I/sw/include"
299fi
300NETCDFINCDIR=/usr/include
301if [ -f  ${NETCDFINCDIR}/netcdf.h ]; then
302  CXXFLAGS=${CXXFLAGS}" -I${NETCDFINCDIR}"
303else
304  NETCDFINC=`echo ${NETCDFINCDIR}/netcdf* | awk '{ print $1 }'`
305  if [ -d ${NETCDFINC} ]; then
306    NETCDFINCFIC="${NETCDFINC}/netcdf.h"
307    if [ -f ${NETCDFINCFIC} ]; then
308      CXXFLAGS=${CXXFLAGS}" -I${NETCDFINC}"
309    fi
310  fi
311fi
312
313#-----------------------------------------------------------------------
314# LDFLAGS:
315# Test d'existence de la bibliotheque NetCDF
316NETCDFLIBDIR=/usr/lib
317NETCDFLIB=`echo ${NETCDFLIBDIR}/libnetcdf* | awk '{ print $1 }'`
318if test -e ${NETCDFLIB}
319then
320  LDFLAGS=" -lm ${OLIBFOR} -L${NETCDFLIBDIR} -lnetcdf"
321else
322  NETCDFLIBDIR=/usr/lib/local
323  NETCDFLIB=`echo ${NETCDFLIBDIR}/libnetcdf* | awk '{ print $1 }'`
324  if test -e ${NETCDFLIB}
325then
326  LDFLAGS=" -lm ${OLIBFOR} -L${NETCDFLIBDIR} -lnetcdf"
327else
328  NETCDFLIBDIR=/sw/lib
329  NETCDFLIB=`echo ${NETCDFLIBDIR}/libnetcdf* | awk '{ print $1 }'`
330  if test -e ${NETCDFLIB}
331then
332  LDFLAGS=" -lm ${OLIBFOR} -L${NETCDFLIBDIR} -lnetcdf"
333else
334  NETCDFLIBDIR=/usr/lib64
335  NETCDFLIB=`echo ${NETCDFLIBDIR}/libnetcdf* | awk '{ print $1 }'`
336  if test -e ${NETCDFLIB}
337then
338  LDFLAGS=" -lm ${OLIBFOR} -L${NETCDFLIBDIR} -lnetcdf"
339else
340  LDFLAGS=" -lm ${OLIBFOR}"
341fi
342           fi
343         fi
344       fi
345
346       #=======================================================================
347       #bibliothèque MQNDIR (pour libreries M1QN3 et M2QN1)
348       if test ${#MQNDIR} -eq 0
349       then
350         echo "MQNDIR directory variable not declared ..."
351         echo "standard directory"
352         MQNDIR="${YAODIR}/yao/share/inria/"
353        fi
354         if test $OLIBFOR = "-lg2c"
355       then
356         BINMQN="${MQNDIR}/bin/mdk"
357       else
358         BINMQN="${MQNDIR}/bin/${MACHINE}"
359       fi
360       LDMQN=" -L${BINMQN} -lmqn"
361
362       #-----------------------------------------------------------------------
363       FC="g77"
364       #FFLAGS=" -Dkey_4dvar ${OPTCPIL} ${DBGCPIL} -Wall"
365       FFLAGS=" -Dkey_4dvar ${OPTCPIL} -Wall"
366       #
367       #CPPFLAGS=
368       #-----------------------------------------------------------------------
369
370       cat <<EOF
371       ====================================================================
372                    $YNAME V.$VERS : PROJECT CREATION PROCEDURE                   
373                    $VERELDAT                         
374       ====================================================================
375        `printf "LOCAL MACHINE BINARY TYPE FOUND ..... %-28s" "<$MACHINE>"`
376       ====================================================================
377
378EOF
379
380       #-----------------------------------------------------------------------
381       echo " > Run of $YNAME for project :" $prj
382       #noms des sources
383       Ympp=Ymain_$prj.cpp
384       Y1h=Y1$prj.h
385       Y2h=Y2$prj.h
386       Y3l=Y3$prj.l
387       Y3h=Y3$prj.h
388       Ycpp=Y$prj.cpp
389
390       #=======================================================================
391       #Test: we regenerate or not? This test is automatic looking the dates of the files.
392       #Default is OGENER = "1": regenerate.
393       if test $YWRKDIR/${Y1h} -nt ${prj}.d
394       then
395         if test $YWRKDIR/${Y2h} -nt ${prj}.d
396         then OGENER="0"
397           echo " > HEADERS generation not required: "
398           echo " >   the description file has not changed from the last generation of $Y1h and $Y2h."
399           echo " >   Pay attention all the warning showed in the generation process are not been displayed this way because of the non regeneration."
400           echo " >   If you want to force the regeneration remove the Yworkdir/ directory."
401           cp $YWRKDIR/$Y1h .
402           cp $YWRKDIR/$Y2h .
403           if test -e $YWRKDIR/Yaoext_$prj
404           then
405             cp $YWRKDIR/Yaoext_$prj .
406           fi
407         fi
408        fi
409       # Remark: maybe we should consider also Yaoext_projName for the regeneration option.
410
411       #ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
412       if test $OGENER = "1";
413       then
414         echo " > enter proc generation "
415
416         # sauvegarde (mv~) des Y1prjname.h Y2prjname.h et Yprjname.cpp ...
417         # (i.e de tout ce qui est genere, sauf Y3) s'ils existent
418         if test -e $YWRKDIR/$Y1h;
419         then
420           mv -f $YWRKDIR/$Y1h $YWRKDIR/$Y1h~
421           echo " > $Y1h moved as \~"
422         fi
423         if test -e $YWRKDIR/$Y2h;
424         then
425           mv -f $YWRKDIR/$Y2h $YWRKDIR/$Y2h~
426           echo " > $Y2h moved as \~"
427         fi
428         ##Y3h: pour les derivees automatiques la gestion est differente
429         if test -e $YWRKDIR/$Y3l;
430         then
431           mv -f $YWRKDIR/$Y3l $YWRKDIR/$Y3l~
432           echo " > $Y3l moved as \~"
433         fi
434         #
435         #Ympp=Y$prj.cpp
436         if test -e $YWRKDIR/$Ycpp;
437         then
438           mv -f $YWRKDIR/$Ycpp $YWRKDIR/$Ycpp~
439           echo " > $Ycpp moved as \~"
440         fi
441         if test -e $YWRKDIR/$Ympp;
442         then
443           mv -f $YWRKDIR/$Ympp $YWRKDIR/$Ympp~
444           echo " > $Ympp moved as \~"
445         fi
446         # idem pour les .o et l'executable
447         if test -e $YWRKDIR/Y$prj.o;
448         then
449           mv -f $YWRKDIR/Y$prj.o $YWRKDIR/Y$prj.o~
450           echo " > Y$prj.o moved as \~"
451         fi
452         if test -e $YWRKDIR/Ymain_$prj.o;
453         then
454           mv -f $YWRKDIR/Ymain_$prj.o $YWRKDIR/Ymain_$prj.o~
455           echo " > Ymain_$prj.o moved as \~"
456         fi
457         if test -e $prj;
458         then
459               mv -f $prj $YWRKDIR/$prj~
460               echo " > $prj moved as \~"
461         fi
462         if test -e $EXECNAME;
463         then
464           mv -f $EXECNAME $YWRKDIR/$EXECNAME~
465           echo " > $EXECNAME moved as \~"
466         fi
467         if test -e $YWRKDIR/Yaoext_$prj
468         then
469           mv -f $YWRKDIR/Yaoext_$prj $YWRKDIR/Yaoext_$prj~
470           echo " > Yaoext_$prj moved as \~"
471         fi
472
473         #---------------------------------------------------------------------
474         # Lancement de la GENERATION : appel de Yao9Generator
475         # creation des header (Y1prjname.h et Y2prjname.h, et autres ...) du projet
476         # if Yao8 $Yd        desormais, c'est Yao qui, si besoin, formatera un .d
477         
478         # if ${BINDIR}/Yao${VERS} $prj  # old version
479         # if ./Yao9Generator $prj
480         # if ./Yao${VERS}Generator $prj
481
482           BEGIN_TIME=`date +%s`
483           if ${BINDIR}/Yao${VERS}Generator $prj 
484           then
485             END_TIME=`date +%s`
486             echo " > Execution time of the Yao code generator..."$(($END_TIME-$BEGIN_TIME)) second\(s\)
487             echo " > headers are now created"
488           else echo " > PROJECT HEADERS CREATION FAILED"
489             findir
490           fi
491         
492         #---------------------------------------------------------------------
493         # creation des derivees automatique (Y3prjname.h) pour les modules de la liste (Y3prjname.l)
494         if test -e $Y3l
495         then
496           if ${YADFDIR}/ylmodf $Y3l $Y3h 1
497           then echo " > automatic differenciation done"
498           else echo " > AUTOMATIC DIFFERENCIATION FAILED"
499             findir
500           fi
501         fi
502
503         #ggggggggggggggggggggggggggggg
504         echo " > end proc generation "
505       fi
506       # fin de la génération
507       #ggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggggg
508
509       #=======================================================================
510       #ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
511       echo " > enter proc construct "
512
513       #------- inclusion d'eventuels objets (.o) externes dont la liste aura ete
514       # produite par la directive option O_EXTOBJ
515       #if test -e "YaoEXT"
516       if test -e Yaoext_$prj
517       then
518         echo " Extern object : "
519         #source Yaoext_$prj
520         .       Yaoext_$prj
521         echo "                ${LDYEXTOBJ}"
522       fi
523
524       #-----------------------------------------------------------------------
525       # création (i.e construction) du source complet du projet
526       # integration du 1er header (include define at autres ...)
527       cat ${INCDIR}/Dynide.h           > $Ycpp
528       #-----------
529       # on ajoute eventuellement un 1er additionnel utilisateur
530       # avant l'encapsulation (namespace) de l'application
531       Uadd=$prj"03.h"
532       if test -e $Uadd;
533       then
534         cat $Uadd               >> $Ycpp
535       fi
536       #-----------
537       if test $OCAPSUL = "1"
538       then
539         # on encapsule l'appli dans un namespace
540         echo "/////////////////////////////////////////////////////////////////" >> $Ycpp
541         echo "namespace YAP__$prj {   //debut du domaine " >> $Ycpp
542         echo "/////////////////////////////////////////////////////////////////" >> $Ycpp
543       fi
544       #-----------
545       # on complete la suite du header de
546       cat ${INCDIR}/Dynamo.h           >> $Ycpp
547       #-----------
548       # integration du projet (les 2 header créés par Yao8 (+adf) et de son nom et version
549       echo "#include \"$Y1h\" "               >> $Ycpp
550       if test -e $Y3h;
551       then
552         echo "#include \"$Y3h\" "               >> $Ycpp
553       fi
554       echo "#include \"$Y2h\" "               >> $Ycpp
555       echo "#define PRJNAME  \"$prj\" "       >> $Ycpp
556       #echo "#define VERREF   \"$YNAME V.$VERS $VERELDAT $OPTCPIL $DBGCPIL \" "        >> $Ycpp
557       echo "#define VERREF   \"$YNAME V.$VERS $VERELDAT $OPTCPIL \" "        >> $Ycpp
558       #
559       # integration du main
560       cat ${INCDIR}/Dynamo.cpp                >> $Ycpp
561       #
562       if test $OCAPSUL = "1"
563       then
564         # fin de l'encapsulage de l'appli
565         echo "/////////////////////////////////////////////////////////////////" >> $Ycpp
566         echo "}                     //fin du domaine " >> $Ycpp
567         echo "/////////////////////////////////////////////////////////////////" >> $Ycpp
568         #
569         # maintenant, il faut cree et ajouter la fonction de lancement
570         echo "int Ygo_$prj (int argc, char *argv[])"  >> $Ycpp
571         echo "{   YAP__$prj::Yentry0 (argc, argv); return(0);}"       >> $Ycpp
572         #
573       fi
574       # on ajoute eventuellement un 2eme additionnel utilisateur (apres l'encapsulation)
575       Uadd=$prj"07.h"
576       if test -e $Uadd;
577       then
578         cat $Uadd               >> $Ycpp
579       fi
580       #-----------------------------------------------------------------
581       # On cree de toute piece le 'vrai' main de l"application, dans un .cpp cette fois !!!
582       if test $OCAPSUL = "1"
583       then
584         echo "extern int Ygo_$prj (int argc, char *argv[]);" > $Ympp
585         echo "int main(int argc, char *argv[])"       >> $Ympp
586         echo "{   Ygo_$prj (argc, argv); return(0); }" >> $Ympp
587       else
588         echo "extern int Yentry0 (int argc, char *argv[]);" > $Ympp
589         echo "int main(int argc, char *argv[])"       >> $Ympp
590         echo "{   Yentry0 (argc, argv); return(0); }" >> $Ympp
591       fi
592
593       #-----------------------------------------------------------------------
594       echo " > end proc construction "
595       #ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
596
597       #=======================================================================
598       #-----------------------------------------------------------------------
599       #                     compilation et édition des liens
600       echo " > start compilation "
601       # //--------------------------------------------------------------------
602       # création de l'executable
603       #
604       #compilation du projet.c
605       if test $OECHO = '1'
606       then
607         echo "${CXX} ${CXXFLAGS} ${PARALLEL} -c $Ympp $Ycpp"
608       fi
609       ${CXX} ${CXXFLAGS} ${PARALLEL} -c $Ympp $Ycpp
610       echo " > end of compilation, start linking "
611
612       # 2) link
613       if test $OECHO = '1'
614       then
615         echo " ${CXX} ${CXXFLAGS} ${PARALLEL} -o $EXECNAME Ymain_$prj.o Y$prj.o ${LDMQN} ${LDYEXTOBJ} ${LDFLAGS}"
616       fi
617       if ${CXX} ${CXXFLAGS} ${PARALLEL} -o $EXECNAME Ymain_$prj.o Y$prj.o ${LDMQN} ${LDYEXTOBJ} ${LDFLAGS}
618     then
619       echo
620       echo "       =======================  PROJECT IS NOW READY  ====================="
621     else
622       echo
623       echo " > unpredictable mistakes : PROJECT BUILDING FAILED"
624       echo
625       findir
626     fi
627     
628     cat<<EOF
629                           $YNAME V.$VERS : END OF PROCEDURE                     
630                           $VERELDAT                 
631       ====================================================================
632                           TOTAL COMPILATION TIME : $SECONDS second(s)           
633       ====================================================================
634
635EOF
636     findir
637     #===============================================================================
Note: See TracBrowser for help on using the repository browser.