/* All targets are listed here - 1st one is the default */ /* echo "PRIMARY_TARGET E = " [PRIMARY_TARGET][E]; */ /* [PRIMARY_TARGET][E] = [mod_files] [obj_files]; */ [PRIMARY_TARGET][E]: [obj_files]; /* build PRIMARY_TARGET */ /* tryit: cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] [fromto %O%[F1] %0%.mod [filter %0%[F1] [mod_src_files] ]]; */ all: /* note that the "all" target doesn't auto pass DEBUG, OPT or other flags */ { cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] [fromto %O%[F1] %0%.mod [filter %0%[F1] [mod_src_files] ]]; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] weps; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] tsterode; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] tsthydro; } /* This target is intended to build a "public" release of WEPS */ /* It will verify that the local copy is up-to-date with the */ /* repository. If files need to be "cvs committed" it will not build. */ weps_release: { /* make sure that we have a valid [RELEASE] string here (not zero) */ if [ matches 0 [RELEASE] ] then {fail;} /* Make sure that we have "cvs committed" all of our local changes */ /* If not, then quit and do them manually first since we don't want */ /* to tag the files until they are committed */ if [ execute cd ..\; cvs -q stat | egrep -e "Needs\\|Modified" ] then { fail; } /* need to do a "cvs tag [RELEASE]" here */ /* Can't seem to get cvs to return a zero exit value - LEW */ /* if [ execute cd ..\; cvs -Q tag [RELEASE] ] then { fail; } */ /* Will brute force tag now and assume it runs to completion for now */ /* execute cd ..\; cvs -Q tag [RELEASE] ; */ if [ execute cd ..\; cvs -Q tag [RELEASE] ] then { ; } /* clean things out so that a good "public" build release is generated */ cook clean; cook "OPT=1" "RELEASE="[RELEASE] weps; rm -ri ../install\/*; /* ask before cleaning out "install" directory */ /* copy things into "install" directory structure as necessary */ cp weps[E] ../install; } install: [PRIMARY_TARGET][E] { mv [PRIMARY_TARGET][E] [BIN]; } /* "cook DEBUG=2 weps_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ weps_debug: { /* cook clean; */ echo [src_files] > debug_compile.l95; [FC] -I \"[INC]\;[dos-path [dirname %0]]\" [FC_FLAGS] -chk \\(a,e,s,u,x\\) -chkglobal -g -pca -stchk -trace -w -info -fullwarn @debug_compile.l95 -out weps_dbg.exe; } /* "cook DEBUG=2 weps_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ tsterode_debug: { /* cook clean; */ echo [tsterode_src_files] > debug_compile.l95; [FC] -I \"[INC]\;[dos-path [dirname %0]]\" [FC_FLAGS] -chk \\(a,e,s,u,x\\) -chkglobal -g -pca -stchk -trace -w -info -fullwarn @debug_compile.l95 -out tsterode_dbg.exe; } /* currently the "print" targets work only for Unix */ print: print_src print_inc /* default "print" target */ print_src: /* print all PRIMARY_TARGET Fortran code */ { a2ps -d [src_files]; } print_inc: /* print all PRIMARY_TARGET Fortran include files */ { a2ps -d [inc_files]; } clean: /* get all those intermediate files */ { rm -f [BIN]/[PRIMARY_TARGET][E] [PRIMARY_TARGET][E] [obj_files] set clearstat; } clobber: clean /* get those "dependency" files as well */ { rm -f [dep_files] set clearstat; } testing0: /* echo a few variables to the screen for debugging */ { echo I am here in the testing recipe.; echo "os machine is: " [os machine]; echo "WEPS_COMPILER is: " [getenv WEPS_COMPILER]; echo "PRIMARY_TARGET is: " [PRIMARY_TARGET]; echo "BIN directory is: " [BIN]; echo "TARGET_BIN directory is: " [TARGET_BIN]; echo "INC directory is: " [INC]; echo "TARGET_INC directory is: " [TARGET_INC]; echo "Fortran source files extension is: " [F]; echo "Fortran source files extension is also: " [F1]; } testing1: /* echo a few variables to the screen for debugging */ { echo "src_dirs is: " [src_dirs]; echo "src_files is: " [src_files]; echo "obj_files is: " [obj_files]; /* echo "src_dirs_lib is: " [src_dirs_lib]; */ echo "dep_files are: " [dep_files]; echo "BIN/[PRIMARY_TARGET][E]_obj is: " [BIN]/[PRIMARY_TARGET][E]_obj; echo "bin/[PRIMARY_TARGET][E]_obj is: " [[BIN]/[PRIMARY_TARGET][E]_obj]; } testing2: { /* echo "target_obj is: " [target]_obj]; */ echo name [downcase [PRIMARY_TARGET][E]] > link.wcm; echo file [subst \\ \\\\ [dos-path [[PRIMARY_TARGET][E]_obj]]] >> link.wcm; /* echo file [[PRIMARY_TARGET][E]_obj] >>! link.wcm; */ } ToUnix: /* remove CR from all *.for, *.inc, *.fi and *.d files */ { /* Should be careful as it could remove all of our files */ /* if this is modified incorrectly! */ tmp_files = [src_files] [inc_files]; loop { t_file = [firstword [tmp_files]]; if [not [t_file]] then loopstop; tmp_files = [tail [tmp_files]]; sed -f cookbook/stripCR.sed < [t_file] > xx.tmp; /* cmp -s returns a non zero value if the files were different */ if [ not [execute cmp -s [t_file] xx.tmp ]] then mv xx.tmp [t_file]; } unlink xx.tmp; } ToUnix2: /* remove CR from all *.for, *.inc, *.fi and *.d files */ { /* Should be careful as it could remove all of our files */ /* if this is modified incorrectly! */ tmp_files = [src_files] [inc_files] [dep_files]; loop { t_file = [firstword [tmp_files]]; if [not [t_file]] then loopstop; tmp_files = [tail [tmp_files]]; tr -d "\r" < [t_file] >! xx.tmp; /* cmp -s returns a non zero value if the files were different */ if [ not [execute cmp -s [t_file] xx.tmp ]] then mv xx.tmp [t_file]; } unlink xx.tmp; }