-
Notifications
You must be signed in to change notification settings - Fork 4
/
Makefile
81 lines (62 loc) · 1.92 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
.PHONY:all clean directories
MKDIR_P = mkdir -p
PREFIX ?= /usr/bin
VERSION ?=0.1
INSTALL_PATH = ${PREFIX}/birdee${VERSION}/
##
PWD_DIR=$(shell pwd)
COMPILER_DIR=$(PWD_DIR)/Birdee
RUNTIME_DIR=$(PWD_DIR)/BirdeeRuntime
BLIB_DIR=$(PWD_DIR)/BirdeeHome/src
INC_DIR=$(PWD_DIR)/Birdee/include
INC_DIR2=$(PWD_DIR)/dependency/include
BIN_DIR=$(PWD_DIR)/BirdeeHome/bin
LIB_DIR=$(PWD_DIR)/BirdeeHome/lib
TESTS_DIR=$(PWD_DIR)/tests
PLAYGROUND_DIR=$(PWD_DIR)/BirdeePlayground
PYLIBS = $(shell python3-config --libs)
CXX ?= g++
CPPFLAGS ?= -g -DBIRDEE_USE_DYN_LIB -std=c++14 -g -I$(INC_DIR) -I$(INC_DIR2) $(shell python3 -m pybind11 --includes)
LIBS ?= -pthread
##
export PWD_DIR CXX CPPFLAGS LIBS COMPILER_DIR INC_DIR BIN_DIR PYLIBS LIB_DIR BLIB_DIR TESTS_DIR
##
all: directories compiler runtime libraries playground
directories: ${BIN_DIR} ${LIB_DIR}
${BIN_DIR}:
${MKDIR_P} ${BIN_DIR}
${LIB_DIR}:
${MKDIR_P} ${LIB_DIR}
compiler:
$(MAKE) -C $(COMPILER_DIR)
runtime:
$(MAKE) -C $(RUNTIME_DIR)
libraries: compiler runtime
$(MAKE) -C $(BLIB_DIR)
playground: libraries
$(MAKE) -C $(PLAYGROUND_DIR)
tests: libraries
$(MAKE) -C $(TESTS_DIR)
install:
cp -rfT $(PWD_DIR)/BirdeeHome $(INSTALL_PATH)
ln -s -r -f $(INSTALL_PATH)/bin/birdeec $(PREFIX)/birdeec
ln -s -r -f $(INSTALL_PATH)/bin/birdeeplay $(PREFIX)/birdeeplay
ln -s -r -f $(INSTALL_PATH)/lib/libBirdeeCompilerCore.so $(PREFIX)/../lib/libBirdeeCompilerCore.so
ln -s -r -f $(INSTALL_PATH)/lib/libBirdeeBinding.so $(PREFIX)/../lib/libBirdeeBinding.so
uninstall:
rm -r $(INSTALL_PATH)
rm $(PREFIX)/birdeec
rm $(PREFIX)/birdeeplay
rm $(PREFIX)/../lib/libBirdeeCompilerCore.so
rm $(PREFIX)/../lib/libBirdeeBinding.so
##
clean_tests:
$(MAKE) -C $(TESTS_DIR) clean
clean:
$(MAKE) -C $(COMPILER_DIR) clean
$(MAKE) -C $(PLAYGROUND_DIR) clean
$(MAKE) -C $(RUNTIME_DIR) clean
$(MAKE) -C $(BLIB_DIR) clean
$(MAKE) -C $(TESTS_DIR) clean
rm -rf ${BIN_DIR}
rm -rf ${LIB_DIR}