-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmakefile
More file actions
45 lines (32 loc) · 878 Bytes
/
Copy pathmakefile
File metadata and controls
45 lines (32 loc) · 878 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
44
SRC := \
$(wildcard *.asm)
OUT := \
$(patsubst %.asm,%.hex,$(SRC)) \
$(patsubst %.asm,%.hex2,$(SRC)) \
$(patsubst %.asm,%.bin,$(SRC))
ASM := ../asm/target/release/asm
#$(warning OUT = $(OUT))
all: $(OUT)
clean:
rm -f -- $(OUT)
%.hex: %.asm
$(ASM) -x $@ $<
%.hex2: %.asm
$(ASM) -X $@ $<
%.bin: %.asm
$(ASM) -o $@ $<
test:
rm -f test-asm.hex test-asm.hex2 test-asm.bin
$(MAKE) test-asm.hex test-asm.hex2 test-asm.bin
diff -u test-asm.hex.gold test-asm.hex
diff -u test-asm.hex2.gold test-asm.hex2
cmp test-asm.bin.gold test-asm.bin
@echo "Assembler verification passed!"
update-gold:
rm -f test-asm.hex test-asm.hex2 test-asm.bin
$(MAKE) test-asm.hex test-asm.hex2 test-asm.bin
cp test-asm.hex test-asm.hex.gold
cp test-asm.hex2 test-asm.hex2.gold
cp test-asm.bin test-asm.bin.gold
@echo "Golden files updated!"
.PHONY: all clean test update-gold