-
Notifications
You must be signed in to change notification settings - Fork 183
/
Copy pathMakefile.env
74 lines (66 loc) · 2 KB
/
Makefile.env
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
##########################################################
## User configuration
##########################################################
##########################################################
## Cad environment
##########################################################
ifneq ($(MAKECMDGOALS),help)
include $(BSG_CADENV_DIR)/cadenv.mk
%/cadenv.mk:
# BSG users leverage a machine-specific cadenv
# Here, we add sourcing to get these variables as well
@$(eval CADENV_URL := [email protected]:bespoke-silicon-group/bsg_cadenv)
@$(eval CADENV_EXISTS := $(shell git ls-remote --exit-code $(CADENV_URL) HEAD 2> /dev/null))
# Recursive make to include the new fragment
if [ -f "$(BSG_CADENV_DIR)/cadenv.mk" ]; then \
echo "bsg_cadenv already exists"; \
elif [[ ! -z "$(CADENV_EXISTS)" ]]; then \
echo "Cloning bsg_cadenv from $(CADENV_URL)"; \
git clone --recurse-submodules $(CADENV_URL) $(@D); \
else \
echo "bsg_cadenv not found"; \
mkdir -p $(@D); \
touch $@; \
fi
@echo "Successfully built $@!"
endif
#############################
# Environment detection
#############################
CENTOS7 := $(if $(findstring CentOS Linux release 7,$(shell cat /etc/centos-release 2>/dev/null)),1,0)
##############################
# Executables
##############################
RMRF ?= rm -rf
_DVE ?= dve
ECHO ?= echo
PRINTF ?= printf
CD ?= cd
MV ?= mv
GREP ?= grep
TEE ?= tee
GIT ?= git
GTKWAVE ?= gtkwave
MKDIR ?= mkdir
PYTHON ?= python
PYTHON2 ?= python2
CP ?= cp
SED ?= sed
SED_I ?= sed -i
SYMLINK ?= ln -nsf
TAIL ?= tail
TEST ?= test
TOUCH ?= touch
CAT ?= cat
ENVSUBST ?= envsubst
DROMAJO ?= dromajo
STTY ?= stty
TRUE ?= true
VERILATOR ?= verilator
SURELOG ?= surelog
YOSYS ?= yosys
ENABLE_VERDI ?= $(if $(VERDI_HOME),1,0)
RISCV_OBJCOPY ?= riscv64-unknown-elf-dramfs-objcopy
RISCV_OBJDUMP ?= riscv64-unknown-elf-dramfs-objdump -d -t
# Add LIB binaries to PATH
export PATH := $(BP_RTL_BIN_DIR):$(PATH)