# # $Id: Makefile,v 1.2 1999/08/03 21:21:59 aai Exp aai $. # # Makefile for Fortran example library, libfortex77.a. # # This is a rudimentary Makefile that works well enough if you don't # have include files etc., leading to secondary and tertiary dependencies. # If you have such files in use, and you change an include file, # the best thing to do is 'make clean' and then rebuild the whole thing. # # A more orthodox Makefile would make the library dependent on a collection # of object files or, even more tedious, list each member of the archive # file separately as a target. Such a parctice seems like a good idea in # theory but it isn't always as portable as it might seem. # # Phillip A. Cheeseman, Purdue University Computing Center. # # # LIBSRC is a list of source files that make up the run-time library. # # LIBRARY is the path to the run-time library we're building. # # MAINS is a list of main programs we're compiling and linking with # the library. Note they are assumed to be the root name for their # corresponding source file. # # FC is the name of the Fortran compiler and should be filled in by # make(1) on your system. If not, fill it in yourself :-). FFLAGS # isn't always set by the system but is included on the compile line # in case it gets set on the command line. # # DEBUG is a catch all set of compile time options. Set it to '-ansi' # to see warnings w.r.t. what's not really Fortran 77 in the programs. # #DEBUG = -ansi DEBUG = LIBSRC = isalpha.f isdigit.f iset.f lalpha.f lgr.f lls.f lnb.f \ rdot.f rset.f rsum.f LIBRARY = libfortex77.a MAINS = llst # # Individual dependencies to make main program edits trigger a build. # llst: llst.f # # Here's the first (default) target to build. # all: ${LIBRARY} ${MAINS} ${LIBRARY}: ${LIBSRC} - rm -f *.o ${FC} ${DEBUG} -c ${FFLAGS} $? ar crv $@ *.o - rm -f *.o ${MAINS}: ${LIBRARY} ${FC} ${DEBUG} -o $@ $@.f ${LIBRARY} - rm -f $@.o clean: FRC - rm -f *.o - rm ${LIBRARY} # # The FRC target is used to 'force' the execution of the recipes for # any targets that list FRC as a prerequisite. That way, if someone # parks a file called 'clean' in the directory, clean will still be made. # FRC: