-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (66 loc) · 2.15 KB
/
Copy pathMakefile
File metadata and controls
87 lines (66 loc) · 2.15 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#
# usim (C) R.P.Bellis 1993 -
# vim: set ts=8 sw=8 noet:
#
DEBUG = -g
CXX = g++ --std=c++20 -Wall -Wextra -Werror
CC = gcc --std=c9x -Wall -Werror
CCFLAGS = $(DEBUG)
CPPFLAGS = -D_POSIX_SOURCE -I.
LDFLAGS =
LIB_SRCS = usim.cpp memory.cpp \
mc6809.cpp mc6809in.cpp \
mos6502.cpp mos6502in.cpp \
mc6850.cpp
OBJS = $(LIB_SRCS:.cpp=.o)
BIN = usim09 usim02 tests/test6502 tests/test6809
LIB = libusim.a
all: $(BIN)
$(LIB): $(OBJS)
ar crs $(@) $^
ranlib $(@)
usim09: $(LIB) main09.o term.o
$(CXX) $(CCFLAGS) $(LDFLAGS) main09.o term.o -L. -lusim -o $(@)
usim02: $(LIB) main02.o term.o
$(CXX) $(CCFLAGS) $(LDFLAGS) main02.o term.o -L. -lusim -o $(@)
tests/test6502: $(LIB) tests/test6502.o
$(CXX) $(CCFLAGS) $(LDFLAGS) tests/test6502.o -L. -lusim -o $(@)
tests/test6502.o: tests/test6502.cpp
$(CXX) $(CPPFLAGS) $(CCFLAGS) -c tests/test6502.cpp -o $(@)
tests/test6809: $(LIB) tests/test6809.o
$(CXX) $(CCFLAGS) $(LDFLAGS) tests/test6809.o -L. -lusim -o $(@)
tests/test6809.o: tests/test6809.cpp
$(CXX) $(CPPFLAGS) $(CCFLAGS) -c tests/test6809.cpp -o $(@)
tests/test6809.bin: tests/test6809.asm
asm6809 -B -o $(@) $(<)
.PHONY: test
test: tests/test6502 tests/test6809 tests/test6809.bin
tests/test6502
tests/test6809
.SUFFIXES: .cpp
.cpp.o:
$(CXX) $(CPPFLAGS) $(CCFLAGS) -c $<
.PHONY: clean
clean:
$(RM) $(BIN) $(LIB) *.o tests/*.o tests/test6809.bin
.PHONY: depend
depend:
makedepend $(LIB_SRCS) main.cpp term.cpp
# Manually defined dependencies
usim.o: usim.h device.h typedefs.h memory.h wiring.h
usim.o: bits.h
mc6809.o: mc6809.h wiring.h usim.h device.h typedefs.h
mc6809.o: memory.h bits.h
mc6809in.o: mc6809.h wiring.h usim.h device.h typedefs.h
mc6809in.o: memory.h bits.h
mos6502.o: mos6502.h wiring.h usim.h device.h typedefs.h
mos6502.o: memory.h bits.h
mos6502in.o: mos6502.h wiring.h usim.h device.h typedefs.h
mos6502in.o: memory.h bits.h
mc6850.o: mc6850.h device.h typedefs.h wiring.h bits.h
memory.o: memory.h device.h typedefs.h
main.o: mc6809.h wiring.h usim.h device.h
main.o: typedefs.h memory.h bits.h mc6850.h
main.o: term.h
term.o: term.h mc6850.h device.h typedefs.h wiring.h
# DO NOT DELETE THIS LINE -- make depend depends on it.