-
Notifications
You must be signed in to change notification settings - Fork 58
/
Makefile
66 lines (54 loc) · 2.34 KB
/
Makefile
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
#-----------------------------------------------------------------------------
# This file is part of the 'SLAC Firmware Standard Library'. It is subject to
# the license terms in the LICENSE.txt file found in the top-level directory
# of this distribution and at:
# https://confluence.slac.stanford.edu/display/ppareg/LICENSE.html.
# No part of the 'SLAC Firmware Standard Library', including this file, may be
# copied, modified, propagated, or distributed except according to the terms
# contained in the LICENSE.txt file.
#-----------------------------------------------------------------------------
ifndef MODULES
export MODULES = $(abspath $(PWD)/../)
endif
# GHDL/ruckus source loading
export RUCKUS_DIR = $(MODULES)/ruckus
export TOP_DIR = $(abspath $(PWD))
export PROJ_DIR = $(abspath $(PWD))
export OUT_DIR = $(PROJ_DIR)/build
# Path to GHDL proc.tcl
export RUCKUS_PROC_TCL = $(RUCKUS_DIR)/ghdl/proc.tcl
# Bypassing Xilinx Specific code
export VIVADO_VERSION = -1.0
# Override the submodule check because ruckus external of this repo
export OVERRIDE_SUBMODULE_LOCKS = 1
# GHDL build flags
GHDLFLAGS = --workdir=$(OUT_DIR) --ieee=synopsys -fexplicit -frelaxed-rules --warn-no-library
# Include the shared ruckus Makefile header
include $(RUCKUS_DIR)/system_shared.mk
# Override system_shared.mk build string
export BUILD_SVR_TYPE = $(shell python3 -m platform)
export GHDL_VERSION = $(shell ghdl -v 2>&1 | head -n 1)
export BUILD_STRING = $(PROJECT): $(GHDL_VERSION), $(BUILD_SYS_NAME) ($(BUILD_SVR_TYPE)), Built $(BUILD_DATE) by $(BUILD_USER)
all: syntax
# Test of the variables
.PHONY : test
test:
@echo PWD: $(PWD)
@echo MODULES: $(MODULES)
@echo RUCKUS_DIR: $(RUCKUS_DIR)
@echo PROJ_DIR: $(PROJ_DIR)
@echo OUT_DIR: $(OUT_DIR)
@echo RUCKUS_PROC_TCL: $(RUCKUS_PROC_TCL)
@echo VIVADO_VERSION: $(VIVADO_VERSION)
# Find all the source code and load it into GHDL
.PHONY : src
src:
@$(RUCKUS_DIR)/ghdl/import.tcl > /dev/null 2>&1
# Find all the source code and load it into GHDL
.PHONY : syntax
syntax: src
@echo "============================================================================="
@echo VHDL Syntax Checking:
@echo "============================================================================="
@ghdl -i $(GHDLFLAGS) --work=surf $(PROJ_DIR)/build/SRC_VHDL/surf/*
@ghdl -i $(GHDLFLAGS) --work=ruckus $(PROJ_DIR)/build/SRC_VHDL/ruckus/*