-
Notifications
You must be signed in to change notification settings - Fork 5
/
Makefile
59 lines (38 loc) · 1.03 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
PREFIX?=$(INSTALL_DIR)
# product definitions
LIB_AXTOR=$(PREFIX)/lib/libAxtor.so
LIB_AXTORC=$(PREFIX)/lib/libAxtor_C.so
LIB_AXTOROCL=$(PREFIX)/lib/libAxtor_OpenCL.so
all::
install::
### configuration
# LLVM
LLVM_CXXFLAGS:=`llvm-config --cxxflags`
LLVM_LDFLAGS:=`llvm-config --ldflags --system-libs`
LLVM_LIBS:=`llvm-config --libs`
# compiler customization
WARNLEVEL=-Wall -Werror -Wno-non-virtual-dtor
OPTLEVEL=-O0 -g
BUILDFLAGS=-D_DEBUG
# compiler
CXX=g++ -std=c++11
CXXFLAGS=-fno-rtti -c -fPIC -Iinclude $(LLVM_CXXFLAGS) $(WARNLEVEL) $(OPTLEVEL) $(BUILDFLAGS)
LDFLAGS=-fPIC -Iinclude $(LLVM_LDFLAGS) $(LLVM_LIBS)
# Feature support
# TODO add tool support for OpenCL backend
# LIBS += -lAxtor_OCL -lAxtor
# CXXFLAGS += -DENABLE_OPENCL
# libraries
include lib/axtor/libAxtor.mk
include lib/axtor_ocl/libAxtor_OCL.mk
include lib/axtor_c/libAxtor_C.mk
# tools
include tools/extractor/extractor.mk
# TODO
## Generic build rules
build/%.o: %.cpp
mkdir -p $(dir $@)
$(CXX) -o $@ $(CXXFLAGS) $^
.PHONY: clean
clean:
rm -rf build/