-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile.old
77 lines (55 loc) · 1.61 KB
/
Makefile.old
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
rwildcard=$(foreach d,$(wildcard $(1:=/*)),$(call rwildcard,$d,$2) $(filter $(subst *,%,$2),$d))
CXX = g++
CXXFLAGS = -Wall -g -pg -fPIC -O3 -pthread #-fsanitize=address -fno-omit-frame-pointer -O0
AR = ar
AR_FLAGS = rvs
DOXY = doxygen
DOXYFILE = Doxyfile
DOXYDIR = docs/doxy
DOCDIR = docs
SRC_DIR = src
CPPSRC_DIR = $(SRC_DIR)/cpp
BUILD_DIR = build
BIN_DIR = bin
LIB_DIR = lib
CXXLINK = #-lboost_asio
CXXINCL = /usr/include/eigen3 #/usr/include/boost
CXX_SRCS := $(call rwildcard,$(CPPSRC_DIR),*.cpp) #$(wildcard $(CPPSRC_DIR)/*.cpp)
CXX_OBJS := $(patsubst $(CPPSRC_DIR)/%.cpp,$(BUILD_DIR)/%.o, $(CXX_SRCS))
CXX_OBJDIRS := $(dir $(CXX_OBJS))
INC_DIRS := $(CPPSRC_DIR) $(CXXINCL)
INC_FLAGS := $(addprefix -I,$(INC_DIRS))
CXX += $(CXXFLAGS)
$(BUILD_DIR)/%.o: $(CPPSRC_DIR)/%.cpp $(CPPSRC_DIR)/%.h
$(CXX) $(INC_FLAGS) -c -o $@ $<
$(BUILD_DIR)/%.o: $(CPPSRC_DIR)/%.cpp
$(CXX) $(INC_FLAGS) -c -o $@ $<
libbatch.so: $(CXX_OBJS)
$(CXX) $(CXXLINK) $(CXX_OBJS) -shared -o $(LIB_DIR)/$@
libbatch.a: $(CXX_OBJS)
$(AR) $(AR_FLAGS) $(LIB_DIR)/$@ $(CXX_OBJS)
.PHONY: dirs
dirs:
@mkdir -p $(LIB_DIR)
@mkdir -p $(BIN_DIR)
@mkdir -p $(BUILD_DIR)
@mkdir -p $(CXX_OBJDIRS)
bin: $(CXX_OBJS)
$(CXX) $(CXXLINK) $^ -o $(BIN_DIR)/$@
clib: dirs libbatch.so libbatch.a
cython: dirs
echo \$asdf
python setup.py build_ext --build-lib $(LIB_DIR) --build-temp $(BUILD_DIR)
lib: dirs clib cython
all: dirs bin lib
.PHONY: clean
clean:
rm -rf $(BUILD_DIR)
rm -rf $(BIN_DIR)
rm -rf $(LIB_DIR)
$(MAKE) -C $(DOCDIR) clean
.PHONY: docs
docs: cython
cd $(DOXYDIR) && $(DOXY) $(DOXYFILE)
$(MAKE) -C $(DOCDIR) html
print-% : ; @echo $* = $($*)