
.SUFFIXES :
.SUFFIXES : .F .f .c .o .a
.PRECIOUS : $(LIB)
.SILENT:

# Define system commands.

RM      = /bin/rm -f
ECHO    = /bin/echo
ARCHIVE = ar rs

# Define compiler flags from machine dependent make.inc.

include ./make.inc_NVIDIA

INC = 

COMPILE.f = $(FC) -c $(FFLAGS) -I$(INC)

# Define main program.

MAIN = Main.f90

# Define all necessary source files.


# Define library path and name.

LIB = flake.a

# Define other libraries needed to link.

OTHER_LIB = 

# Define executable.

EXE = ./flake.exe

.f90.o:
	$(ECHO)
	$(ECHO) "Compiling $<"
	$(COMPILE.f) $<
	$(ECHO) "Adding $(<:.f90=.o) to $(LIB) archive."
	$(ARCHIVE) $(LIB) $(<:.f90=.o)
	$(RM) $(<:.f90=.o)

# Default target.

$(EXE): $(MAIN) $(LIB) 
	$(FC) $(FFLAGS) -I$(INC) $(MAIN) $(LIB) -o $(EXE)

exe: $(EXE)

# Dependencies.

clean:
	/bin/rm -f  *.i *.lst *.o *.mod $(LIB)
