/* cook.weps cookbook for WEPS directory structure access by cook */ manifest = ; /* all files in [subdirs] */ src_files = ; /* all Fortran src ".for" files */ inc_files = ; /* all include ("*.inc", "*.fi", & ".wat") files */ obj_files = ; /* all object ".o" or ".obj" files */ dep_files = ; /* all dependency ".d" or ".dep" files */ I1 = .inc; I2 = .fi; I3 = .wat; /* Using the util/templates/bd_date.for file, insert the build date and put modified copy in the util/build/bd_date.for file */ rm -f util/build/bd_date.for; sed -e s,Unknown,\"`date`\", util/templates/bd_date.for > util/build/bd_date.for; /* Before determining all the src files, update as necessary the build date and release/version files */ /* RELEASE is now defined to be zero if originally undefined - thus code here eventually needs changed - LEW */ #ifndef RELEASE /* If no release is specified, copy over the template file */ cp util/templates/rel_ver.for util/build/rel_ver.for; #else rm -f util/build/rel_ver.for; sed -e s,Unknown,\"[RELEASE]\", util/templates/rel_ver.for > util/build/rel_ver.for; #endif /* extract all files from [src_dirs] (one level deep) */ tmp = [src_dirs]; /* tmp variable for use in loop */ loop { tmp_dir = [head [tmp]]; if [not [tmp_dir]] then loopstop; /* remove first (word) from list each time through loop */ tmp = [tail [tmp]]; /* create manifest (list of all files) in [srcdirs] */ manifest += [glob [tmp_dir]"/*"]; } /* extract all files from [inc_dirs] (one level deep) */ tmp = [inc_dirs]; /* tmp variable for use in loop */ loop { tmp_dir = [head [tmp]]; if [not [tmp_dir]] then loopstop; /* remove first (word) from list each time through loop */ tmp = [tail [tmp]]; /* create manifest (list of all files) in [incdirs] */ manifest += [glob [tmp_dir]"/*"]; } src_files = [match_mask %0%[F] [manifest] ]; /* remove the MAIN subroutine for weps target (weps.for) when PRIMARY_TARGET is something else (eg. tsterode target MAIN routine is erosion/test/tsterode.for) We may want to move the WEPS main routine into a different dir. */ #if [not [matches weps [PRIMARY_TARGET]]] src_files = [stringset [src_files] - main/weps.for]; #endif inc_files = [match_mask %0%[I1] [manifest]]; inc_files += [match_mask %0%[I2] [manifest]]; inc_files += [match_mask %0%[I3] [manifest]]; obj_files = [fromto %0%[F] %0%[O] [src_files]]; dep_files = [addsuffix [D] [src_files] [inc_files]]; /* #if [ [not [matches %1clean [command-line-goals]]] && [not [matches %1clobber [command-line-goals]]]] */ #if [matches %1clean [command-line-goals]] /* do not load dependency file checks */ #elif [matches %1clobber [command-line-goals]] /* do not load dependency file checks */ #else #include-cooked-nowarn [dep_files] #endif /* create variable for WEPS obj file list */ [PRIMARY_TARGET]_obj = [obj_files]; [PRIMARY_TARGET][E]_obj = [obj_files]; [TARGET_BIN]/[PRIMARY_TARGET][E]_obj = [obj_files];