-
Notifications
You must be signed in to change notification settings - Fork 8
/
Makefile
94 lines (66 loc) · 1.62 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
PROJECT_DIR=examples/helloworld
PROJECT_NAME=helloworld
SERDEV=/dev/ttyUSB0
FPGACABLE="UsbBlaster"
# RAW=RAW
all: doc tools libs
# Configuration
configure: configure-tools
configure-tools: configure-llvm
configure-llvm:
cd tools/llvm; ./configure --enable-assertions
# Build tools
tools: binutils llvm etc
binutils:
${MAKE} -C tools/binutils all
llvm:
${MAKE} -C tools/llvm all
etc:
${MAKE} -C tools/etc all
# Build libraries
libs: libll libc
libll:
${MAKE} -C tools/libll all
libc:
cd tools/libc/src; ./build.sh build
# Installation
install: install-tools install-libs
install-tools: install-binutils install-llvm install-etc
install-binutils:
${MAKE} -C tools/binutils install
install-llvm:
${MAKE} -C tools/llvm install
install-etc:
${MAKE} -C tools/etc install
install-libs: install-libll install-libc
install-libll:
${MAKE} -C tools/libll install
install-libc:
cd tools/libc/src; ./build.sh install
# Hardware
hwconfig:
cd hw; ./config.sh
xhwconfig:
cd hw; ./xconfig.tk
syn: hwconfig
@echo "You're not slacking off. Your code's compiling."
${MAKE} -C hw/quartus syn
# Build program
proj:
${MAKE} -C ${PROJECT_DIR} ${PROJECT_NAME}.dat ${PROJECT_NAME}.bin
# Simulation
sim: proj
cp ${PROJECT_DIR}/${PROJECT_NAME}.dat hw/sim/mem_main.dat
${MAKE} -C hw/sim sim
sim-nox: proj
cp ${PROJECT_DIR}/${PROJECT_NAME}.dat hw/sim/mem_main.dat
${MAKE} -C hw/sim sim-nox
# Run program in FPGA
fpga: tty proj
./fpga_config.sh ${FPGACABLE} hw/quartus/lemberg.svf && \
./fpga_exec.sh ${SERDEV} ${PROJECT_DIR}/${PROJECT_NAME}.bin ${RAW}
tty:
stty -F ${SERDEV} 115200 cstopb raw -echo
# Documentation
doc:
${MAKE} -C doc all