2020-11-06 10:58:22 +01:00
|
|
|
COMPILER=GNU
|
|
|
|
#COMPILER=INTEL
|
|
|
|
#COMPILER=LLVM
|
|
|
|
|
2020-11-06 12:10:20 +01:00
|
|
|
ifeq ($(COMPILER),GNU)
|
2020-11-05 00:46:19 +01:00
|
|
|
CC=gcc -g
|
2020-11-05 12:57:39 +01:00
|
|
|
CFLAGS=-fPIC -fexceptions -Wall -Werror -Wpedantic -Wextra
|
2020-10-14 00:52:50 +02:00
|
|
|
|
2020-11-05 00:46:19 +01:00
|
|
|
FC=gfortran -g
|
|
|
|
FFLAGS=-fPIC -fcheck=all -Waliasing -Wampersand -Wconversion -Wsurprising -Wintrinsics-std -Wno-tabs -Wintrinsic-shadow -Wline-truncation -Wreal-q-constant -Wuninitialized -fbacktrace -ffpe-trap=zero,overflow,underflow -finit-real=nan
|
2020-10-15 12:36:52 +02:00
|
|
|
|
2020-10-22 00:50:07 +02:00
|
|
|
LIBS=-lgfortran -lm
|
2020-11-06 10:58:22 +01:00
|
|
|
endif
|
|
|
|
|
2020-11-06 12:10:20 +01:00
|
|
|
ifeq ($(COMPILER),INTEL)
|
2020-11-06 10:58:22 +01:00
|
|
|
CC=icc -xHost
|
|
|
|
CFLAGS=-fPIC -g -O2
|
|
|
|
|
|
|
|
FC=ifort -xHost
|
|
|
|
FFLAGS=-fPIC -g -O2
|
|
|
|
|
|
|
|
LIBS=-lm -lifcore -lirc
|
|
|
|
endif
|
|
|
|
|
|
|
|
#TODO
|
2020-11-06 12:10:20 +01:00
|
|
|
ifeq ($(COMPILER),LLVM)
|
2020-11-06 10:58:22 +01:00
|
|
|
CC=clang
|
|
|
|
CFLAGS=-fPIC -g -O2
|
|
|
|
|
|
|
|
FC=flang
|
|
|
|
FFLAGS=fPIC -g -O2
|
2020-11-05 15:27:25 +01:00
|
|
|
|
2020-11-06 10:58:22 +01:00
|
|
|
LIBS=-lm
|
|
|
|
endif
|
2020-10-26 19:30:50 +01:00
|
|
|
|
2020-10-22 00:50:07 +02:00
|
|
|
|
2021-03-06 19:36:46 +01:00
|
|
|
QMCKL_ROOT=$(CURDIR)/..
|
2021-03-06 18:19:13 +01:00
|
|
|
|
|
|
|
export CC CFLAGS FC FFLAGS LIBS QMCKL_ROOT
|
2020-10-14 00:52:50 +02:00
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
ORG_SOURCE_FILES=$(wildcard *.org)
|
2020-10-16 13:58:05 +02:00
|
|
|
OBJECT_FILES=$(filter-out $(EXCLUDED_OBJECTS), $(patsubst %.org,%.o,$(ORG_SOURCE_FILES)))
|
2020-10-14 09:54:12 +02:00
|
|
|
|
2020-10-21 19:50:18 +02:00
|
|
|
.PHONY: clean
|
2020-10-16 13:58:05 +02:00
|
|
|
.SECONDARY: # Needed to keep the produced C and Fortran files
|
2020-10-15 09:41:26 +02:00
|
|
|
|
2020-11-05 15:27:25 +01:00
|
|
|
libqmckl.so: Makefile.generated
|
2020-10-16 13:58:05 +02:00
|
|
|
$(MAKE) -f Makefile.generated
|
2020-10-14 00:52:50 +02:00
|
|
|
|
2020-10-21 19:50:18 +02:00
|
|
|
test: Makefile.generated
|
2020-10-17 00:28:49 +02:00
|
|
|
$(MAKE) -f Makefile.generated test
|
|
|
|
|
2020-11-05 12:57:39 +01:00
|
|
|
|
2020-11-05 15:27:25 +01:00
|
|
|
doc: $(ORG_SOURCE_FILES)
|
2021-03-06 18:19:13 +01:00
|
|
|
$(QMCKL_ROOT)/tools/create_doc.sh
|
2020-11-05 15:27:25 +01:00
|
|
|
|
2020-10-22 01:24:14 +02:00
|
|
|
|
2020-10-14 09:54:12 +02:00
|
|
|
clean:
|
2020-11-05 12:57:39 +01:00
|
|
|
rm -f qmckl.h test_qmckl_* test_qmckl.c test_qmckl qmckl_*.f90 qmckl_*.c qmckl_*.o qmckl_*.h Makefile.generated libqmckl.so *.html *.fh *.mod
|
2020-10-14 09:54:12 +02:00
|
|
|
|
2021-03-06 18:19:13 +01:00
|
|
|
Makefile.generated: Makefile $(QMCKL_ROOT)/tools/create_makefile.sh $(ORG_SOURCE_FILES)
|
|
|
|
$(QMCKL_ROOT)/tools/create_makefile.sh
|
2020-10-14 00:52:50 +02:00
|
|
|
|