-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
39 lines (27 loc) · 784 Bytes
/
Makefile
File metadata and controls
39 lines (27 loc) · 784 Bytes
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
TOP ?= SimTop
BUILD_DIR = ./build
VERILATOR := $(shell which verilator)
CXX = $(shell which g++)
SCALA := $(shell which sbt)
VERILATOR_FLAGS = --cc --trace --build -Mdir $(BUILD_DIR)/verilator
include filelist.mk
LIB_OBJ := $(patsubst %.cpp,build/object/%.o,$(notdir $(LIB_CPP)))
all: verilog lib build
run:
./$(BUILD_DIR)/$(TOP) $(NPCFLAGS)
build:
$(CXX) $(CPP_FILES) $(LIB_STATIC) $(CFLAGS) -o $(BUILD_DIR)/$(TOP)
lib: $(LIB_OBJ)
verilator $(VSRC) $(VERILATOR_FLAGS)
ar rsc $(LIB_STATIC) $(LIB_OBJ)
build/object/%.o: /home/lickton/Public/arch/verilator/include/%.cpp
@$(info Target: $@)
$(CXX) -c $< -o $@ $(CFLAGS)
verilog:
@mkdir -p $(BUILD_DIR)
@mkdir -p $(BUILD_DIR)/object
sbt run
clean:
-rm -rf $(BUILD_DIR)
-rm -f *.vcd
.PHONY: verilog lib build clean