# This is an example of a makefile to create the target m-test # which depends on the main Fortran program test-prog.f and the # subroutine test-sub.f. To make m-test do make m-test or just # simply do make, that is type ``make m-test'' or just simply # type ``make'' to generate the executable m-test. # Fortran flags see the f77 man page for the flags. # For optimization use, e.g. FFLAGS = -O4 # For debugging uncomment the following line and comment the previous one. #FFLAGS = -u -g # Object files. OBJ = test-prog.o test-sub.o # Target test and its dependencies also rules to make test. m-test: test-prog.o test-sub.o f77 -o m-test $(FFLAGS) $(OBJ) # The .o files their dependencies and rules to make them. test-prog.o: test-prog.f f77 $(FFLAGS) -c test-prog.f test-sub.o: test-sub.f f77 $(FFLAGS) -c test-sub.f # To run the program m-test do make run run: m-test # To get rid of the .o files do make clean clean: rm -f *.o # To get rid of the .o files and the executable do make very-clean very-clean: rm -f *.o m-test