makefile 725 Bytes
#COMPILER= gfortran
COMPILER=ifort

OPTION= -O3 

NETCDFinc=-I/usr/local/include
NETCDFLIB=-L/usr/local/lib -lnetcdf
NETCDFMOD=-I/usr/local/lib/include

OBJ= *.o

SRC= *.f90

MOD= *.mod

EXEC= WIM

MODIR=modules
OBJDIR=obj

WIM2: $(OBJDIR)/$(OBJ)
	$(COMPILER) $(OPTION) $(NETCDFinc) $(NETCDFMOD) -o $(EXEC) $(OBJDIR)/$(OBJ) $(NETCDFLIB) 
	mv WIM ../

$(MODIR)/$(MOD): parameters.f90 
	$(COMPILER)  -c $< 
	mkdir -p $(MODIR)
	mv $(MOD) $(MODIR)

$(OBJDIR)/$(OBJ): $(SRC) $(MODIR)/$(MOD) 
	$(COMPILER) $(NETCDFinc) $(NETCDFMOD) -I./$(MODIR) -c $(SRC) $(NETCDFLIB) 
	mkdir -p $(OBJDIR)
	mv $(OBJ) $(OBJDIR)
	mv $(MOD) $(MODIR)


clean:
	rm -rf *.o *.mod $(OBJDIR) $(MODIR)

mrproper:
	rm -rf *.o *.mod ../WIM $(OBJDIR) $(MODIR)