-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathMakefile
More file actions
70 lines (53 loc) · 1.59 KB
/
Makefile
File metadata and controls
70 lines (53 loc) · 1.59 KB
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
# Installation directory.
BINDIR=/usr/local/bin
ASM = ./q2asm/target/debug/q2asm
Q2LC = ./q2lc/target/debug/q2lc
PROG = ./q2prog/target/debug/q2prog
all:
@echo "Targets:"
@echo " install Install executables to $(BINDIR)"
@echo " uninstall Remove executables from $(BINDIR)"
@echo " clean Remove build artifacts"
@echo " sim-<example> Build and simulate <example>"
@echo " prog-<example> Program <example>"
@echo " verify-<example> Verfiy <example>"
@echo " reset Reset device"
sim-%: examples/%.hex
cp $< hardware/q2/hdl/test.hex
(cd hardware/q2/hdl && $(MAKE) sim)
examples/%.lst: $(ASM) examples/%.q2
$(ASM) examples/$*.q2
examples/%.hex: $(ASM) examples/%.q2
$(ASM) examples/$*.q2
examples/%.q2p: $(ASM) examples/%.q2
$(ASM) examples/$*.q2
examples/%.q2: $(Q2LC) examples/%.q2l
$(Q2LC) examples/$*.q2l
prog-%: $(PROG) examples/%.q2p
$(PROG) write -f examples/$*.q2p
verify-%: $(PROG) examples/%.q2p
$(PROG) verify -f examples/$*.q2p
reset: $(PROG)
$(PROG) reset
$(ASM): q2asm/src/*.rs
(cd q2asm && cargo build)
$(PROG): q2prog/src/*.rs
(cd q2prog && cargo build)
$(Q2LC): q2lc/src/*.rs
(cd q2lc && cargo build)
install: $(ASM) $(Q2LC) $(PROG) $(Q2MAKE)
cp $(ASM) $(BINDIR)
cp $(Q2LC) $(BINDIR)
cp $(PROG) $(BINDIR)
cp $(Q2MAKE) $(BINDIR)
uninstall:
rm -f $(BINDIR)/q2asm
rm -f $(BINDIR)/q2lc
rm -f $(BINDIR)/q2prog
rm -f $(BINDIR)/q2make
clean:
rm -f examples/*.lst examples/*.hex examples/*.q2p
rm -f hardware/q2/hdl/test.hex
(cd hardware/q2/hdl && $(MAKE) clean)
(cd q2asm && cargo clean)
(cd q2prog && cargo clean)