-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathMakefile.env
49 lines (43 loc) · 1.47 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
##########################################################
## User configuration
##########################################################
# Available platforms: ubuntu20.04
DOCKER_PLATFORM ?= ubuntu20.04
#############################
# Environment detection
#############################
CENTOS7 := $(if $(findstring CentOS Linux release 7,$(shell cat /etc/centos-release 2>/dev/null)),1,0)
##########################################################
## 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)
@$(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
#############################
# Cad settings
#############################
##############################
# Executables
##############################
DOCKER ?= docker
GIT ?= git
CD ?= cd
MKDIR ?= mkdir
ECHO ?= echo