-
Notifications
You must be signed in to change notification settings - Fork 0
/
Makefile
52 lines (38 loc) · 1.19 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
XLEN ?= 32
DESTDIR ?= $(CURDIR)
COMMON_DIR = $(abspath common)
SRC_DIR = $(abspath src)
CXXFLAGS += -std=c++11 -Wall -Wextra -Wfatal-errors
CXXFLAGS += -fPIC -Wno-maybe-uninitialized
CXXFLAGS += -I$(CURDIR) -I$(COMMON_DIR)
CXXFLAGS += -DXLEN_$(XLEN)
CXXFLAGS += $(CONFIGS)
LDFLAGS +=
SRCS = $(COMMON_DIR)/util.cpp $(COMMON_DIR)/mem.cpp
SRCS += $(SRC_DIR)/main.cpp $(SRC_DIR)/processor.cpp $(SRC_DIR)/core.cpp $(SRC_DIR)/emulator.cpp $(SRC_DIR)/decode.cpp $(SRC_DIR)/execute.cpp
SRCS += $(SRC_DIR)/inorder.cpp $(SRC_DIR)/FU.cpp $(SRC_DIR)/ROB.cpp $(SRC_DIR)/scoreboard.cpp $(SRC_DIR)/gshare.cpp
# Debugigng
ifdef DEBUG
CXXFLAGS += -g -O0 -DDEBUG_LEVEL=$(DEBUG)
else
CXXFLAGS += -O2 -DNDEBUG
endif
PROJECT = tinyrv
all: $(DESTDIR)/$(PROJECT)
$(DESTDIR)/$(PROJECT): $(SRCS)
$(CXX) $(CXXFLAGS) $^ $(LDFLAGS) -o $@
.depend: $(SRCS)
$(CXX) $(CXXFLAGS) -MM $^ > .depend;
test: $(DESTDIR)/$(PROJECT)
$(MAKE) -C tests run
test-o: $(DESTDIR)/$(PROJECT)
$(MAKE) -C tests run-o
test-g: $(DESTDIR)/$(PROJECT)
$(MAKE) -C tests run-g
test-og: $(DESTDIR)/$(PROJECT)
$(MAKE) -C tests run-og
submit:
@echo "-- ZIPPING ALL THE FILE ---------"
zip submission.zip src/*
clean:
rm -rf $(DESTDIR)/$(PROJECT)