2002-11-28 Andrew Cagney <cagney@redhat.com>
[external/binutils.git] / sim / mn10300 / Makefile.in
1 #    Makefile template for Configure for the mn10300 sim library.
2 #    Copyright (C) 1996, 1997, 2000, 2001 Free Software Foundation, Inc.
3 #    Written by Cygnus Support.
4
5 # This program is free software; you can redistribute it and/or modify
6 # it under the terms of the GNU General Public License as published by
7 # the Free Software Foundation; either version 2 of the License, or
8 # (at your option) any later version.
9
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 # GNU General Public License for more details.
14
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software
17 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18
19 ## COMMON_PRE_CONFIG_FRAG
20
21 WITHOUT_COMMON_OBJS = table.o simops.o sim-load.o
22 WITHOUT_COMMON_INTERP_DEP = table.c
23 WITH_COMMON_OBJS = \
24         itable.o semantics.o idecode.o icache.o engine.o irun.o support.o \
25         $(SIM_NEW_COMMON_OBJS) \
26         op_utils.o \
27         sim-engine.o \
28         sim-hload.o \
29         sim-hrw.o \
30         sim-resume.o \
31         sim-reason.o \
32         sim-stop.o \
33         dv-sockser.o
34 WITH_COMMON_INTERP_DEP = 
35
36 MN10300_OBJS = $(@mn10300_common@_COMMON_OBJS)
37 MN10300_INTERP_DEP = $(@mn10300_common@_COMMON_INTERP_DEP)
38
39 SIM_OBJS = $(MN10300_OBJS) interp.o
40
41 # List of main object files for `run'.
42 WITHOUT_COMMON_RUN_OBJS = run.o
43 WITH_COMMON_RUN_OBJS = nrun.o
44 SIM_RUN_OBJS = $(@mn10300_common@_COMMON_RUN_OBJS)
45
46 SIM_EXTRA_CLEAN = clean-extra
47 # Extra dependencies for "sim-main.h"
48 SIM_EXTRA_DEPS = mn10300_sim.h itable.h idecode.h
49
50 # Select mn10300 support in nltvals.def.
51 NL_TARGET = -DNL_TARGET_mn10300
52
53 INCLUDE = mn10300_sim.h $(srcdir)/../../include/gdb/callback.h
54
55 # List of extra flags to always pass to $(CC).
56 SIM_EXTRA_CFLAGS = @sim_gen@ -DPOLL_QUIT_INTERVAL=0x20
57
58 ## COMMON_POST_CONFIG_FRAG
59
60
61 #
62 # Old generator (default)
63 #
64
65 simops.h: gencode
66         ./gencode -h >$@
67
68 table.c: gencode simops.h
69         ./gencode >$@
70
71 gencode.o: gencode.c $(INCLUDE)
72         $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gencode.c
73
74 m10300-opc.o: $(srcdir)/../../opcodes/m10300-opc.c
75         $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/../../opcodes/m10300-opc.c
76
77 gencode: gencode.o m10300-opc.o
78         $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o gencode gencode.o m10300-opc.o $(BUILD_LIB)
79
80 idecode.o op_utils.o semantics.o simops.o: targ-vals.h
81
82
83 BUILT_SRC_FROM_IGEN = \
84         icache.h \
85         icache.c \
86         idecode.h \
87         idecode.c \
88         semantics.h \
89         semantics.c \
90         model.h \
91         model.c \
92         support.h \
93         support.c \
94         itable.h \
95         itable.c \
96         engine.h \
97         engine.c \
98         irun.c
99 $(BUILT_SRC_FROM_IGEN): tmp-igen
100
101
102 .PHONY: clean-igen
103 clean-igen:
104         rm -f $(BUILT_SRC_FROM_IGEN)
105         rm -f tmp-igen tmp-insns
106
107 ../igen/igen:
108         cd ../igen && $(MAKE)
109
110 IGEN_TRACE= # -G omit-line-numbers # -G trace-rule-selection -G trace-rule-rejection -G trace-entries
111 IGEN_INSN=$(srcdir)/mn10300.igen $(srcdir)/am33.igen
112 IGEN_DC=$(srcdir)/mn10300.dc
113 tmp-igen: $(IGEN_INSN) $(IGEN_DC) ../igen/igen
114         cd ../igen && $(MAKE)
115         ../igen/igen \
116                 $(IGEN_TRACE) \
117                 -G gen-direct-access \
118                 -M mn10300,am33 -G gen-multi-sim=am33 \
119                 -I $(srcdir) \
120                 -i $(IGEN_INSN) \
121                 -o $(IGEN_DC) \
122                 -x \
123                 -n icache.h    -hc tmp-icache.h \
124                 -n icache.c    -c  tmp-icache.c \
125                 -n semantics.h -hs tmp-semantics.h \
126                 -n semantics.c -s  tmp-semantics.c \
127                 -n idecode.h   -hd tmp-idecode.h \
128                 -n idecode.c   -d  tmp-idecode.c \
129                 -n model.h     -hm tmp-model.h \
130                 -n model.c     -m  tmp-model.c \
131                 -n support.h   -hf tmp-support.h \
132                 -n support.c   -f  tmp-support.c \
133                 -n itable.h    -ht tmp-itable.h \
134                 -n itable.c    -t  tmp-itable.c \
135                 -n engine.h    -he tmp-engine.h \
136                 -n engine.c    -e  tmp-engine.c \
137                 -n irun.c      -r  tmp-irun.c
138         $(SHELL) $(srcdir)/../../move-if-change tmp-icache.h icache.h
139         $(SHELL) $(srcdir)/../../move-if-change tmp-icache.c icache.c
140         $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.h idecode.h
141         $(SHELL) $(srcdir)/../../move-if-change tmp-idecode.c idecode.c
142         $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.h semantics.h
143         $(SHELL) $(srcdir)/../../move-if-change tmp-semantics.c semantics.c
144         $(SHELL) $(srcdir)/../../move-if-change tmp-model.h model.h
145         $(SHELL) $(srcdir)/../../move-if-change tmp-model.c model.c
146         $(SHELL) $(srcdir)/../../move-if-change tmp-support.h support.h
147         $(SHELL) $(srcdir)/../../move-if-change tmp-support.c support.c
148         $(SHELL) $(srcdir)/../../move-if-change tmp-itable.h itable.h
149         $(SHELL) $(srcdir)/../../move-if-change tmp-itable.c itable.c
150         $(SHELL) $(srcdir)/../../move-if-change tmp-engine.h engine.h
151         $(SHELL) $(srcdir)/../../move-if-change tmp-engine.c engine.c
152         $(SHELL) $(srcdir)/../../move-if-change tmp-irun.c irun.c
153         touch tmp-igen
154
155
156 interp.o: interp.c $(MN10300_INTERP_DEP) $(INCLUDE)
157 simops.o: simops.c simops.h $(INCLUDE)
158 table.o: table.c
159
160 clean-extra: clean-igen
161         rm -f table.c simops.h gencode