-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathMakefile.env
88 lines (80 loc) · 2.29 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
##########################################################
## 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 := git@github.com:bespoke-silicon-group/bsg_cadenv)
# Recursive make to include the new fragment
@if [ -f "$(BSG_CADENV_DIR)/cadenv.mk" ]; then \
echo "bsg_cadenv already exists"; \
elif [[ ! -z $$(git ls-remote --exit-code $${CADENV_URL} HEAD 2> /dev/null) ]]; then \
git clone --recurse-submodules $${CADENV_URL} $(@D); \
else \
echo "bsg_cadenv not found"; \
mkdir -p $(@D); \
touch $@; \
fi
@echo "Successfully built $@!"
endif
#############################
# Cad settings
#############################
## Override CAD tool paths if needed
VCS ?= vcs
URG ?= urg
VERILATOR ?= verilator
DC_SHELL ?= dc_shell
VIVADO ?= vivado
_DVE ?= dve
GTKWAVE ?= gtkwave
YOSYS ?= yosys
## Specify license path if needed
VCS_HOME ?=
LM_LICENSE_FILE ?=
#############################
# Environment detection
#############################
CENTOS7 := $(if $(findstring CentOS Linux release 7,$(shell cat /etc/centos-release 2>/dev/null)),1,0)
## Set variables needed for building tools
GCC ?= gcc
CMAKE ?= $(if $(shell which cmake3),cmake3,cmake)
PYTHON ?= $(if $(shell which python3),python3,python)
XXD ?= xxd
CURL ?= curl
GIT ?= git
FIND ?= find
CP ?= cp
MKDIR ?= mkdir
MV ?= mv
PATCH ?= git apply --ignore-whitespace --ignore-space-change
CHECK_PATCH ?= $(PATCH) --check --reverse
TAR ?= tar
WGET ?= wget
CAT ?= cat
SYMLINK ?= ln -nsf
WCOUNT ?= wc -l
ECHO ?= echo
DIFF ?= diff
TAIL ?= tail
GREP ?= grep
SED ?= sed
TEST ?= test
CD ?= cd
TEE ?= tee
RM ?= rm
RMRF ?= rm -rf
PRINTF ?= printf
ENVSUBST ?= envsubst
STTY ?= stty
SURELOG ?= surelog
DROMAJO ?= dromajo
EXIT ?= exit
TOUCH ?= touch
# Add tool binaries to the PATH
export PATH := $(BP_TOOLS_BIN_DIR)/bin:$(PATH)