-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
executable file
·98 lines (76 loc) · 2.12 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
95
96
97
98
# Makefile
# by Richard John Foster Cavell (c) 2017, 2018, 2019
# Part of the 6809-strlen project
# https://github.com/richardcavell/6809-strlen
# We build strlen.bin and no_error_strlen.bin
# as raw binaries here. The test suite builds
# its own versions of the routines, differently.
ASM = asm6809
AFLAGS = -B -8 --setdp=-1 -v
LSTFLAGS = -l
SYMFLAGS = -s
SOURCE1 = strlen.s
BINARY1 = strlen.bin
LISTING1 = strlen.lst
SYMBOL1 = strlen.sym
SOURCE2 = no_error_strlen.s
BINARY2 = no_error_strlen.bin
LISTING2 = no_error_strlen.lst
SYMBOL2 = no_error_strlen.sym
# This gives the desired result but it's not the intended use of -V
SORT = sort -V
VERSION = 1.7
.DEFAULT: all
.PHONY: all
.PHONY: everything
.PHONY: binaries
.PHONY: listings
.PHONY: symbols
# make all makes just the binaries
# make everything makes the binaries, and the listings and symbols
all: binaries
everything: binaries listings symbols
binaries: $(BINARY1) $(BINARY2)
listings: $(LISTING1) $(LISTING2)
symbols: $(SYMBOL1) $(SYMBOL2)
$(BINARY1): $(SOURCE1)
$(BINARY2): $(SOURCE2)
$(LISTING1): $(SOURCE1)
$(LISTING2): $(SOURCE2)
$(SYMBOL1): $(SOURCE1)
$(SYMBOL2): $(SOURCE2)
%.bin:
$(ASM) $(AFLAGS) $< $(OUTPUT_OPTION)
%.lst:
$(ASM) $(AFLAGS) $(LSTFLAGS) $@ $<
%.sym:
$(ASM) $(AFLAGS) $(SYMFLAGS) $@ $<
$(SORT) $@ -o $@.sorted
mv $@.sorted $@
.PHONY: info
.PHONY: version
.PHONY: help
.PHONY: clean
info:
@echo "6809-strlen version" $(VERSION) "by Richard Cavell"
version:
@echo $(VERSION)
help:
@echo "The valid targets for this makefile:"
@echo "make all # this builds only the binaries"
@echo "make everything # this builds absolutely everything"
@echo "make binaries"
@echo "make listings"
@echo "make symbols"
@echo "make" $(BINARY1)
@echo "make" $(LISTING1)
@echo "make" $(SYMBOL1)
@echo "make" $(BINARY2)
@echo "make" $(LISTING2)
@echo "make" $(SYMBOL2)
@echo "make info"
@echo "make version"
@echo "make help"
@echo "make clean"
clean:
$(RM) $(BINARY1) $(LISTING1) $(SYMBOL1) $(SYMBOL1).sorted $(BINARY2) $(LISTING2) $(SYMBOL2) $(SYMBOL2).sorted