# Lahey Makefile for library - wdm # # Last modified: 01/10/04 mcrouse # Usage: make [libdir=path_to_install_to] [install] [> compile.out] # # Examples: make # make install libdir=C:\lib # make install libdir=C:\my_dir\lib FFLAGS = $(DbgF) $(ImpF) # compile options (OptM or DbgF) + ImpF FC = lf90 # compiler AR = 386lib # library archiver #******************************************************************* #***** Some things may need to be changed below this line. ***** #******************************************************************* # Compiler flags # -ap - arithmetic precision; guarantee consistency of REAL, COMPLEX calc.s # -chk - check substring and array subscript bounds, argument types; # generates fatal runtime error; removes optimization by forcing -o0 # -g - generate source level symbolic debug information # -nhed - generate direct files w/o headers # -in - no implicit typing in effect, as if IMPLICIT NONE statement in code # -nin - Fortran implicit typing in effect # -o3 - perform production code optimizations # -tp - code optimized for target processor Intel Pentium # -trace - generate call traceback with runtime error messages # -trap - trap NDP exceptions: d=divide by 0, i=invalid operation, # o=overflow, u=underflow # -xref - include cross-reference information in listing file # (NOTES: to generate debug code - set FFLAGS to Dbgf # for production code - set FFLAGS to OptM DbgF = -ap -chk -g -nhed -tp -trace -trap diou -xref OptM = -ap -nhed -o3 -tp -trace -trap diou ImpF = -in #******************************************************************* #***** You should not need to modify anything below this line. ***** #******************************************************************* library = wdmd.lib Objects = wdbtch.obj wdatrb.obj wdatm2.obj wdsptm.obj wdimpt.obj wdexpt.obj \ wdtms2.obj wdtms1.obj wdtble.obj wdtbl2.obj wddlg.obj wdatru.obj \ tsbufr.obj wdtms3.obj wdmid.obj libdir = ..\..\lib binary = ..\..\lib libMake = $(binary)\$(library) libInst = $(libdir)\$(library) # Rules all: $(binary) $(libMake) install @echo @echo Done making all for wdm, files are now up-to-date. @echo # Library and utility dependencies: $(libMake): $(Objects) @echo @echo making $(libMake) $(AR) $@ -replace $? $(binary): !if ! -d $(binary) @mkdir $(binary) @echo Created directory $(binary) !endif install: # Create directory for binary file, if necessary !if ! -d $(libdir) @mkdir $(libdir) @echo Created directory $(libdir) !endif # Link executable to libdir if installing elsewhere !if (! -e $(libMake)) || (-z $(libMake)) @echo library $(libMake) does not exist, @echo use one of the following commands to generate it: @echo make @echo make all !else !if $(libdir) != $(binary) !if -e $(libInst) @del $(libInst) !endif @(cd ..\..; copy lib\$(library) $(libInst)) @echo @echo Library $(libInst) has been updated. !endif !endif clean: !if $(libdir) != $(binary) !if -e $(libInst) @del $(libInst) !endif !endif !if -e *.obj @del *.obj !endif !if -e $(libMake) @del $(libMake) !endif @echo Removed files generated by make. @echo # Define object file dependencies: tsbufr.obj: ctsbuf.inc wdatrb.obj: fversn.inc cfbuff.inc cdrloc.inc wdbtch.obj: cfbuff.inc cdrloc.inc wddlg.obj: cfbuff.inc wdexpt.obj: ctblab.inc cfbuff.inc wdmid.obj: cwdmid.inc wdsptm.obj: cfbuff.inc wdtble.obj: cfbuff.inc wdtms1.obj: cwtsds.inc cfbuff.inc wdtms2.obj: cfbuff.inc wdtms3.obj: cwtsds.inc cfbuff.inc # end of make