-
Notifications
You must be signed in to change notification settings - Fork 25
/
Makefile
70 lines (56 loc) · 1.7 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
OPENROAD_MODULES = yosys TritonRoute
SRC_PATH = OpenROAD/src
BUILD_PATH = OpenROAD/build/src
ifneq ($(shell which docker),)
$(info Using docker as default build type)
BUILD_DEP = docker_%
else
$(info docker installation not found. Defaulting to local build)
BUILD_DEP = cmake_%
endif
default: build_all
clone_all: clone_OpenROAD $(addprefix clone_,$(OPENROAD_MODULES))
@
clone_OpenROAD:
git submodule init
git submodule update --recursive
# --recursive doesn't recurse all the way
cd OpenROAD && \
git submodule init && \
git submodule update --recursive
cd $(SRC_PATH)/OpenDB && \
git submodule init && \
git submodule update --recursive
clone_yosys:
if ! [ -d $(SRC_PATH)/yosys ]; then \
git clone --recursive [email protected]:The-OpenROAD-Project/yosys.git $(SRC_PATH)/yosys; \
fi
clone_TritonRoute:
if ! [ -d $(SRC_PATH)/TritonRoute ]; then \
git clone --recursive [email protected]:The-OpenROAD-Project/TritonRoute.git $(SRC_PATH)/TritonRoute; \
fi
cd $(SRC_PATH)/TritonRoute && \
git checkout alpha2
docker_%: clone_%
docker build -t openroad/$(shell echo $* | tr A-Z a-z) -f $(SRC_PATH)/$*/Dockerfile $(SRC_PATH)/$*
cmake_OpenROAD: clone_OpenROAD
mkdir -p OpenROAD/build
cd OpenROAD/build && \
cmake $(CMAKE_OPTS) .. && \
make -j4
cmake_yosys:
cd $(SRC_PATH)/yosys && \
make -j4
cmake_TritonRoute:
mkdir -p $(SRC_PATH)/TritonRoute/build
cd $(SRC_PATH)/TritonRoute/build && \
cmake $(CMAKE_OPTS) .. && \
make -j4
build_all: $(addprefix $(BUILD_PATH)/,$(OPENROAD_MODULES))
@
$(BUILD_PATH)/%: $(BUILD_DEP)
mkdir -p $(BUILD_PATH)
rm -rf ./$@
container_id=$$(docker create openroad/$(shell echo $* | tr A-Z a-z)) && \
docker cp $$container_id:/build $@ && \
docker rm -v $$container_id