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:
- if: $MANUALBUILD
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:
- FC=gfortran
- LIBRARY=$(nc-config --libs)
- INCLUDE=$(nc-config --inlcudedir)
- make -C ./src
- export FC=gfortran
- export LIBRARY_PATH=/usr/local/lib/x86_64-linux-gnu:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu
- export INCLUDE=/usr/include
- make -C src
artifacts:
paths:
......@@ -29,4 +29,4 @@ test:
script:
- ./src/main
- 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:
$FC ${INCLUDE} ${LIBRARY} -o $@
main: main.o
${FC} $< $(INC) $(LIBS) -lnetcdff -o $@
%.o %.mod %.smod: %.f90
${FC} ${INC} -c -o $*.o $<
.PHONY: clean
clean:
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