2 # RMAC - Reboot's Macro Assembler for the Atari Jaguar
3 # Copyright (C) 199x Landon Dyer, 2011 Reboot & Friends
9 # Detect old, shitty platforms that aren't C99/POSIX compliant
10 OSTYPE := $(shell uname -a)
13 ifeq "$(findstring MINGW, $(OSTYPE))" "MINGW"
17 # If we're cross compiling using MXE, we're still fooooooooooked
27 CFLAGS = -std=$(STD) -D_DEFAULT_SOURCE -g -D__GCCUNIX__ -I. -O2
29 SRCS = 6502.c amode.c debug.c direct.c eagen.c error.c expr.c listing.c mach.c macro.c mark.c object.c procln.c riscasm.c rmac.c sect.c symbol.c token.c
31 OBJS = 6502.o amode.o debug.o direct.o eagen.o error.o expr.o listing.o mach.o macro.o mark.o object.o procln.o riscasm.o rmac.o sect.o symbol.o token.o
37 all : mntab.h 68ktab.h kwtab.h risckw.h 6502.h rmac
39 @echo "Don't forget to bump the version number before commiting!"
43 # Generated sources for state machines and keyword, directive and mnemonic
47 mntab.h : mntab 68kmn kwgen
48 cat mntab 68kmn | ./kwgen mn >mntab.h
50 68ktab.h 68kmn : 68ktab 68ktab 68kgen
51 ./68kgen 68kmn <68ktab >68ktab.h
54 ./kwgen kw <kwtab >kwtab.h
56 6502.h : 6502.tbl kwgen
57 ./kwgen mp <6502.tbl >6502kw.h
59 risckw.h : kwtab kwgen
60 ./kwgen mr <risctab >risckw.h
67 $(HOSTCC) $(CFLAGS) -c kwgen.c
70 $(HOSTCC) $(CFLAGS) -o kwgen kwgen.o
73 $(HOSTCC) $(CFLAGS) -c 68kgen.c
76 $(HOSTCC) $(CFLAGS) -o 68kgen 68kgen.o
79 # Build RMAC executable
82 6502.o : 6502.c 6502.h
83 $(CC) $(CFLAGS) -c 6502.c
85 amode.o : amode.c amode.h
86 $(CC) $(CFLAGS) -c amode.c
88 debug.o : debug.c debug.h
89 $(CC) $(CFLAGS) -c debug.c
91 direct.o : direct.c direct.h
92 $(CC) $(CFLAGS) -c direct.c
94 eagen.o : eagen.c eagen.h eagen0.c
95 $(CC) $(CFLAGS) -c eagen.c
97 error.o : error.c error.h
98 $(CC) $(CFLAGS) -c error.c
100 expr.o : expr.c expr.h
101 $(CC) $(CFLAGS) -c expr.c
103 listing.o : listing.c listing.h
104 $(CC) $(CFLAGS) -c listing.c
106 mach.o : mach.c mach.h
107 $(CC) $(CFLAGS) -c mach.c
109 macro.o : macro.c macro.h
110 $(CC) $(CFLAGS) -c macro.c
112 mark.o : mark.c mark.h
113 $(CC) $(CFLAGS) -c mark.c
115 object.o : object.c object.h
116 $(CC) $(CFLAGS) -c object.c
118 procln.o : procln.c procln.h
119 $(CC) $(CFLAGS) -c procln.c
121 risca.o : risca.c risca.h
122 $(CC) $(CFLAGS) -c risca.c
124 rmac.o : rmac.c rmac.h
125 $(CC) $(CFLAGS) -c rmac.c
127 sect.o : sect.c sect.h
128 $(CC) $(CFLAGS) -c sect.c
130 symbol.o : symbol.c symbol.h
131 $(CC) $(CFLAGS) -c symbol.c
133 token.o : token.c token.h
134 $(CC) $(CFLAGS) -c token.c
137 $(CC) $(CFLAGS) -o rmac $(OBJS)
140 # Clean build environment
144 $(rm) $(OBJS) kwgen.o 68kgen.o rmac kwgen 68kgen kwtab.h 68ktab.h mntab.h risckw.h 6502kw.h
149 6502.o: 6502.c direct.h rmac.h symbol.h expr.h error.h mach.h amode.h \
150 procln.h token.h riscasm.h sect.h
152 amode.o: amode.c amode.h rmac.h symbol.h error.h token.h expr.h kwtab.h \
154 debug.o: debug.c debug.h rmac.h symbol.h amode.h direct.h mark.h sect.h \
156 direct.o: direct.c direct.h rmac.h symbol.h 6502.h error.h expr.h \
157 listing.h mach.h amode.h macro.h mark.h procln.h token.h riscasm.h \
159 eagen.o: eagen.c eagen.h rmac.h symbol.h amode.h sect.h mark.h error.h \
160 mach.h riscasm.h eagen0.c
161 error.o: error.c error.h rmac.h symbol.h token.h listing.h
162 expr.o: expr.c expr.h rmac.h symbol.h direct.h error.h listing.h mach.h \
163 amode.h procln.h token.h riscasm.h sect.h kwtab.h
165 listing.o: listing.c listing.h rmac.h symbol.h version.h token.h procln.h \
167 mach.o: mach.c mach.h amode.h rmac.h symbol.h eagen.h error.h direct.h \
168 procln.h token.h riscasm.h sect.h kwtab.h 68ktab.h
169 macro.o: macro.c macro.h rmac.h symbol.h debug.h direct.h error.h expr.h \
170 listing.h procln.h token.h
171 mark.o: mark.c mark.h rmac.h symbol.h error.h object.h riscasm.h sect.h
172 object.o: object.c object.h rmac.h symbol.h error.h mark.h riscasm.h \
174 procln.o: procln.c procln.h rmac.h symbol.h token.h 6502.h amode.h \
175 direct.h error.h expr.h listing.h mach.h macro.h riscasm.h sect.h \
176 kwtab.h mntab.h risckw.h 6502kw.h
177 riscasm.o: riscasm.c riscasm.h rmac.h symbol.h amode.h direct.h error.h \
178 expr.h mark.h procln.h token.h sect.h risckw.h kwtab.h
179 rmac.o: rmac.c rmac.h symbol.h 6502.h debug.h direct.h error.h expr.h \
180 listing.h mark.h macro.h object.h procln.h token.h riscasm.h sect.h \
182 sect.o: sect.c sect.h rmac.h symbol.h 6502.h direct.h error.h expr.h \
183 listing.h mach.h amode.h mark.h riscasm.h token.h
184 symbol.o: symbol.c symbol.h error.h rmac.h listing.h object.h procln.h \
186 token.o: token.c token.h rmac.h symbol.h error.h macro.h procln.h sect.h \