-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.mk
95 lines (79 loc) · 2.76 KB
/
utils.mk
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
88
89
90
91
92
93
94
95
#+-------------------------------------------------------------------------------
# The following parameters are assigned with default values. These parameters can
# be overridden through the make command line
#+-------------------------------------------------------------------------------
DEBUG := no
#Generates debug summary report
ifeq ($(DEBUG), yes)
VPP_LDFLAGS += --dk list_ports
endif
ifneq ($(TARGET), hw)
VPP_FLAGS += -g
endif
############################## Setting up Project Variables ##############################
# Points to top directory of Git repository
MK_PATH := $(abspath $(lastword $(MAKEFILE_LIST)))
COMMON_REPO ?= $(shell bash -c 'export MK_PATH=$(MK_PATH); echo $${MK_PATH%cpp_kernels/burst_rw/*}')
PWD = $(shell readlink -f .)
XF_PROJ_ROOT = $(shell readlink -f $(COMMON_REPO))
#Setting PLATFORM
ifeq ($(PLATFORM),)
ifneq ($(DEVICE),)
$(warning WARNING: DEVICE is deprecated in make command. Please use PLATFORM instead)
PLATFORM := $(DEVICE)
endif
endif
#Checks for XILINX_VITIS
check-vitis:
ifndef XILINX_VITIS
$(error XILINX_VITIS variable is not set, please set correctly using "source <Vitis_install_path>/Vitis/<Version>/settings64.sh" and rerun)
endif
#Checks for XILINX_XRT
check-xrt:
ifndef XILINX_XRT
$(error XILINX_XRT variable is not set, please set correctly using "source /opt/xilinx/xrt/setup.sh" and rerun)
endif
check-device:
@set -eu; \
inallowlist=False; \
inblocklist=False; \
if [ "$(PLATFORM_ALLOWLIST)" = "" ]; \
then inallowlist=True; \
fi; \
for dev in $(PLATFORM_ALLOWLIST); \
do if [[ $$(echo $(PLATFORM) | grep $$dev) != "" ]]; \
then inallowlist=True; fi; \
done ;\
for dev in $(PLATFORM_BLOCKLIST); \
do if [[ $$(echo $(PLATFORM) | grep $$dev) != "" ]]; \
then inblocklist=True; fi; \
done ;\
if [[ $$inblocklist == True ]]; \
then echo "[ERROR]: This example is not supported for $(PLATFORM)."; exit 1;\
fi; \
if [[ $$inallowlist == False ]]; \
then echo "[Warning]: The platform $(PLATFORM) not in allowlist."; \
fi;
check-platform:
ifndef PLATFORM
$(error PLATFORM not set. Please set the PLATFORM properly and rerun. Run "make help" for more details.)
endif
# device2xsa - create a filesystem friendly name from device name
# $(1) - full name of device
device2xsa = $(strip $(patsubst %.xpfm, % , $(shell basename $(PLATFORM))))
XSA :=
ifneq ($(PLATFORM), )
XSA := $(call device2xsa, $(PLATFORM))
endif
############################## Deprecated Checks and Running Rules ##############################
check:
$(ECHO) "WARNING: \"make check\" is a deprecated command. Please use \"make run\" instead"
make run
exe:
$(ECHO) "WARNING: \"make exe\" is a deprecated command. Please use \"make host\" instead"
make host
# Cleaning stuff
RM = rm -f
RMDIR = rm -rf
ECHO:= @echo
docs: README.rst