# Lahey Makefile for library - util # # Last modified: 01/10/10 mcrouse # Usage: makel [libdir=path_to_install_to] [install] [> compile.out] # # Examples: makel # makel install libdir=C:\lib # makel install libdir=C:\my_dir\lib # # note: makel is the large data model version of make. It # must be used with this makefile as regular make # runs out of memory. 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 # Object files, installation specific # where utcp[gn 90].obj copy arrays (fortran 77 and fortran 90 versions) # dttm[pc 90].obj calls to system routines for date and time # ckfspc.obj wild card file name matching # uscn[lh ot pc].obj screen addressing # utsc[lh lf90 ot pc].obj get/put single characer from/to screen ObjLahey77 = utcpgn.obj dttmpc.obj ckfspc.obj uscnlh.obj utsclh.obj ObjLahey90 = utcp90.obj dttm90.obj ckfspc.obj uscnlh.obj utsclf90.obj ObjOtg = utcpgn.obj dttmpc.obj ckfspc.obj uscnot.obj utscot.obj ObjGeneric = utcpgn.obj dttmpc.obj ckfspc.obj uscnpc.obj utscpc.obj ObjVrsn = $(ObjLahey90) #******************************************************************* #***** You should not need to modify anything below this line. ***** #******************************************************************* library = utild.lib Objects = utchar.obj utdate.obj utgnrl.obj utnumb.obj utsort.obj utscxx.obj libdir = ..\..\lib binary = ..\..\lib libMake = $(binary)\$(library) libInst = $(libdir)\$(library) # Rules all: $(binary) $(libMake) install @echo @echo Done making all for util, files are now up-to-date. @echo # Library and utility dependencies: $(libMake): $(Objects) $(ObjVrsn) @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: utchar.obj: const.inc utnumb.obj: const.inc fversn.inc utscxx.obj: color.inc utscot.obj: color.inc utscpc.obj: color.inc # end of make