aboutsummaryrefslogtreecommitdiff
path: root/sim/d30v/Makefile.in
blob: d563be83d6d78ed0e8e01dee42de89bc7a3b65d9 (plain)
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
#   Mitsubishi Electric Corp. D30V Simulator.
#   Copyright (C) 1997, Free Software Foundation, Inc.
#   Contributed by Cygnus Support.
# 
# This file is part of GDB, the GNU debugger.
# 
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.
# 
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
# 
# You should have received a copy of the GNU General Public License along
# with this program; if not, write to the Free Software Foundation, Inc.,
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */

M4= @M4@


## COMMON_PRE_CONFIG_FRAG

# These variables are given default values in COMMON_PRE_CONFIG_FRAG.
# We override the ones we need to here.
# Not all of these need to be mentioned, only the necessary ones.

# List of object files, less common parts.
SIM_OBJS = \
	$(SIM_NEW_COMMON_OBJS) \
	engine.o cpu.o \
	s_support.o l_support.o \
	s_idecode.o l_idecode.o  \
	s_semantics.o l_semantics.o \
	sim-calls.o itable.o \
	sim-hload.o \
	sim-hrw.o \
	sim-engine.o \
	sim-stop.o \
	sim-reason.o \
	sim-resume.o

# List of extra dependencies.
# Generally this consists of simulator specific files included by sim-main.h.
SIM_EXTRA_DEPS = itable.h s_idecode.h l_idecode.h cpu.h alu.h

# List of generators
SIM_GEN=tmp-igen

# List of extra flags to always pass to $(CC).
SIM_EXTRA_CFLAGS = @sim_trapdump@

# List of main object files for `run'.
SIM_RUN_OBJS = nrun.o

# Dependency of `clean' to clean any extra files.
SIM_EXTRA_CLEAN = clean-igen

# This selects the d30v newlib/libgloss syscall definitions.
NL_TARGET=-DNL_TARGET_d30v

## COMMON_POST_CONFIG_FRAG

MAIN_INCLUDE_DEPS = tconfig.h
INCLUDE_DEPS = $(MAIN_INCLUDE_DEPS) $(SIM_EXTRA_DEPS)

# Rules need to build $(SIM_OBJS), plus whatever else the target wants.

# ... target specific rules ...

# Filter to eliminate known warnings
FILTER = 2>&1 | egrep -v "Discarding instruction|instruction field of type \`compute\' changed to \`cache\'|Instruction format is not 64 bits wide"

BUILT_SRC_FROM_IGEN = \
	s_icache.h \
	s_icache.c \
	s_idecode.h \
	s_idecode.c \
	s_semantics.h \
	s_semantics.c \
	s_model.h \
	s_model.c \
	s_support.h \
	s_support.c \
	l_icache.h \
	l_icache.c \
	l_idecode.h \
	l_idecode.c \
	l_semantics.h \
	l_semantics.c \
	l_model.h \
	l_model.c \
	l_support.h \
	l_support.c \
	itable.h itable.c
$(BUILT_SRC_FROM_IGEN): tmp-igen
#

.PHONY: clean-igen
clean-igen:
	rm -f $(BUILT_SRC_FROM_IGEN)
	rm -f tmp-igen tmp-insns

../igen/igen:
	cd ../igen && $(MAKE)

tmp-igen: $(srcdir)/dc-short $(srcdir)/d30v-insns $(srcdir)/ic-d30v ../igen/igen
	cd ../igen && $(MAKE)
	echo "# 1 \"$(srcdir)/d30v-insns\"" > tmp-insns
	$(M4) < $(srcdir)/d30v-insns >> tmp-insns 
	@echo "Generating short version ..."
	../igen/igen \
		-G gen-zero-r0 \
		-G direct-access \
		-G default-nia-minus-one \
		-G conditional-issue \
		-G verify-slot \
		-G field-widths \
		-F short,emul \
		-B 32 \
		-P "s_" \
		-o $(srcdir)/dc-short \
		-k $(srcdir)/ic-d30v \
		-n $(srcdir)/d30v-insns -i tmp-insns \
		-n s_icache.h    -hc tmp-icache.h \
		-n s_icache.c    -c  tmp-icache.c \
		-n s_semantics.h -hs tmp-semantics.h \
		-n s_semantics.c -s  tmp-semantics.c \
		-n s_idecode.h   -hd tmp-idecode.h \
		-n s_idecode.c   -d  tmp-idecode.c \
		-n s_model.h     -hm tmp-model.h \
		-n s_model.c     -m  tmp-model.c \
		-n s_support.h   -hf tmp-support.h \
		-n s_support.c   -f  tmp-support.c $(FILTER)
	$(srcdir)/../../move-if-change tmp-icache.h s_icache.h
	$(srcdir)/../../move-if-change tmp-icache.c s_icache.c
	$(srcdir)/../../move-if-change tmp-idecode.h s_idecode.h
	$(srcdir)/../../move-if-change tmp-idecode.c s_idecode.c
	$(srcdir)/../../move-if-change tmp-semantics.h s_semantics.h
	$(srcdir)/../../move-if-change tmp-semantics.c s_semantics.c
	$(srcdir)/../../move-if-change tmp-model.h s_model.h
	$(srcdir)/../../move-if-change tmp-model.c s_model.c
	$(srcdir)/../../move-if-change tmp-support.h s_support.h
	$(srcdir)/../../move-if-change tmp-support.c s_support.c
	@echo "Generating long version ..."
	../igen/igen \
		-G gen-zero-r0 \
		-G direct-access \
		-G default-nia-minus-one \
		-G conditional-issue \
		-G field-widths \
		-F long,emul \
		-B 64 \
		-P "l_" \
		-o $(srcdir)/dc-short \
		-k $(srcdir)/ic-d30v \
		-i tmp-insns \
		-n l_icache.h    -hc tmp-icache.h \
		-n l_icache.c    -c  tmp-icache.c \
		-n l_semantics.h -hs tmp-semantics.h \
		-n l_semantics.c -s  tmp-semantics.c \
		-n l_idecode.h   -hd tmp-idecode.h \
		-n l_idecode.c   -d  tmp-idecode.c \
		-n l_model.h     -hm tmp-model.h \
		-n l_model.c     -m  tmp-model.c \
		-n l_support.h   -hf tmp-support.h \
		-n l_support.c   -f  tmp-support.c $(FILTER)
	$(srcdir)/../../move-if-change tmp-icache.h l_icache.h
	$(srcdir)/../../move-if-change tmp-icache.c l_icache.c
	$(srcdir)/../../move-if-change tmp-idecode.h l_idecode.h
	$(srcdir)/../../move-if-change tmp-idecode.c l_idecode.c
	$(srcdir)/../../move-if-change tmp-semantics.h l_semantics.h
	$(srcdir)/../../move-if-change tmp-semantics.c l_semantics.c
	$(srcdir)/../../move-if-change tmp-model.h l_model.h
	$(srcdir)/../../move-if-change tmp-model.c l_model.c
	$(srcdir)/../../move-if-change tmp-support.h l_support.h
	$(srcdir)/../../move-if-change tmp-support.c l_support.c
	@echo "Generating instruction database ..."
	../igen/igen \
		-G field-widths \
		-F short,long,emul \
		-B 64 \
		-o $(srcdir)/dc-short \
		-k $(srcdir)/ic-d30v \
		-i tmp-insns \
		-n itable.h    -ht tmp-itable.h \
		-n itable.c    -t  tmp-itable.c $(FILTER)
	$(srcdir)/../../move-if-change tmp-itable.h itable.h
	$(srcdir)/../../move-if-change tmp-itable.c itable.c
	touch tmp-igen

ENGINE_H = \
	sim-main.h \
	$(srcdir)/../common/sim-basics.h \
	config.h \
	$(srcdir)/../common/sim-config.h \
	$(srcdir)/../common/sim-inline.h \
	$(srcdir)/../common/sim-types.h \
	$(srcdir)/../common/sim-bits.h \
	$(srcdir)/../common/sim-endian.h \
	itable.h \
	l_idecode.h s_idecode.h \
	cpu.h \
	alu.h \
	$(srcdir)/../common/sim-alu.h \
	$(srcdir)/../common/sim-core.h \
	$(srcdir)/../common/sim-events.h \

engine.o: engine.c $(ENGINE_H)
sim-calls.o: sim-calls.c $(ENGINE_H) $(srcdir)/../common/sim-utils.h $(srcdir)/../common/sim-options.h
cpu.o: cpu.c $(ENGINE_H)
s_support.o: s_support.c $(ENGINE_H)
l_support.o: l_support.c $(ENGINE_H)
s_semantics.o: s_semantics.c $(ENGINE_H)
l_semantics.o: l_semantics.c $(ENGINE_H)