Skip to content
Snippets Groups Projects
Select Git revision
  • 8b6716391015851a5fa2e5dadb4f2f94f520f0ff
  • main default protected
2 results

Makefile

Blame
  • Makefile 423 B
    # use the environmental variable $INCLUDE
    # split the paths separated by :
    INC = $(subst :, ,$(INCLUDE))
    # add a -I/path/to/include
    INC := $(INC:%=-I%)
    # use the environmental variable $LIBRARY_PATH
    LIBS = $(subst :, ,$(LIBRARY_PATH))
    LIBS := $(LIBS:%=-L%)
    #
    all: clean main
    
    main: main.o
    	${FC} $< $(INC) $(LIBS) -lnetcdff -o $@
    	
    %.o %.mod %.smod: %.f90
    	${FC} ${INC} -c -o $*.o $<
    
    .PHONY: clean
    clean:
    	rm -rf main *.o