common/sim-bits.h: Document ROTn macro.
[binutils-gdb.git] / sim / mips / Makefile.in
1 # Makefile template for Configure for the MIPS simulator.
2 # Written by Cygnus Support.
3
4 ## COMMON_PRE_CONFIG_FRAG
5
6 srcdir=@srcdir@
7 srcroot=$(srcdir)/../../
8
9 SIM_NO_OBJ =
10
11 SIM_IGEN_OBJ = \
12 support.o \
13 itable.o \
14 semantics.o \
15 idecode.o \
16 icache.o \
17 engine.o \
18 irun.o
19
20 SIM_M16_OBJ = \
21 $(SIM_IGEN_OBJ) = \
22 m16_support.o \
23 m16_itable.o \
24 m16_semantics.o \
25 m16_idecode.o \
26 m16_icache.o \
27 m16_engine.o \
28 m16_irun.o
29
30 SIM_OBJS = \
31 $(SIM_@sim_gen@_OBJ) \
32 interp.o \
33 sim-bits.o \
34 sim-load.o \
35 sim-utils.o \
36 sim-hload.o \
37 sim-io.o \
38 sim-config.o \
39 sim-endian.o \
40 sim-engine.o \
41 sim-stop.o \
42 sim-resume.o \
43 sim-reason.o \
44 sim-events.o \
45 sim-module.o \
46 sim-trace.o \
47 sim-options.o \
48 sim-profile.o \
49 sim-core.o \
50 sim-watch.o
51
52
53
54 # List of flags to always pass to $(CC).
55 SIM_SUBTARGET=@SIM_SUBTARGET@
56
57 SIM_NO_CFLAGS = -DWITH_IGEN=0
58 SIM_IGEN_CFLAGS = -DWITH_IGEN=1
59 SIM_M16_CFLAGS = -DWITH_IGEN=1
60
61 # FIXME: Hack to find syscall.h? Better support for syscall.h
62 # is in progress.
63 SIM_EXTRA_CFLAGS = \
64 $(SIM_SUBTARGET) \
65 -I$(srcdir)/../../newlib/libc/sys/idt \
66 $(SIM_@sim_gen@_CFLAGS)
67
68 SIM_EXTRA_CLEAN = clean-igen clean-m16 clean-extra
69
70 SIM_EXTRA_ALL = $(SIM_@sim_gen@_ALL)
71
72 # List of main object files for `run'.
73 SIM_RUN_OBJS = nrun.o
74
75
76
77 ## COMMON_POST_CONFIG_FRAG
78
79 interp.o: $(srcdir)/interp.c config.h sim-main.h oengine.c
80
81 oengine.c: gencode
82 ./gencode @SIMCONF@ > tmp-oengine
83 mv tmp-oengine oengine.c
84
85 gencode: gencode.o getopt.o getopt1.o
86 $(CC_FOR_BUILD) -o $@ gencode.o getopt.o getopt1.o
87
88 gencode.o: $(srcdir)/gencode.c
89 $(CC_FOR_BUILD) -c -g -I${srcroot}/include $(srcdir)/gencode.c
90
91 getopt.o: $(srcdir)/../../libiberty/getopt.c
92 $(CC_FOR_BUILD) -c -g -I${srcroot}/include $(srcdir)/../../libiberty/getopt.c
93 getopt1.o: $(srcdir)/../../libiberty/getopt1.c
94 $(CC_FOR_BUILD) -c -g -I${srcroot}/include $(srcdir)/../../libiberty/getopt1.c
95
96
97 ../igen/igen:
98 cd ../igen && $(MAKE)
99
100 IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries
101 IGEN_INSN=$(srcdir)/mips.igen
102 IGEN_DC=$(srcdir)/mips.dc
103 IGEN_INCLUDE=\
104 $(start-sanitize-r5900) \
105 $(srcdir)/r5900.igen \
106 $(end-sanitize-r5900) \
107 $(start-sanitize-vr5400) \
108 $(srcdir)/vr5400.igen \
109 $(end-sanitize-vr5400) \
110 $(srcdir)/m16.igen
111
112 SIM_IGEN_ALL = tmp-igen
113
114 BUILT_SRC_FROM_IGEN = \
115 icache.h \
116 icache.c \
117 idecode.h \
118 idecode.c \
119 semantics.h \
120 semantics.c \
121 model.h \
122 model.c \
123 support.h \
124 support.c \
125 itable.h \
126 itable.c \
127 engine.h \
128 engine.c \
129 irun.c
130
131 $(BUILT_SRC_FROM_IGEN): tmp-igen
132
133 .PHONY: clean-igen
134 clean-igen:
135 rm -f $(BUILT_SRC_FROM_IGEN)
136 rm -f tmp-igen
137
138 tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
139 cd ../igen && $(MAKE)
140 ../igen/igen \
141 $(IGEN_TRACE) \
142 -I $(srcdir) \
143 -Werror \
144 -Wnodiscard \
145 @sim_igen_flags@ \
146 -G gen-direct-access \
147 -i $(IGEN_INSN) \
148 -o $(IGEN_DC) \
149 -x \
150 -n icache.h -hc tmp-icache.h \
151 -n icache.c -c tmp-icache.c \
152 -n semantics.h -hs tmp-semantics.h \
153 -n semantics.c -s tmp-semantics.c \
154 -n idecode.h -hd tmp-idecode.h \
155 -n idecode.c -d tmp-idecode.c \
156 -n model.h -hm tmp-model.h \
157 -n model.c -m tmp-model.c \
158 -n support.h -hf tmp-support.h \
159 -n support.c -f tmp-support.c \
160 -n itable.h -ht tmp-itable.h \
161 -n itable.c -t tmp-itable.c \
162 -n engine.h -he tmp-engine.h \
163 -n engine.c -e tmp-engine.c \
164 -n irun.c -r tmp-irun.c
165 $(srcdir)/../../move-if-change tmp-icache.h icache.h
166 $(srcdir)/../../move-if-change tmp-icache.c icache.c
167 $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
168 $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
169 $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
170 $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
171 $(srcdir)/../../move-if-change tmp-model.h model.h
172 $(srcdir)/../../move-if-change tmp-model.c model.c
173 $(srcdir)/../../move-if-change tmp-support.h support.h
174 $(srcdir)/../../move-if-change tmp-support.c support.c
175 $(srcdir)/../../move-if-change tmp-itable.h itable.h
176 $(srcdir)/../../move-if-change tmp-itable.c itable.c
177 $(srcdir)/../../move-if-change tmp-engine.h engine.h
178 $(srcdir)/../../move-if-change tmp-engine.c engine.c
179 $(srcdir)/../../move-if-change tmp-irun.c irun.c
180 touch tmp-igen
181
182
183
184 SIM_M16_ALL = tmp-igen $(SIM_M16_ALL)
185
186 BUILT_SRC_FROM_M16 = \
187 m16_icache.h \
188 m16_icache.c \
189 m16_idecode.h \
190 m16_idecode.c \
191 m16_semantics.h \
192 m16_semantics.c \
193 m16_model.h \
194 m16_model.c \
195 m16_support.h \
196 m16_support.c \
197 m16_itable.h \
198 m16_itable.c \
199 m16_engine.h \
200 m16_engine.c \
201 m16_irun.c
202
203 $(BUILT_SRC_FROM_M16): tmp-m16
204
205 .PHONY: clean-m16
206 clean-m16:
207 rm -f $(BUILT_SRC_FROM_M16)
208 rm -f tmp-m16
209
210 tmp-m16: $(IGEN_INSN) $(IGEN_DC) ../igen/igen $(IGEN_INCLUDE)
211 cd ../igen && $(MAKE)
212 ../igen/igen \
213 $(IGEN_TRACE) \
214 -I $(srcdir) \
215 -Werror \
216 -Wnodiscard \
217 -F 16 \
218 -M mips16 \
219 -G gen-direct-access \
220 -i $(IGEN_INSN) \
221 -o $(IGEN_DC) \
222 -x \
223 -n m16_icache.h -hc tmp-icache.h \
224 -n m16_icache.c -c tmp-icache.c \
225 -n m16_semantics.h -hs tmp-semantics.h \
226 -n m16_semantics.c -s tmp-semantics.c \
227 -n m16_idecode.h -hd tmp-idecode.h \
228 -n m16_idecode.c -d tmp-idecode.c \
229 -n m16_model.h -hm tmp-model.h \
230 -n m16_model.c -m tmp-model.c \
231 -n m16_support.h -hf tmp-support.h \
232 -n m16_support.c -f tmp-support.c \
233 -n m16_itable.h -ht tmp-itable.h \
234 -n m16_itable.c -t tmp-itable.c \
235 -n m16_engine.h -he tmp-engine.h \
236 -n m16_engine.c -e tmp-engine.c \
237 -n m16_irun.c -r tmp-irun.c
238 $(srcdir)/../../move-if-change tmp-icache.h m16_icache.h
239 $(srcdir)/../../move-if-change tmp-icache.c m16_icache.c
240 $(srcdir)/../../move-if-change tmp-idecode.h m16_idecode.h
241 $(srcdir)/../../move-if-change tmp-idecode.c m16_idecode.c
242 $(srcdir)/../../move-if-change tmp-semantics.h m16_semantics.h
243 $(srcdir)/../../move-if-change tmp-semantics.c m16_semantics.c
244 $(srcdir)/../../move-if-change tmp-model.h m16_model.h
245 $(srcdir)/../../move-if-change tmp-model.c m16_model.c
246 $(srcdir)/../../move-if-change tmp-support.h m16_support.h
247 $(srcdir)/../../move-if-change tmp-support.c m16_support.c
248 $(srcdir)/../../move-if-change tmp-itable.h m16_itable.h
249 $(srcdir)/../../move-if-change tmp-itable.c m16_itable.c
250 $(srcdir)/../../move-if-change tmp-engine.h m16_engine.h
251 $(srcdir)/../../move-if-change tmp-engine.c m16_engine.c
252 $(srcdir)/../../move-if-change tmp-irun.c m16_irun.c
253 touch tmp-m16
254
255
256 clean-extra:
257 rm -f gencode oengine.c tmp.igen