-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile
61 lines (49 loc) · 1.51 KB
/
Makefile
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
.SUFFIXES : .o .cpp
# compiler and flags
CC = icc
LINK = $(CC) -Bstatic
CFLAGS = -O3 $(DEBUG) #-Wno-unused-result
#
OFLAGS = -O3 $(DEBUG)
INC = $(FFTINC) $(LPKINC) $(USRINC) $(SPGINC) $(GSLINC)
LIB = $(FFTLIB) $(LPKLIB) $(USRLIB) $(SPGLIB) $(GSLLIB)
# fftw 3 library
FFTINC = -I/opt/software/fftw/include
FFTLIB = -L/opt/software/fftw/lib -lfftw3
# Lapack library
#LPKINC = -I/opt/clapack/3.2.1/include
#LPKLIB = -L/opt/clapack/3.2.1/lib -lclapack -lblas -lf2c -lm
# spglib, used to get the irreducible q-points
#SPGINC = -I/opt/spglib/0.7.1/include
#SPGLIB = -L/opt/spglib/0.7.1/lib -lsymspg
# gsl ib, used to get the irreducible q-points
#GSLINC = -I/opt/libs/gsl/include
#GSLLIB = -L/opt/libs/gsl/lib -lgsl -lgslcblas
# Debug flags
#DEBUG = -O -g -DDEBUG
#====================================================================
# executable name
ROOT = vacf
EXE = $(ROOT)
#====================================================================
# source and rules
SRC = $(wildcard *.cpp *.c)
OBJ = $(SRC:.cpp=.o)
#====================================================================
all: ver ${EXE}
${EXE}: $(OBJ)
$(LINK) $(OFLAGS) $(OBJ) $(LIB) -o $@
clean:
rm -f *.o *~ *.mod ${EXE}
tar:
rm -f ${ROOT}.tar; tar -czvf ${ROOT}.tar.gz *.cpp *.h Makefile README*
ver:
@echo "#define VERSION `git log|grep '^commit'|wc -l`" > version.h
.f.o:
$(FC) $(FFLAGS) $(FREE) $(MPI) ${INC} -c $<
.f90.o:
$(FC) $(FFLAGS) $(FREE) $(MPI) ${INC} -c $<
.c.o:
$(CC) $(CFLAGS) -c $<
.cpp.o:
$(CC) $(CFLAGS) $(INC) -c $<