-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile.inc
91 lines (59 loc) · 2.29 KB
/
Makefile.inc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
##$ COMPILER: suppprted compilers are ifort, gnu >v4.7 or use mpif90
FC=mpif90
##$ PLATFORM: supported platform are intel, gnu
PLAT=gnu
##$ SET THE LOCATION OF YOU PROGRAM DRIVER (default is ./drivers)
DIR =./drivers
##$ SET THE TARGET DIRECTORY WHERE TO PUT THE EXECUTABLE (default if $HOME/.bin in the PATH)
DIREXE=$(HOME)/.bin
##$ CHOOSE THE DRIVER CODE:
EXE=
##$ SET INCLUDE AND LINK OPTIONS USING pkg-config
INCARGS=$(shell pkg-config --cflags dmft_tools scifor)
LIBARGS=$(shell pkg-config --libs dmft_tools scifor)
ifeq ($(PLAT),intel)
FFLAG=-O2 -ftz
OFLAG=-O3 -ftz
DFLAG=-p -O0 -g -fpe0 -warn -warn errors -debuEg extended -traceback -check all,noarg_temp_created
FPPFLAG =-fpp
endif
ifeq ($(PLAT),gnu)
FFLAG = -O2 -ffree-line-length-none
DFLAG = -O0 -p -g -fimplicit-none -Wsurprising -Waliasing -fwhole-file -fcheck=all -pedantic -fbacktrace -ffree-line-length-none
OFLAG = -O3 -ffast-math -march=native -funroll-all-loops -fno-protect-parens -flto -ffree-line-length-none
FPPFLAG =-cpp
endif
##$ REVISION SOFTWARE VARIABLES
REV=$(shell git rev-parse HEAD)
BRANCH=_$(shell git rev-parse --abbrev-ref HEAD)
VER = 'character(len=41),parameter :: revision = "$(REV)"' > revision.inc
ifeq ($(BRANCH),_master)
BRANCH=
endif
##$ Extends the implicit support of the Makefile to .f90 files
.SUFFIXES: .f90
###############################################################################
# HERE STARTS THE REAL WORK
###############################################################################
OBJS= VCA_INPUT_VARS.o VCA_VARS_GLOBAL.o VCA_AUX_FUNX.o VCA_IO.o VCA_SETUP.o VCA_DIAG.o VCA_OBSERVABLES.o VCA_QMATRIX.o VCA_MAIN.o VCA.f90
all: all version compile completion
debug: debug version compile completion
all: FPPFLAG+=-D_
debug: FFLAG=$(DFLAG)
debug: FPPFLAG+=-D_
compile: $(OBJS)
@echo " ..................... compile ........................... "
$(FC) $(FPPFLAG) $(FFLAG) $(INCARGS) $(OBJS) $(DIR)/$(EXE).f90 -o $(DIREXE)/$(EXE)$(BRANCH) $(LIBARGS)
@echo " ...................... done .............................. "
@echo ""
@echo ""
@echo "created" $(DIREXE)/$(EXE)$(BRANCH)
.f90.o:
$(FC) $(FPPFLAG) $(FFLAG) $(INCARGS) -c $<
completion:
scifor_completion.sh $(DIR)/$(EXE).f90
clean:
@echo "Cleaning:"
@rm -f *.mod *.o *~ revision.inc
version:
@echo $(VER)