2 # RMAC - Renamed Macro Assembler for all Atari computers
3 # Copyright (C) 199x Landon Dyer, 2011-2021 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 -MMD
28 CFLAGS = -std=$(STD) -D_DEFAULT_SOURCE -g -D__GCCUNIX__ -I. -O2
30 OBJS = 6502.o amode.o debug.o direct.o dsp56k.o dsp56k_amode.o dsp56k_mach.o eagen.o error.o expr.o fltpoint.o listing.o mach.o macro.o mark.o object.o op.o procln.o riscasm.o rmac.o sect.o symbol.o token.o
36 #all: mntab.h 68ktab.h kwtab.h risckw.h 6502kw.h opkw.h dsp56ktab.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 68ktab.h 68k.tab: 68k.mch 68kgen
48 ./68kgen 68k.tab <68k.mch >68ktab.h
50 dsp56ktab.h dsp56k.tab: dsp56k.mch dsp56kgen
51 ./dsp56kgen dsp56k.tab <dsp56k.mch >dsp56ktab.h
54 mntab.h: direct.tab 68k.tab kwgen
55 cat direct.tab 68k.tab | ./kwgen mn >mntab.h
58 ./kwgen kw <kw.tab >kwtab.h
60 6502kw.h: 6502.tab kwgen
61 ./kwgen mp <6502.tab >6502kw.h
63 risckw.h: risc.tab kwgen
64 ./kwgen mr <risc.tab >risckw.h
67 ./kwgen mo <op.tab >opkw.h
69 # Looks like this is not needed...
70 dsp56kkw.h: dsp56k.tab kwgen
71 ./kwgen dsp <dsp56k.tab >dsp56kkw.h
78 $(HOSTCC) $(CFLAGS) -c $<
79 $(HOSTCC) $(CFLAGS) -o $*gen $<
82 # Build RMAC executable
89 $(CC) $(CFLAGS) -o rmac $(OBJS) -lm
92 # Clean build environment
96 $(RM) $(OBJS) kwgen.o 68kgen.o rmac kwgen 68kgen 68k.tab kwtab.h 68ktab.h mntab.h risckw.h 6502kw.h opkw.h dsp56kgen dsp56kgen.o dsp56k.tab dsp56kkw.h dsp56ktab.h
101 6502.o: 6502.c direct.h rmac.h symbol.h token.h expr.h error.h mach.h \
102 procln.h riscasm.h sect.h kwtab.h
104 amode.o: amode.c amode.h rmac.h symbol.h error.h expr.h mach.h procln.h \
105 token.h sect.h riscasm.h kwtab.h mntab.h parmode.h
106 debug.o: debug.c debug.h rmac.h symbol.h amode.h direct.h token.h expr.h \
107 mark.h sect.h riscasm.h
108 direct.o: direct.c direct.h rmac.h symbol.h token.h 6502.h amode.h \
109 error.h expr.h fltpoint.h listing.h mach.h macro.h mark.h procln.h \
110 riscasm.h sect.h kwtab.h
111 dsp56k.o: dsp56k.c rmac.h symbol.h dsp56k.h sect.h riscasm.h
112 dsp56k_amode.o: dsp56k_amode.c dsp56k_amode.h rmac.h symbol.h amode.h \
113 error.h token.h expr.h procln.h sect.h riscasm.h kwtab.h mntab.h
114 dsp56k_mach.o: dsp56k_mach.c dsp56k_mach.h rmac.h symbol.h dsp56k_amode.h \
115 amode.h direct.h token.h dsp56k.h sect.h riscasm.h error.h kwtab.h \
117 dsp56kgen: dsp56kgen.c
118 eagen.o: eagen.c eagen.h rmac.h symbol.h amode.h error.h fltpoint.h \
119 mach.h mark.h riscasm.h sect.h token.h eagen0.c
120 error.o: error.c error.h rmac.h symbol.h listing.h token.h
121 expr.o: expr.c expr.h rmac.h symbol.h direct.h token.h error.h listing.h \
122 mach.h procln.h riscasm.h sect.h kwtab.h
123 fltpoint.o: fltpoint.c fltpoint.h
125 listing.o: listing.c listing.h rmac.h symbol.h error.h procln.h token.h \
126 sect.h riscasm.h version.h
127 mach.o: mach.c mach.h rmac.h symbol.h amode.h direct.h token.h eagen.h \
128 error.h expr.h procln.h riscasm.h sect.h kwtab.h 68ktab.h
129 macro.o: macro.c macro.h rmac.h symbol.h debug.h direct.h token.h error.h \
130 expr.h listing.h procln.h
131 mark.o: mark.c mark.h rmac.h symbol.h error.h object.h riscasm.h sect.h
132 object.o: object.c object.h rmac.h symbol.h 6502.h direct.h token.h \
133 error.h mark.h riscasm.h sect.h
134 op.o: op.c op.h direct.h rmac.h symbol.h token.h error.h expr.h \
135 fltpoint.h mark.h procln.h riscasm.h sect.h opkw.h
136 procln.o: procln.c procln.h rmac.h symbol.h token.h 6502.h amode.h \
137 direct.h dsp56kkw.h error.h expr.h listing.h mach.h macro.h op.h riscasm.h \
138 sect.h kwtab.h mntab.h risckw.h 6502kw.h opkw.h
139 riscasm.o: riscasm.c riscasm.h rmac.h symbol.h amode.h direct.h token.h \
140 error.h expr.h mark.h procln.h sect.h risckw.h kwtab.h
141 rmac.o: rmac.c rmac.h symbol.h 6502.h debug.h direct.h token.h error.h \
142 expr.h listing.h mark.h macro.h object.h procln.h riscasm.h sect.h \
144 sect.o: sect.c sect.h rmac.h symbol.h riscasm.h 6502.h direct.h token.h \
145 error.h expr.h listing.h mach.h mark.h
146 symbol.o: symbol.c symbol.h error.h rmac.h listing.h object.h procln.h \
148 token.o: token.c token.h rmac.h symbol.h direct.h error.h macro.h \
149 procln.h sect.h riscasm.h kwtab.h