mirror of
https://github.com/Polprzewodnikowy/SummerCart64.git
synced 2024-11-22 22:19:14 +01:00
34 lines
722 B
Makefile
34 lines
722 B
Makefile
|
RTL_DIR = ../rtl
|
||
|
MOCKS_DIR = mocks
|
||
|
BUILD_DIR = build
|
||
|
SRC_DIRS = \
|
||
|
$(RTL_DIR)/fifo \
|
||
|
$(RTL_DIR)/mcu \
|
||
|
$(RTL_DIR)/memory \
|
||
|
$(RTL_DIR)/n64 \
|
||
|
$(RTL_DIR)/sd \
|
||
|
$(RTL_DIR)/serv \
|
||
|
$(RTL_DIR)/usb \
|
||
|
$(RTL_DIR)/vendor \
|
||
|
$(RTL_DIR) \
|
||
|
$(MOCKS_DIR)
|
||
|
|
||
|
INC_DIRS = $(addprefix -I, $(SRC_DIRS))
|
||
|
TEST_FILES = $(shell find "./" -not -path "$(BUILD_DIR)/*" -type f -name "*_tb.sv")
|
||
|
TESTS = $(addprefix $(BUILD_DIR)/, $(basename $(TEST_FILES)))
|
||
|
|
||
|
VERILATOR_FLAGS = --binary --trace --timescale 10ns/1ns -j --quiet $(INC_DIRS)
|
||
|
|
||
|
$(BUILD_DIR)/%: %.sv
|
||
|
@echo "[VERILATOR] $<"
|
||
|
@mkdir -p $@.obj
|
||
|
@verilator $(VERILATOR_FLAGS) -Mdir $@.obj $< > /dev/null
|
||
|
@$@.obj/V$(notdir $@)
|
||
|
|
||
|
tests: $(TESTS)
|
||
|
|
||
|
clean:
|
||
|
@rm -rf ./$(BUILD_DIR)
|
||
|
|
||
|
.PHONY: tests
|