-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMakefile
More file actions
46 lines (34 loc) · 1004 Bytes
/
Makefile
File metadata and controls
46 lines (34 loc) · 1004 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
40
41
42
43
CXX := g++
CXXFLAGS32 :=-march=rv32i -mabi=ilp32
CXXFLAGS64 :=-march=rv64g
CXX_RISCV :=riscv64-unknown-elf-g++
OBJDUMP_RISCV :=riscv64-unknown-elf-objdump
OBJDUMP_FLAGS :=-d -M numeric,no-aliases
OUT_DIR := out
# srcfiles := $(shell find . -maxdepth 3 -name "*.cpp")
SRC_FILES := $(shell find src/ -maxdepth 5 -name "*.cpp")
# objects := $(patsubst %.cpp, %.o, $(srcfiles))
OBJ_FILES := $(notdir $(patsubst %.cpp, %.o, $(SRC_FILES)))
ASM_FILES := $(notdir $(patsubst %.cpp, %.s, $(SRC_FILES)))
# all: $(OBJ_FILES)
# $(OUT_DIR):
# mkdir -p $(OUT_DIR)
# $(OBJ_FILES): $(SRC_FILES) | $(OUT_DIR)
# $(CXX_RISCV) $(CXXFLAGS) -c $^ && mv *.o $(OUT_DIR)/
.PHONY: run
run:
./build.sh
./parse.sh
./parse
.PHONY: go-build
go-build:
go build -o parse main.go
.PHONY: clean
clean:
rm -rf $(OUT_DIR)
.PHONY: docker-build
docker-build:
docker build -f Dockerfile . -t asm-compiler:latest
.PHONY: docker-run
docker-run:
docker run -v `pwd`:/ele548 --platform=linux/amd64 -it asm-compiler /bin/bash