/* Recipes for building WEPS with Unix f95 compiler */ /* Must precede other "compile" recipes - cook sees them in the order they exist */ /* FC MODULE "compile" recipe (for .for files) */ %0%.mod: { /* determine the src file for the module */ module_src_files = [shell grep -i -l '"^[ ]*MODULE"' [src_files] ]; /* function print "module_src_files: " [module_src_files]; */ tmp_files = [module_src_files]; loop { t_file = [head [tmp_files]]; if [not [t_file]] then loopstop; tmp_files = [tail [tmp_files]]; if [match_mask % [basename [entryname [t_file]]]] then { t_dir = [dirname [t_file]]; [FC] -I[t_dir] -I%0. [FC_IFLAGS] [FC_FLAGS] -c [t_file] -o [t_dir]/%[O]; loopstop; } } } /* FC "compile" recipe (for .for files) */ %0%[O]: %0%[F] { [FC] -I%0. [FC_IFLAGS] [FC_FLAGS] -c %0%[F] -o [target]; } /* FC "compile" recipe (for .f95 files) */ %0%[O]: %0%[F1] { [FC] -I%0. [FC_IFLAGS] [FC_FLAGS] -c %0%[F1] -o [target]; } /* FC "library build" recipe */ %0[LIB_PREFIX]%[A]: [[target]_obj] set unlink { [AR] [AR_FLAGS] [target] [[target]_obj]; } /* FC "link" recipe */ [TARGET_BIN]/%: [[target]_obj] set mkdir { /* echo "target_obj is: " [[target]_obj]; */ [LD] [LD_FLAGS] [[target]_obj] -Xlinker --start-group [LD_LIBS] -Xlinker --end-group -o [target]; } function print "LD:"[LD]; function print "LD_IFLAGS:" [LD_IFLAGS]; function print "LD_FLAGS:" [LD_FLAGS]; function print "LD_LIBS:"[LD_LIBS]; function print "LD_LIBSgoup:" -Xlinker --start-group [LD_LIBS] -Xlinker --end-group ; /* FC "link" recipe */ %: [ [downcase [target]]_obj] set mkdir { /* echo "target_obj is: " [[target]_obj]; */ [LD] [LD_FLAGS] [[target]_obj] -Xlinker --start-group [LD_LIBS] -Xlinker --end-group -o [downcase [target]]; }