-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathMakefile
59 lines (42 loc) · 1.37 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
DEBUG = -O3
CXX = g++ --std=c++17 -Wall -Wextra -Werror -flto
CC = gcc --std=c9x -Wall -Werror
CCFLAGS = $(DEBUG)
CPPFLAGS = -D_POSIX_SOURCE -I. -o $(@)
LDFLAGS = -flto
LIB_SRCS = usim.cpp mc6809.cpp mc6809in.cpp mc6850.cpp memory.cpp
OBJS = $(LIB_SRCS:.cpp=.o)
BIN = usim
LIB = libusim.a
all: $(BIN)
$(LIB): $(OBJS) # $(LIB)($(OBJS))
ar crs $(@) $^
ranlib $(@)
$(BIN): $(LIB) main.o term.o
$(CXX) $(CCFLAGS) $(LDFLAGS) main.o term.o -L. -lusim -o $(@)
.SUFFIXES: .cpp
.cpp.o:
$(CXX) $(CPPFLAGS) $(CCFLAGS) -c $<
$(OBJS): machdep.h
machdep: machdep.o
$(CC) -o $(@) $(CCFLAGS) $(LDFLAGS) machdep.o
machdep.h: machdep
./machdep $(@)
clean:
$(RM) machdep.h machdep.o machdep $(BIN) $(OBJS) main.o term.o $(LIB)
depend: machdep.h
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 machdep.h
mc6809in.o: mc6809.h wiring.h usim.h device.h typedefs.h
mc6809in.o: memory.h bits.h machdep.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 machdep.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.