-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile-circt.sub
38 lines (31 loc) · 1.06 KB
/
Makefile-circt.sub
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
define HELP_TEXT_CIRCT
echo ""
echo "CIRCT Make Targets"
echo "--------------------------------------------------------------------------------"
echo "circt-build Builds and installs LLVM, MLIR, and CIRCT"
echo " (installation directory is circt/local)"
echo "circt-clean Deletes build directories (to save disk space)"
echo "circt-purge Deletes build and install directories"
echo "circt-help Prints this help text"
endef
.PHONY: circt-help
circt-help:
@$(HELP_TEXT_CIRCT)
CIRCT_BUILD = $(CIRCT_ROOT)/build
CIRCT_INSTALL = $(CIRCT_ROOT)/local
CIRCT_BIN = $(CIRCT_INSTALL)/bin
# Check if CIRCT has been compiled by lookinf for firtool
ifneq (, $(shell command -v $(CIRCT_BIN)/firtool 2> /dev/null))
$(info Found CIRCT firtool)
CIRCT_PATH = $(CIRCT_INSTALL)
endif
.PHONY: circt-build
circt-build:
cd $(CIRCT_ROOT) && ./build-ubuntu.sh
cd $(CIRCT_BUILD) && ninja install
.PHONY: circt-clean
circt-clean:
rm -rf $(CIRCT_BUILD)
.PHONY: circt-purge
circt-purge: circt-clean
rm -rf $(CIRCT_INSTALL)