Commit | Line | Data |
---|---|---|
5ceef1b5 | 1 | # Makefile template for Configure for the D10v sim library. |
7eebfc62 | 2 | # Copyright (C) 1996 Free Software Foundation, Inc. |
2934d1c9 MH |
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 | ||
1eaaf305 MM |
19 | default: all |
20 | ||
9b86c7e2 | 21 | VPATH = @srcdir@ |
2934d1c9 MH |
22 | srcdir = @srcdir@ |
23 | srcroot = $(srcdir)/../.. | |
24 | ||
25 | prefix = @prefix@ | |
26 | exec_prefix = @exec_prefix@ | |
27 | ||
28 | host_alias = @host_alias@ | |
29 | target_alias = @target_alias@ | |
30 | program_transform_name = @program_transform_name@ | |
31 | bindir = @bindir@ | |
32 | ||
33 | libdir = @libdir@ | |
34 | tooldir = $(libdir)/$(target_alias) | |
35 | ||
36 | datadir = @datadir@ | |
37 | mandir = @mandir@ | |
38 | man1dir = $(mandir)/man1 | |
39 | man2dir = $(mandir)/man2 | |
40 | man3dir = $(mandir)/man3 | |
41 | man4dir = $(mandir)/man4 | |
42 | man5dir = $(mandir)/man5 | |
43 | man6dir = $(mandir)/man6 | |
44 | man7dir = $(mandir)/man7 | |
45 | man8dir = $(mandir)/man8 | |
46 | man9dir = $(mandir)/man9 | |
47 | infodir = @infodir@ | |
48 | includedir = @includedir@ | |
49 | ||
50 | SHELL = /bin/sh | |
51 | ||
52 | INSTALL = $(srcroot)/install.sh -c | |
53 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
54 | INSTALL_DATA = @INSTALL_DATA@ | |
55 | INSTALL_XFORM = $(INSTALL) -t='$(program_transform_name)' | |
56 | INSTALL_XFORM1= $(INSTALL_XFORM) -b=.1 | |
57 | ||
58 | AR = @AR@ | |
59 | AR_FLAGS = rc | |
60 | CC = @CC@ | |
1eaaf305 MM |
61 | CC_FOR_BUILD = @CC_FOR_BUILD@ |
62 | CFLAGS = @CFLAGS@ | |
7eebfc62 | 63 | SIM_CFLAGS = @sim_cflags@ |
a49a15ad MM |
64 | DEBUG_CFLAGS = @sim_debug@ |
65 | CONFIG_CFLAGS = @DEFS@ $(SIM_CFLAGS) $(DEBUG_CFLAGS) $(HDEFINES) $(TDEFINES) $(CSEARCH) $(CSWITCHES) -DINSIDE_SIMULATOR | |
1eaaf305 | 66 | BUILD_CFLAGS = -g -O $(CSEARCH) |
2934d1c9 MH |
67 | MAKEINFO = makeinfo |
68 | RANLIB = @RANLIB@ | |
2934d1c9 MH |
69 | |
70 | HDEFINES = @HDEFINES@ | |
71 | TDEFINES = | |
72 | ||
73 | .NOEXPORT: | |
74 | MAKEOVERRIDES= | |
75 | ||
7eebfc62 | 76 | #X=xstuff.o |
1eaaf305 | 77 | #X_LIB=-lX11 |
2934d1c9 | 78 | X= |
1eaaf305 MM |
79 | X_LIB= |
80 | MATH_LIB= | |
81 | ||
2934d1c9 | 82 | |
5c255669 | 83 | INCLUDE = d10v_sim.h $(srcdir)/../../gdb/callback.h endian.c |
2934d1c9 MH |
84 | INCDIR = $(srcdir)/../../include |
85 | CSEARCH = -I. -I$(srcdir) -I../../include \ | |
9b86c7e2 | 86 | -I../../bfd -I$(INCDIR) -I$(srcdir)/../../bfd -I$(srcdir)/../../gdb -I$(srcdir)/../../newlib/libc/sys/d10v \ |
5ceef1b5 | 87 | -I$(srcdir)/../../opcodes |
2934d1c9 MH |
88 | DEP = mkdep |
89 | ||
1eaaf305 MM |
90 | LIBIBERTY_LIB = ../../libiberty/libiberty.a |
91 | BFD_LIB = ../../bfd/libbfd.a | |
1eaaf305 MM |
92 | |
93 | all: run libsim.a | |
2934d1c9 | 94 | |
5c255669 MM |
95 | run: interp.o $(X) run.o table.o callback.o simops.o endian.o $(LIBIBERTY_LIB) $(BFD_LIB) |
96 | $(CC) $(CFLAGS) $(CONFIG_CFLAGS) -o run $(X) interp.o table.o callback.o simops.o run.o endian.o \ | |
9b86c7e2 | 97 | $(BFD_LIB) $(LIBIBERTY_LIB) $(X_LIB) $(MATH_LIB) |
2934d1c9 | 98 | |
7eebfc62 | 99 | interp.o:interp.c table.c $(INCLUDE) |
9b86c7e2 MM |
100 | run.o: $(srcdir)/../common/run.c $(INCLUDE) |
101 | $(CC) -c $(CFLAGS) $(CONFIG_CFLAGS) $< | |
102 | ||
103 | simops.o: simops.c $(INCLUDE) | |
5c255669 | 104 | endian.o: endian.c $(INCLUDE) |
9b86c7e2 MM |
105 | callback.o: $(srcdir)/../../gdb/callback.c $(INCLUDE) |
106 | $(CC) -c $(CFLAGS) $(CONFIG_CFLAGS) $< | |
2934d1c9 | 107 | |
5c255669 MM |
108 | libsim.a:interp.o table.o simops.o endian.o |
109 | $(AR) $(ARFLAGS) libsim.a interp.o table.o simops.o endian.o | |
2934d1c9 MH |
110 | $(RANLIB) libsim.a |
111 | ||
1eaaf305 | 112 | simops.h: gencode |
2934d1c9 MH |
113 | ./gencode -h >$@ |
114 | ||
1eaaf305 | 115 | table.c: gencode simops.h |
2934d1c9 MH |
116 | ./gencode >$@ |
117 | ||
9b86c7e2 MM |
118 | gencode.o: gencode.c $(INCLUDE) |
119 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/gencode.c | |
120 | ||
121 | d10v-opc.o: $(srcdir)/../../opcodes/d10v-opc.c | |
122 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -c $(srcdir)/../../opcodes/d10v-opc.c | |
123 | ||
124 | gencode: gencode.o d10v-opc.o | |
125 | $(CC_FOR_BUILD) $(BUILD_CFLAGS) -o gencode gencode.o d10v-opc.o $(BUILD_LIB) | |
2934d1c9 MH |
126 | |
127 | .c.o: | |
1eaaf305 | 128 | $(CC) -c $(CFLAGS) $(CONFIG_CFLAGS) $< |
2934d1c9 MH |
129 | |
130 | check: | |
131 | ||
132 | info: | |
133 | clean-info: | |
134 | install-info: | |
135 | ||
136 | tags etags: TAGS | |
137 | ||
138 | TAGS: force | |
139 | etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c | |
140 | ||
141 | clean: | |
142 | rm -f *.[oa] *~ core *.E *.p *.ip aout-params.h gen-aout | |
d70b4d42 | 143 | rm -f run table.c simops.h gencode libsim.a |
2934d1c9 MH |
144 | |
145 | distclean mostlyclean maintainer-clean realclean: clean | |
146 | rm -f TAGS | |
147 | rm -f Makefile config.cache config.log config.status | |
148 | ||
149 | # Dummy target to force execution of dependent targets. | |
150 | # | |
151 | force: | |
152 | ||
153 | # Copy the files into directories where they will be run. | |
154 | install: | |
155 | $(INSTALL_XFORM) run $(bindir)/run | |
156 | ||
157 | install-man: run.1 | |
158 | $(INSTALL_XFORM1) $(srcdir)/run.1 $(man1dir)/run.1 | |
159 | ||
160 | Makefile: Makefile.in config.status | |
161 | $(SHELL) ./config.status | |
162 | ||
163 | config.status: configure | |
164 | $(SHELL) ./config.status --recheck | |
165 | ||
166 | dep: $(CFILES) | |
167 | mkdep $(CFLAGS) $? | |
168 | ||
169 | # What appears below is generated by a hacked mkdep using gcc -MM. | |
170 | ||
171 | # DO NOT DELETE THIS LINE -- mkdep uses it. | |
172 | # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. | |
173 | ||
174 | ||
175 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY |