/* Recipes for building WEPS with Lahey F95 compiler */ UNIX_SYS = [shell uname -s]; setenv UNIX_SYS = [UNIX_SYS]; #if [in [UNIX_SYS] Linux ] /* Must precede other "compile" recipes - cook sees them in the order they exist */ /* FC MODULE "compile" recipe (to create .mod files) */ %0%.mod: { /* determine the src file for the module */ 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 [INC] -I [dirname %0] [FC_FLAGS] -c [t_file] -o [t_dir]/%[O]; loopstop; } } } /* FC "compile" recipe (for .for files) */ %0%[O]: %0%[F] { [FC] -I[INC] -I[dirname %0] [FC_FLAGS] -c %0%[F] -o [target]; } /* FC "compile" recipe (for .f95 files) */ %0%[O]: %0%[F1] { [FC] -I[INC] -I[dirname %0] [FC_FLAGS] -c %0%[F1] -o [target]; } %0[LIB_PREFIX]%[A]: [[target]_obj] set unlink { [AR] [AR_FLAGS] [target] [[target]_obj]; } [BIN]/%: [[target]_obj] set mkdir { /* echo "target_obj is: " [[target]_obj]; */ [LD] [LD_FLAGS] name [target] file [[target]_obj]; } %: [ [downcase [target]]_obj] set mkdir { [LD] [LD_FLAGS] [[target]_obj] -o [downcase [target]]; } #elif [in [UNIX_SYS] SunOS ] /* We have no Layhey compiler for Sun's yet */ #else /* #if [in [UNIX_SYS] CYGWIN_NT-4.0 ] */ /* We now assume it is CYGWIN_NT-4.0, CYGWIN_NT-5.0, or CYGWIN_NT-5.1 */ /* Must precede other "compile" recipes - cook sees them in the order they exist */ /* FC MODULE "compile" recipe (for creating .mod files) */ %0%.mod: { /* function print "COMPILE target:dependency is: " %0%.mod ; */ /* determine the src file for the module */ 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 \"[dos-path [t_dir]]\;[INC]\;[dos-path [dirname %0]]\" [FC_FLAGS] -c [t_file] -o [t_dir]/%[O]; loopstop; } } } /* FC "compile" recipe (for .for files) */ %0%[O]: %0%[F] { /* function print "COMPILE target:dependency is: " %0%[O]":"%0%[F]; */ [FC] -I \"[INC]\;[dos-path [dirname %0]]\" [FC_FLAGS] -c %0%[F] -o [target]; } /* FC "compile" recipe (for .f95 files) */ %0%[O]: %0%[F1] { /* function print "COMPILE target:dependency is: " %0%[O]":"%0%[F1]; */ [FC] -I \"[INC]\;[dos-path [dirname %0]]\" [FC_FLAGS] -c %0%[F1] -o [target]; } /* Not currently used, thus not tested */ /* FC "library build" recipe */ %0[LIB_PREFIX]%[A]: [[target]_obj] set unlink { [AR] [AR_FLAGS] [target] [[target]_obj]; } /* FC "link" recipe */ /* not yet tested */ [BIN]/%: [[target]_obj] set mkdir { /* function print "target_obj is: " [[target]_obj]; */ [LD] [LD_FLAGS] name [target] file [[target]_obj]; } /* This seems to be affected by some idiosyncracies in CYGWIN */ /* FC "link" recipe */ %: [ [downcase [target]]_obj] set mkdir { /* function print "target_obj is: " [[target]_obj]; */ if [not link.l95] then touch link.l95; echo [[target]_obj] > link.l95; [LD] [LD_FLAGS] @link.l95 -out [downcase [target]]; } #endif