/* All targets are listed here - 1st one is the default */ /* echo "PRIMARY_TARGET E = " [PRIMARY_TARGET][E]; */ /* [PRIMARY_TARGET][E] = [module_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] [module_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] [module_src_files] ]]; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] weps; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] tstsoil; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] tsterode; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] tsthydro; cook [stringset [command-line-goals] - all] "OPT="[OPT] "DEBUG="[DEBUG] weps_driver; } /* 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 tsterode_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; } /* "cook DEBUG=2 season_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ season_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 season_dbg.exe; } /* "cook DEBUG=2 tstsoil_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ tstsoil_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 tstsoil_dbg.exe; } /* "cook DEBUG=2 tstpmat_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ tstpmat_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 tstpmat_dbg.exe; } /* "cook DEBUG=2 tstasd_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ tstasd_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 tstasd_dbg.exe; } /* "cook DEBUG=2 test_crop_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ test_crop_debug: { /* cook clean; */ /* echo [test_crop_src_files] > debug_compile.l95; */ echo [src_files] > debug_compile.l95; function print "COMPILING src_files: " [src_files]; [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 test_crop_dbg.exe; } /* "cook DEBUG=2 tstinternode_debug" is intended to do a clean "global" debug build */ /* It is intended that one always use the DEBUG=2 option to cook */ tstinternode_debug: { /* cook clean; */ /* echo [test_crop_src_files] > debug_compile.l95; */ echo [src_files] > debug_compile.l95; function print "COMPILING src_files: " [src_files]; [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 tstinternode_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; rm -rf *.mod *.fwd *.map *.ydg *[O]; #if [matches CYGWIN%1 [UNIX_SYS]] rm -f *[E]; set clearstat; #endif } 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; } /* weps_src.zip: { mkdir weps_src weps_src/src weps_src/inc; cp [src_files] weps_src/src; cp --parents [inc_files] weps_src; find weps_src -name \"*\" -print | zip weps_src -@; rm -rf weps_src; } */ test_crop_src.zip: { mkdir test_crop_src test_crop_src/src test_crop_src/inc; cp [test_crop_src_files] test_crop_src/src; cp --parents [inc_files] test_crop_src; find test_crop_src -name \"*\" -print | zip test_crop_src -@; rm -rf test_crop_src; } tsterode_src.zip: { svn export http://svn.weru.ksu.edu/weru/weps/weps.src/tsterode tsterode_src; /* svn export svn.weru.ksu.edu/weru/weps/weps.src/tsterode tsterode_src; svn export svn.weru.ksu.edu/weru/weps/weps.src/cookfile tsterode_src; mkdir tsterode_src/util; mkdir tsterode_src/util/build; mv tsterode_src/util_date tsterode_src/util/date; mv tsterode_src/util_misc tsterode_src/util/misc; mv tsterode_src/util_templates tsterode_src/util/templates; zip -r tsterode_src tsterode_src; rm -rf tsterode_src; */ } weps_src.zip: { which svn; svn export http://svn.weru.ksu.edu/weru/trunk/weps/weps.src weps_src; zip -r weps_src weps_src; rm -rf weps_src; }