Skip to content
Snippets Groups Projects
Commit d93aaf3d authored by Michael Blaschek's avatar Michael Blaschek :bicyclist:
Browse files

fixed Makefile

parent 5e9eceea
No related branches found
No related tags found
No related merge requests found
...@@ -10,13 +10,13 @@ build: ...@@ -10,13 +10,13 @@ build:
- if: $MANUALBUILD - if: $MANUALBUILD
before_script: before_script:
- apt-get install -y -qq libnetcdf-dev libeccodes-dev - apt-get install -y -qq libnetcdf-dev libnetcdff-dev libeccodes-dev netcdf-bin
script: script:
- FC=gfortran - export FC=gfortran
- LIBRARY=$(nc-config --libs) - export LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu
- INCLUDE=$(nc-config --inlcudedir) - export INCLUDE=/usr/include
- make -C ./src - make -C src
artifacts: artifacts:
paths: paths:
...@@ -29,4 +29,4 @@ test: ...@@ -29,4 +29,4 @@ test:
script: script:
- ./src/main - ./src/main
- test -f pres_temp_4D.nc - test -f pres_temp_4D.nc
- ncdump pres_temp_4D.nc - ncdump -h pres_temp_4D.nc
all: main clean # 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: main.o
$FC ${INCLUDE} ${LIBRARY} -o $@ ${FC} $< $(INC) $(LIBS) -lnetcdff -o $@
%.o %.mod %.smod: %.f90
${FC} ${INC} -c -o $*.o $<
.PHONY: clean
clean: clean:
rm -rf main *.o rm -rf main *.o
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment