-
Notifications
You must be signed in to change notification settings - Fork 42
/
Makefile
62 lines (50 loc) · 1.09 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
62
CXX_FLAGS=-O3 -std=c++11 -DNDEBUG
INCLUDE_PATH=-I./include/
ifeq ($(CXX),icpc)
CXX_FLAGS += -qopenmp -xhost
else
ifeq ($(CXX),g++)
CXX_FLAGS += -fopenmp -march=native
else
ifeq ($(CXX),clang++)
CXX_FLAGS += -fopenmp -march=native
endif
endif
endif
all: lib/libhptt.so lib/libhptt.a
avx:
${MAKE} clean
${MAKE} avx2
arm:
${MAKE} clean
${MAKE} arm2
ibm:
${MAKE} clean
${MAKE} ibm2
scalar:
${MAKE} clean
${MAKE} scalar2
avx2: CXX_FLAGS+=-mavx -DHPTT_ARCH_AVX
avx2: all
arm2: CXX_FLAGS+=-mfpu=neon -DHPTT_ARCH_ARM
arm2: all
ibm2: CXX_FLAGS+=-mcpu=power7 -DHPTT_ARCH_IBM -maltivec -mabi=altivec
ibm2: all
scalar2: all
SRC=$(wildcard ./src/*.cpp)
OBJ=$(SRC:.cpp=.o)
SHARED_OBJ=$(SRC:.cpp=.so)
lib/libhptt.so: ${SHARED_OBJ}
mkdir -p lib
${CXX} ${SHARED_OBJ} ${CXX_FLAGS} -o lib/libhptt.so -shared
lib/libhptt.a: ${OBJ}
mkdir -p lib
ar rvs lib/libhptt.a ${OBJ}
${OBJ}: %.o: %.cpp
${CXX} ${CXX_FLAGS} ${INCLUDE_PATH} -c $< -o $@
${SHARED_OBJ}: %.so: %.cpp
${CXX} ${CXX_FLAGS} -fPIC ${INCLUDE_PATH} -c $< -o $@
doc:
doxygen
clean:
rm -rf ${OBJ} ${SHARED_OBJ} lib/libhptt.so lib/libhptt.a