]>
Commit | Line | Data |
---|---|---|
add1fb05 | 1 | # Makefile template for Configure for the opcodes library. |
42b4add9 JM |
2 | # Copyright (C) 1990, 91, 92, 93, 94, 95, 1996 |
3 | # Free Software Foundation, Inc. | |
add1fb05 SC |
4 | # Written by Cygnus Support. |
5 | # | |
6 | # This program is free software; you can redistribute it and/or modify | |
7 | # it under the terms of the GNU General Public License as published by | |
8 | # the Free Software Foundation; either version 2 of the License, or | |
9 | # (at your option) any later version. | |
10 | # | |
11 | # This program is distributed in the hope that it will be useful, | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | # GNU General Public License for more details. | |
15 | # | |
16 | # You should have received a copy of the GNU General Public License | |
17 | # along with this program; if not, write to the Free Software | |
40db6118 | 18 | # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
add1fb05 | 19 | |
40db6118 ILT |
20 | VPATH = @srcdir@ |
21 | srcdir = @srcdir@ | |
add1fb05 | 22 | |
40db6118 | 23 | prefix = @prefix@ |
add1fb05 | 24 | |
6d76c71f | 25 | program_transform_name = @program_transform_name@ |
40db6118 | 26 | exec_prefix = @exec_prefix@ |
42b4add9 JM |
27 | bindir = @bindir@ |
28 | libdir = @libdir@ | |
add1fb05 | 29 | |
42b4add9 JM |
30 | datadir = @datadir@ |
31 | mandir = @mandir@ | |
add1fb05 SC |
32 | man1dir = $(mandir)/man1 |
33 | man2dir = $(mandir)/man2 | |
34 | man3dir = $(mandir)/man3 | |
35 | man4dir = $(mandir)/man4 | |
36 | man5dir = $(mandir)/man5 | |
37 | man6dir = $(mandir)/man6 | |
38 | man7dir = $(mandir)/man7 | |
39 | man8dir = $(mandir)/man8 | |
40 | man9dir = $(mandir)/man9 | |
42b4add9 JM |
41 | infodir = @infodir@ |
42 | includedir = @includedir@ | |
add1fb05 SC |
43 | |
44 | SHELL = /bin/sh | |
45 | ||
40db6118 ILT |
46 | INSTALL = @INSTALL@ |
47 | INSTALL_PROGRAM = @INSTALL_PROGRAM@ | |
48 | INSTALL_DATA = @INSTALL_DATA@ | |
add1fb05 | 49 | |
40db6118 ILT |
50 | AR = @AR@ |
51 | AR_FLAGS = rc | |
52 | CC = @CC@ | |
53 | CFLAGS = @CFLAGS@ | |
add1fb05 | 54 | MAKEINFO = makeinfo |
40db6118 | 55 | RANLIB = @RANLIB@ |
add1fb05 | 56 | |
e0bf1022 ILT |
57 | ALLLIBS = @ALLLIBS@ |
58 | ||
59 | PICFLAG = @PICFLAG@ | |
60 | SHLIB = @SHLIB@ | |
61 | SHLIB_CC = @SHLIB_CC@ | |
62 | SHLIB_CFLAGS = @SHLIB_CFLAGS@ | |
63 | COMMON_SHLIB = @COMMON_SHLIB@ | |
c8303271 | 64 | SHLIB_DEP = @SHLIB_DEP@ |
e0bf1022 ILT |
65 | SHLINK = @SHLINK@ |
66 | ||
6d76c71f ILT |
67 | SONAME = lib`echo $(SHLIB) | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'` |
68 | ||
fde326fb | 69 | INCDIR = $(srcdir)/../include |
c840244e | 70 | BFDDIR = $(srcdir)/../bfd |
fde326fb | 71 | CSEARCH = -I. -I$(srcdir) -I../bfd -I$(INCDIR) -I$(BFDDIR) |
add1fb05 SC |
72 | DEP = mkdep |
73 | ||
794a16b0 | 74 | TARGETLIB = libopcodes.a |
add1fb05 | 75 | |
f7ed13c7 JK |
76 | # To circumvent a Sun make VPATH bug, each file listed here |
77 | # should also have a foo.o: foo.c line further along in this file. | |
a4c01299 | 78 | |
42b4add9 | 79 | ALL_MACHINES = a29k-dis.o alpha-dis.o alpha-opc.o h8300-dis.o h8500-dis.o \ |
d7ace307 ILT |
80 | $(start-sanitize-arc) \ |
81 | arc-dis.o arc-opc.o \ | |
82 | $(end-sanitize-arc) \ | |
a79d0193 FF |
83 | $(start-sanitize-d10v) \ |
84 | d10v-dis.o d10v-opc.o \ | |
85 | $(end-sanitize-d10v) \ | |
40db6118 | 86 | hppa-dis.o i386-dis.o i960-dis.o m68k-dis.o m68k-opc.o \ |
a79d0193 FF |
87 | m88k-dis.o mn10200-dis.o mn10200-opc.o mn10300-dis.o \ |
88 | mn10300-opc.o mips-dis.o mips-opc.o mips16-opc.o sh-dis.o \ | |
89 | sparc-dis.o sparc-opc.o z8k-dis.o ns32k-dis.o ppc-dis.o ppc-opc.o \ | |
90 | $(start-sanitize-v850) \ | |
91 | v850-dis.o v850-opc.o \ | |
92 | $(end-sanitize-v850) \ | |
93 | $(start-sanitize-tic80) \ | |
94 | tic80-dis.o tic80-opc.o \ | |
95 | $(end-sanitize-tic80) \ | |
d7ace307 ILT |
96 | arm-dis.o w65-dis.o |
97 | ||
40db6118 | 98 | OFILES = @BFD_MACHINES@ dis-buf.o disassemble.o |
add1fb05 SC |
99 | |
100 | FLAGS_TO_PASS = \ | |
101 | "against=$(against)" \ | |
102 | "AR=$(AR)" \ | |
103 | "AR_FLAGS=$(AR_FLAGS)" \ | |
104 | "CC=$(CC)" \ | |
105 | "CFLAGS=$(CFLAGS)" \ | |
106 | "RANLIB=$(RANLIB)" \ | |
107 | "MAKEINFO=$(MAKEINFO)" \ | |
108 | "INSTALL=$(INSTALL)" \ | |
109 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
e0bf1022 | 110 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" |
add1fb05 | 111 | |
40db6118 | 112 | ALL_CFLAGS = $(CSEARCH) @HDEFINES@ $(CFLAGS) |
add1fb05 | 113 | |
40db6118 | 114 | .c.o: |
e0bf1022 ILT |
115 | if [ -n "$(PICFLAG)" ]; then \ |
116 | $(CC) -c $(PICFLAG) $(ALL_CFLAGS) $< -o pic/$@; \ | |
117 | else true; fi | |
40db6118 | 118 | $(CC) -c $(ALL_CFLAGS) $< |
add1fb05 SC |
119 | |
120 | # C source files that correspond to .o's. | |
d7ace307 | 121 | CFILES = i386-dis.c z8k-dis.c m68k-dis.c mips-dis.c ns32k-dis.c ppc-dis.c |
add1fb05 | 122 | |
e0bf1022 | 123 | all: $(ALLLIBS) |
add1fb05 SC |
124 | |
125 | .NOEXPORT: | |
126 | ||
5d0734a7 | 127 | installcheck check: |
add1fb05 | 128 | |
e5bc6aaf | 129 | info: |
add1fb05 | 130 | clean-info: |
e5bc6aaf | 131 | install-info: |
5d0734a7 | 132 | dvi: |
add1fb05 SC |
133 | |
134 | # HDEPFILES comes from the host config; TDEPFILES from the target config. | |
135 | ||
136 | ||
137 | $(TARGETLIB): $(OFILES) | |
138 | rm -f $(TARGETLIB) | |
139 | $(AR) $(AR_FLAGS) $(TARGETLIB) $(OFILES) | |
140 | $(RANLIB) $(TARGETLIB) | |
141 | ||
c8303271 | 142 | LIBIBERTY_LISTS = ../libiberty/required-list ../libiberty/needed-list |
42b4add9 | 143 | BFD_PICLIST = @BFD_PICLIST@ |
c8303271 | 144 | |
42b4add9 | 145 | stamp-piclist: Makefile $(LIBIBERTY_LISTS) $(BFD_PICLIST) |
e0bf1022 ILT |
146 | rm -f tpiclist |
147 | if [ -n "$(PICFLAG)" ]; then \ | |
148 | echo $(OFILES) | sed -e 's,\([^ ][^ ]*\),pic/\1,g' > tpiclist; \ | |
149 | else \ | |
150 | echo $(OFILES) > tpiclist; \ | |
151 | fi | |
c8303271 ILT |
152 | if [ "$(COMMON_SHLIB)" = "yes" ]; then \ |
153 | lobjs=`cat $(LIBIBERTY_LISTS)`; \ | |
154 | if [ -n "$(PICFLAG)" ]; then \ | |
155 | lobjs=`echo $$lobjs | sed -e 's,\([^ ][^ ]*\),pic/\1,g'`; \ | |
156 | fi; \ | |
157 | lobjs=`echo $$lobjs | sed -e 's,\([^ ][^ ]*\),../libiberty/\1,g'`; \ | |
158 | echo $$lobjs >> tpiclist; \ | |
42b4add9 | 159 | sed -e 's,\([^ ][^ ]*\),../bfd/\1,g' $(BFD_PICLIST) >> tpiclist; \ |
c8303271 | 160 | else true; fi |
e0bf1022 ILT |
161 | $(srcdir)/../move-if-change tpiclist piclist |
162 | touch stamp-piclist | |
163 | ||
164 | piclist: stamp-piclist ; @true | |
165 | ||
c8303271 | 166 | $(SHLIB): stamp-picdir $(OFILES) piclist $(SHLIB_DEP) |
e0bf1022 | 167 | rm -f $(SHLIB) |
c8303271 | 168 | $(SHLIB_CC) $(SHLIB_CFLAGS) -o $(SHLIB) `cat piclist` |
e0bf1022 ILT |
169 | |
170 | $(SHLINK): $(SHLIB) | |
6d76c71f ILT |
171 | ts=lib`echo $(SHLIB) | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed -e '$(program_transform_name)'`; \ |
172 | if [ "$(COMMON_SHLIB)" = "yes" ]; then \ | |
173 | ts=../bfd/$$ts; \ | |
174 | fi; \ | |
175 | if [ "$$ts" != "$(SHLIB)" ]; then \ | |
176 | rm -f $$ts; \ | |
177 | ln -sf `echo $(SHLIB) | sed -e 's,^\.\./bfd/,,'` $$ts; \ | |
178 | else true; fi | |
e0bf1022 ILT |
179 | rm -f $(SHLINK) |
180 | ln -sf `echo $(SHLIB) | sed -e 's,^\.\./bfd/,,'` $(SHLINK) | |
181 | ||
6d76c71f ILT |
182 | # This target creates libTARGET-opcodes.so.VERSION as a symlink to |
183 | # libopcodes.so.VERSION. It is used on SunOS, which does not have SONAME. | |
184 | stamp-tshlink: $(SHLIB) | |
185 | tf=lib`echo $(SHLIB) | sed -e 's,\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'`; \ | |
186 | if [ "$(COMMON_SHLIB)" = "yes" ]; then \ | |
187 | tf=../bfd/$$tf; \ | |
188 | fi; \ | |
189 | if [ "$$tf" != "$(SHLIB)" ]; then \ | |
190 | rm -f $$tf; \ | |
191 | ln -sf $(SHLIB) $$tf; \ | |
192 | else true; fi | |
193 | if [ "$(COMMON_SHLIB)" = "yes" ]; then \ | |
194 | tf=lib`echo $(TARGETLIB) | sed -e 's/^lib//' | sed '$(program_transform_name)'`; \ | |
195 | if [ "$$tf" != "$(TARGETLIB)" ]; then \ | |
196 | rm -f $$tf; \ | |
197 | ln -sf $(TARGETLIB) $$tf; \ | |
198 | else true; fi; \ | |
199 | else true; fi | |
200 | touch stamp-tshlink | |
201 | ||
e0bf1022 ILT |
202 | $(OFILES): stamp-picdir |
203 | ||
d7ace307 | 204 | disassemble.o: disassemble.c $(INCDIR)/dis-asm.h |
e0bf1022 ILT |
205 | if [ -n "$(PICFLAG)" ]; then \ |
206 | $(CC) -c @archdefs@ $(PICFLAG) $(ALL_CFLAGS) $(srcdir)/disassemble.c -o pic/disassemble.o; \ | |
207 | else true; fi | |
40db6118 | 208 | $(CC) -c @archdefs@ $(ALL_CFLAGS) $(srcdir)/disassemble.c |
d7ace307 | 209 | |
fde326fb ILT |
210 | a29k-dis.o: a29k-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/a29k.h |
211 | dis-buf.o: dis-buf.c $(INCDIR)/dis-asm.h | |
212 | h8500-dis.o: h8500-dis.c h8500-opc.h $(INCDIR)/dis-asm.h | |
213 | h8300-dis.o: h8300-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/h8300.h | |
214 | i386-dis.o: i386-dis.c $(INCDIR)/dis-asm.h | |
215 | i960-dis.o: i960-dis.c $(INCDIR)/dis-asm.h | |
d7ace307 ILT |
216 | w65-dis.o: w65-dis.c |
217 | m68k-dis.o: m68k-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/floatformat.h \ | |
fde326fb | 218 | $(INCDIR)/opcode/m68k.h |
39620b71 | 219 | m68k-opc.o: m68k-opc.c $(INCDIR)/opcode/m68k.h |
fde326fb | 220 | mips-dis.o: mips-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/mips.h |
d7ace307 | 221 | mips-opc.o: mips-opc.c $(INCDIR)/opcode/mips.h |
a79d0193 | 222 | mips16-opc.o: mips16-opc.c $(INCDIR)/opcode/mips.h |
d7ace307 ILT |
223 | ppc-dis.o: ppc-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/ppc.h |
224 | ppc-opc.o: ppc-opc.c $(INCDIR)/opcode/ppc.h | |
fde326fb ILT |
225 | sparc-dis.o: sparc-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/sparc.h |
226 | sparc-opc.o: sparc-opc.c $(INCDIR)/opcode/sparc.h | |
227 | z8k-dis.o: z8k-dis.c z8k-opc.h $(INCDIR)/dis-asm.h | |
d7ace307 | 228 | ns32k-dis.o: ns32k-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/ns32k.h |
fde326fb | 229 | sh-dis.o: sh-dis.c sh-opc.h $(INCDIR)/dis-asm.h |
42b4add9 | 230 | alpha-dis.o: alpha-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/alpha.h |
39620b71 | 231 | alpha-opc.o: alpha-opc.c $(INCDIR)/opcode/alpha.h |
fde326fb | 232 | hppa-dis.o: hppa-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/hppa.h |
a4c01299 | 233 | m88k-dis.o: m88k-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/m88k.h |
d7ace307 | 234 | arm-dis.o: arm-dis.c arm-opc.h $(INCDIR)/dis-asm.h |
39620b71 FF |
235 | # start-sanitize-tic80 |
236 | tic80-dis.o: tic80-dis.c $(INCDIR)/dis-asm.h $(INCDIR)/opcode/tic80.h | |
237 | tic80-opc.o: tic80-opc.c $(INCDIR)/opcode/tic80.h | |
238 | # start-sanitize-tic80 | |
239 | ||
68ca3238 | 240 | |
add1fb05 SC |
241 | tags etags: TAGS |
242 | ||
243 | TAGS: force | |
244 | etags $(INCDIR)/*.h $(srcdir)/*.h $(srcdir)/*.c | |
245 | ||
42b4add9 | 246 | MOSTLYCLEAN = *.o core *.E *.p *.ip pic/*.o |
d7ace307 | 247 | mostlyclean: |
c840244e | 248 | rm -rf $(MOSTLYCLEAN) |
add1fb05 | 249 | clean: |
e0bf1022 | 250 | rm -f *.a $(MOSTLYCLEAN) $(SHLIB) $(SHLINK) piclist stamp-piclist |
c840244e | 251 | distclean: clean |
e0bf1022 | 252 | rm -rf Makefile config.status TAGS config.cache config.h stamp-h \ |
42b4add9 | 253 | pic stamp-picdir config.log |
e0bf1022 | 254 | clobber realclean maintainer-clean: distclean |
add1fb05 SC |
255 | |
256 | # Mark everything as depending on config.status, since the timestamp on | |
257 | # sysdep.h might actually move backwards if we reconfig and relink it | |
258 | # to a different hosts/h-xxx.h file. This will force a recompile anyway. | |
259 | RECONFIG = config.status | |
260 | ||
261 | ||
262 | ||
263 | # This target should be invoked before building a new release. | |
264 | # 'VERSION' file must be present and contain a string of the form "x.y" | |
265 | # | |
266 | roll: | |
267 | @V=`cat VERSION` ; \ | |
268 | MAJ=`sed 's/\..*//' VERSION` ; \ | |
269 | MIN=`sed 's/.*\.//' VERSION` ; \ | |
270 | V=$$MAJ.`expr $$MIN + 1` ; \ | |
271 | rm -f VERSION ; \ | |
272 | echo $$V >VERSION ; \ | |
273 | echo Version $$V | |
274 | ||
275 | # Dummy target to force execution of dependent targets. | |
276 | # | |
277 | force: | |
278 | ||
e0bf1022 ILT |
279 | install: $(ALLLIBS) |
280 | for f in $(ALLLIBS); do \ | |
6d76c71f ILT |
281 | if [ "$$f" = "stamp-tshlink" ]; then \ |
282 | continue; \ | |
283 | fi; \ | |
284 | tf=lib`echo $$f | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'`; \ | |
285 | rm -f $(libdir)/$$tf; \ | |
e0bf1022 | 286 | if [ "$$f" = "$(SHLINK)" ]; then \ |
6d76c71f ILT |
287 | ts=lib`echo $(SHLIB) | sed -e 's,^\.\./bfd/,,' -e 's/^lib//' | sed '$(program_transform_name)'`; \ |
288 | ln -sf $$ts $(libdir)/$$tf; \ | |
e0bf1022 | 289 | elif [ "$$f" = "$(SHLIB)" ]; then \ |
42b4add9 | 290 | @INSTALL_SHLIB@ \ |
e0bf1022 | 291 | else \ |
6d76c71f ILT |
292 | $(INSTALL_DATA) $$f $(libdir)/$$tf; \ |
293 | $(RANLIB) $(libdir)/$$tf; \ | |
294 | chmod a-x $(libdir)/$$tf; \ | |
e0bf1022 ILT |
295 | fi; \ |
296 | done | |
794a16b0 | 297 | |
824155e8 ILT |
298 | Makefile: Makefile.in config.status |
299 | CONFIG_FILES=Makefile CONFIG_HEADERS= $(SHELL) ./config.status | |
300 | ||
301 | config.h: stamp-h ; @true | |
302 | stamp-h: config.in config.status | |
303 | CONFIG_FILES= CONFIG_HEADERS=config.h:config.in $(SHELL) ./config.status | |
40db6118 | 304 | |
c8303271 | 305 | config.status: configure $(srcdir)/../bfd/configure.host $(srcdir)/../bfd/config.bfd $(srcdir)/../bfd/VERSION |
40db6118 | 306 | $(SHELL) config.status --recheck |
add1fb05 SC |
307 | |
308 | dep: $(CFILES) | |
309 | mkdep $(CFLAGS) $? | |
310 | ||
e0bf1022 ILT |
311 | stamp-picdir: |
312 | if [ -n "$(PICFLAG)" ] && [ ! -d pic ]; then \ | |
313 | mkdir pic; \ | |
314 | else true; fi | |
315 | touch stamp-picdir | |
add1fb05 SC |
316 | |
317 | # What appears below is generated by a hacked mkdep using gcc -MM. | |
318 | ||
319 | # DO NOT DELETE THIS LINE -- mkdep uses it. | |
320 | # DO NOT PUT ANYTHING AFTER THIS LINE, IT WILL GO AWAY. | |
321 | ||
322 | ||
323 | # IF YOU PUT ANYTHING HERE IT WILL GO AWAY | |
324 |