1CC = gcc
2
3# Development
4#CFLAGS = -O3 -c -Wall -Wextra -fstack-protector-all -D_FORTIFY_SOURCE=2
5
6# Production
7CFLAGS = -O3 -c -Wall -Wextra -U_FORTIFY_SOURCE
8
9LFLAGS =
10
11OBJ =	sim0.o \
12	sim1.o \
13	sim1a.o \
14	sim2.o \
15	sim3.o \
16	sim4.o \
17	sim5.o \
18	sim6.o \
19	sim7.o \
20	simctl.o \
21	disas.o	\
22	simint.o \
23	memory.o \
24	iosim.o	\
25	simfun.o \
26	simglb.o \
27	config.o
28
29../z80sim : $(OBJ)
30	$(CC) $(OBJ) $(LFLAGS) -o ../z80sim
31
32sim0.c:
33	./lnsrc
34
35sim0.o : sim0.c	sim.h simglb.h config.h memory.h
36	$(CC) $(CFLAGS) sim0.c
37
38sim1.o : sim1.c	sim.h simglb.h config.h memory.h
39	$(CC) $(CFLAGS) sim1.c
40
41sim1a.o : sim1a.c sim.h simglb.h config.h memory.h
42	$(CC) $(CFLAGS) sim1a.c
43
44sim2.o : sim2.c	sim.h simglb.h config.h memory.h
45	$(CC) $(CFLAGS) sim2.c
46
47sim3.o : sim3.c	sim.h simglb.h config.h memory.h
48	$(CC) $(CFLAGS) sim3.c
49
50sim4.o : sim4.c	sim.h simglb.h config.h memory.h
51	$(CC) $(CFLAGS) sim4.c
52
53sim5.o : sim5.c	sim.h simglb.h config.h memory.h
54	$(CC) $(CFLAGS) sim5.c
55
56sim6.o : sim6.c	sim.h simglb.h config.h memory.h
57	$(CC) $(CFLAGS) sim6.c
58
59sim7.o : sim7.c	sim.h simglb.h config.h memory.h
60	$(CC) $(CFLAGS) sim7.c
61
62simctl.o : simctl.c sim.h simglb.h memory.h
63	$(CC) $(CFLAGS) simctl.c
64
65disas.o	: disas.c
66	$(CC) $(CFLAGS) disas.c
67
68simint.o : simint.c sim.h simglb.h
69	$(CC) $(CFLAGS) simint.c
70
71memory.o : memory.c sim.h
72	$(CC) $(CFLAGS) memory.c
73
74iosim.o	: iosim.c sim.h	simglb.h
75	$(CC) $(CFLAGS) iosim.c
76
77simfun.o : simfun.c sim.h log.h
78	$(CC) $(CFLAGS) simfun.c
79
80simglb.o : simglb.c sim.h
81	$(CC) $(CFLAGS) simglb.c
82
83config.o : config.c
84	$(CC) $(CFLAGS) config.c
85
86clean:
87	rm -f *.o ../z80sim
88	./ulnsrc
89
90allclean:
91	make -f Makefile.cygwin clean
92
93install: ../z80sim
94	cp ../z80sim ${HOME}/bin
95