forked from ksiyeon27/ca-pa3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMakefile
58 lines (46 loc) · 1.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
#----------------------------------------------------------------
#
# 4190.308 Computer Architecture (Fall 2021)
#
# Project #3: Image Convolution in RISC-V Assembly
#
# October 25, 2021
#
# Jaehoon Shim ([email protected])
# Ikjoon Son ([email protected])
# Seongyeop Jeong ([email protected])
# Systems Software & Architecture Laboratory
# Dept. of Computer Science and Engineering
# Seoul National University
#
#----------------------------------------------------------------
PREFIX = riscv32-unknown-elf-
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
AS = $(PREFIX)as
OBJDUMP = $(PREFIX)objdump
PYRISC = ../pyrisc/sim/snurisc.py # <-- Change this line
PYRISCOPT = -l 1
INCDIR =
LIBDIR =
LIBS =
CFLAGS = -Og -march=rv32i -mabi=ilp32 -static
ASLFAGS = -march=rv32i -mabi=ilp32 -static
LDFLAGS = -T./link.ld -nostdlib -nostartfiles
OBJDFLAGS = -D --section=.text --section=.data
TARGET = bmpconv
ASRCS = bmpconv-main.s bmpconv.s bmpconv-test.s
OBJS = $(ASRCS:.s=.o)
all: $(TARGET)
$(TARGET): $(OBJS)
$(CC) $(LDFLAGS) -o $(TARGET) $(OBJS) $(LIBDIR) $(LIBS)
.s.o:
$(CC) -c $(CFLAGS) $(INCDIR) $< -o $@
#.c.s:
# $(CC) $(CFLAGS) $(INCDIR) -S $< -o $@
objdump: $(TARGET)
$(OBJDUMP) $(OBJDFLAGS) $(TARGET) > $(TARGET).objdump
run: $(TARGET)
$(PYRISC) $(PYRISCOPT) $(TARGET)
clean:
$(RM) $(TARGET) $(TARGET).objdump $(OBJS) *~ a.out