* gdb.base/Makefile.in: Add action to .c.o transformation
[external/binutils.git] / gdb / testsuite / gdb.base / Makefile.in
1 # Makefile for the base tests for GDB.
2 # Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
3
4 # This file is part of GDB.
5
6 # GDB 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, or (at your option)
9 # any later version.
10
11 # GDB 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
18 # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19
20 srcdir = .
21 prefix = /usr/local
22 program_transform_name =
23
24 exec_prefix = $(prefix)
25 bindir = $(exec_prefix)/bin
26 libdir = $(exec_prefix)/lib
27 tooldir = $(libdir)/$(target_alias)
28
29 datadir = $(exec_prefix)/lib/dejagnu
30 mandir = $(prefix)/man
31 man1dir = $(mandir)/man1
32 man2dir = $(mandir)/man2
33 man3dir = $(mandir)/man3
34 man4dir = $(mandir)/man4
35 man5dir = $(mandir)/man5
36 man6dir = $(mandir)/man6
37 man7dir = $(mandir)/man7
38 man8dir = $(mandir)/man8
39 man9dir = $(mandir)/man9
40 infodir = $(prefix)/info
41 includedir = $(prefix)/include
42 gxx_includedir = $(tooldir)/g++-include
43 docdir = $(datadir)/doc
44 targetdir = $(datadir)/$(target_alias)
45
46 SHELL = /bin/sh
47
48 INSTALL = install -c
49 INSTALL_PROGRAM = $(INSTALL)
50 INSTALL_DATA = $(INSTALL)
51
52 CFLAGS = -g
53
54 RUNTESTFLAGS = 
55
56 LINK=           ln -s
57
58 EXPECT = ` \
59   if [ -f $${rootme}/../../../expect/expect ] ; then \
60     echo $${rootme}/../../../expect/expect ; \
61   else \
62     echo expect ; \
63   fi`
64
65 RUNTEST = ` \
66   if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \
67     echo $${rootme}/../../dejagnu/runtest ; \
68   else \
69     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
70       echo runtest; \
71     else \
72       t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
73     fi; \
74   fi`
75
76 CC = ` \
77   if [ -f $${rootme}/../../../gcc/xgcc ] ; then \
78     echo $${rootme}/../../../gcc/xgcc -B$${rootme}/../../../gcc/; \
79   else \
80     if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
81       echo gcc; \
82     else \
83       t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
84     fi; \
85   fi`
86
87 #### host, target, and site specific Makefile frags come in here.
88
89 EXECUTABLES =  \
90         bitfields  \
91         break  \
92         callfuncs  \
93         coremaker  \
94         exprs  \
95         funcargs  \
96         interrupt  \
97         langs  \
98         list  \
99         mips_pro  \
100         nodebug  \
101         opaque  \
102         printcmds  \
103         ptype  \
104         recurse  \
105         return  \
106         run  \
107         scope  \
108         setvar  \
109         sigall \
110         signals  \
111         twice  \
112         watchpoint  \
113         whatis  \
114         $(CROSS_EXECUTABLES)
115
116 # List of test executables that we have available.  They are kept in
117 # uuencoded format to avoid SCCS/RCS problems with binary files.
118
119 CROSS_EXECUTABLES =  \
120         i486-elf  \
121         i860-elf  \
122         m68k-elf  \
123         m68k-aout  \
124         m68k-aout2  \
125         mips-ecoff  \
126         sparc-aout  \
127         sparc-elf
128
129 .c.o:
130         $(CC) -c $(CFLAGS) $<
131         $(CC) -E $(CFLAGS) $(srcdir)/compiler.c >$*.tmp
132         mv $*.tmp $*.ci
133
134 all:    $(EXECUTABLES)
135
136 run: run.o
137         $(CC) $(CFLAGS) $(LDFLAGS) -o run run.o $(LIBS)
138
139 whatis: whatis.o
140         $(CC) $(CFLAGS) $(LDFLAGS) -o whatis whatis.o $(LIBS)
141
142 .PRECIOUS: whatis
143
144 ptype: ptype.o
145         $(CC) $(CFLAGS) $(LDFLAGS) -o ptype ptype.o $(LIBS)
146
147 setvar: setvar.o
148         $(CC) $(CFLAGS) $(LDFLAGS) -o setvar setvar.o $(LIBS)
149
150 exprs: exprs.o
151         $(CC) $(CFLAGS) $(LDFLAGS) -o exprs exprs.o $(LIBS)
152
153 break: break.o
154         $(CC) $(CFLAGS) $(LDFLAGS) -o break break.o $(LIBS)
155
156 signals: signals.o
157         $(CC) $(CFLAGS) $(LDFLAGS) -o signals signals.o $(LIBS)
158
159 sigall: sigall.o
160         $(CC) $(CFLAGS) $(LDFLAGS) -o sigall sigall.o $(LIBS)
161
162 twice: twice.c
163         echo '#include "twice.c"' >twice-tmp.c
164         $(CC) $(CFLAGS) $(LDFLAGS) -I$(srcdir) -o twice twice-tmp.c $(LIBS)
165         rm -f twice-tmp.c
166
167 watchpoint: watchpoint.o
168         $(CC) $(CFLAGS) $(LDFLAGS) -o watchpoint watchpoint.o $(LIBS)
169
170 recurse: recurse.o
171         $(CC) $(CFLAGS) $(LDFLAGS) -o recurse recurse.o $(LIBS)
172
173 opaque: opaque0.o opaque1.o
174         $(CC) $(CFLAGS) $(LDFLAGS) -o opaque opaque0.o opaque1.o $(LIBS)
175
176 coremaker: coremaker.o
177         $(CC) $(CFLAGS) $(LDFLAGS) -o coremaker coremaker.o $(LIBS)
178
179 nodebug: nodebug.o
180         $(CC) $(LDFLAGS) $(NODEBUG_FLAGS) -o nodebug nodebug.o $(LIBS)
181
182 # This gets compiled *without* -g, so don't add CFLAGS here.
183
184 nodebug.o: nodebug.c
185         $(CC) -c $(srcdir)/nodebug.c
186
187 # For VPATH and Sun Make, we have to make explicit dependencies.
188 # DEC make doesn't seem to understand the ".u" dependency w/VPATH either.
189
190 m68k-elf: $(srcdir)/m68k-elf.u
191         uudecode $(srcdir)/m68k-elf.u
192
193 m68k-aout: $(srcdir)/m68k-aout.u
194         uudecode $(srcdir)/m68k-aout.u
195
196 m68k-aout2: $(srcdir)/m68k-aout2.u
197         uudecode $(srcdir)/m68k-aout2.u
198
199 mips-ecoff: $(srcdir)/mips-ecoff.u
200         uudecode $(srcdir)/mips-ecoff.u
201
202 i486-elf: $(srcdir)/i486-elf.u
203         uudecode $(srcdir)/i486-elf.u
204
205 sparc-aout: $(srcdir)/sparc-aout.u
206         uudecode $(srcdir)/sparc-aout.u
207
208 i860-elf: $(srcdir)/i860-elf.u
209         uudecode $(srcdir)/i860-elf.u
210
211 sparc-elf: $(srcdir)/sparc-elf.u
212         uudecode $(srcdir)/sparc-elf.u
213
214 list: list0.o list1.o
215         $(CC) $(CFLAGS) $(LDFLAGS) -o list list0.o list1.o $(LIBS)
216
217 scope: scope0.o scope1.o
218         $(CC) $(CFLAGS) $(LDFLAGS) -o scope scope0.o scope1.o $(LIBS)
219
220 langs: langs0.o langs1.o langs2.o
221         $(CC) $(CFLAGS) $(LDFLAGS) -o langs langs0.o langs1.o langs2.o $(LIBS)
222
223 bitfields: bitfields.o
224         $(CC) $(CFLAGS) $(LDFLAGS) -o bitfields.tmp bitfields.o $(LIBS)
225         mv bitfields.tmp bitfields
226
227 .PRECIOUS: bitfields
228
229 funcargs: funcargs.o
230         $(CC) $(CFLAGS) $(LDFLAGS) -o funcargs funcargs.o $(LIBS)
231
232 return: return.o
233         $(CC) $(CFLAGS) $(LDFLAGS) -o return return.o $(LIBS)
234
235 mips_pro: mips_pro.o
236         $(CC) $(CFLAGS) $(LDFLAGS) -o mips_pro mips_pro.o $(LIBS)
237
238 printcmds: printcmds.o
239         $(CC) $(CFLAGS) $(LDFLAGS) -o printcmds printcmds.o $(LIBS)
240
241 # Try compiling this with prototypes, if that fails maybe the compiler
242 # is a pre-ANSI compiler, in which case don't use prototypes.
243 callfuncs.o: callfuncs.c
244         (echo set prototypes 1 >callfuncs.tmp; \
245           $(CC) -c $(CFLAGS) $(srcdir)/callfuncs.c 2>/dev/null) \
246         || (echo set prototypes 0 >callfuncs.tmp; \
247           $(CC) -c $(CFLAGS) -DNO_PROTOTYPES $(srcdir)/callfuncs.c)
248         $(CC) $(CFLAGS) -E $(srcdir)/compiler.c >>callfuncs.tmp
249         mv callfuncs.tmp callfuncs.ci
250
251 callfuncs: callfuncs.o
252         $(CC) $(CFLAGS) $(LDFLAGS) -o callfuncs callfuncs.o $(LIBS)
253
254 interrupt: interrupt.o
255         $(CC) $(CFLAGS) $(LDFLAGS) -o interrupt interrupt.o $(LIBS)
256
257 .NOEXPORT:
258
259 INFODIRS=doc
260
261 info:
262
263 install-info:
264
265 dvi:
266
267 install:
268
269 uninstall: force
270
271 site.exp: ./config.status Makefile
272         @echo "Making a new config file..."
273         -@rm -f ./tmp?
274         @touch site.exp
275         -@mv site.exp site.bak
276         @echo "## these variables are automatically generated by make ##" > ./tmp0
277         @echo "# Do not edit here. If you wish to override these values" >> ./tmp0
278         @echo "# add them to the last section" >> ./tmp0
279         @echo "set host_triplet ${host_canonical}" >> ./tmp0
280         @echo "set target_triplet ${target_canonical}" >> ./tmp0
281         @echo "set srcdir ${srcdir}" >> ./tmp0
282                 @echo "set objdir `pwd`" >> ./tmp0
283         @echo "set tool gdb" >> ./tmp0
284         @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
285                 @cat ./tmp0 > site.exp
286         @cat site.bak | sed \
287                         -e '1,/^## All variables above are.*##/ d' >> site.exp
288         -@rm -f ./tmp?
289
290 installcheck:
291 check: site.exp all just-check
292 just-check:
293         rootme=`pwd`; export rootme; \
294         srcdir=${srcdir} ; export srcdir ; \
295         EXPECT=${EXPECT} ; export EXPECT ; \
296         if [ -f $${rootme}/../../expect/expect ] ; then  \
297           TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
298           export TCL_LIBRARY ; fi ; \
299         $(RUNTEST) $(RUNTESTFLAGS) --tool gdb --srcdir $(srcdir)
300
301 clean mostlyclean:
302         -rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES) *.ci *.tmp
303         -rm -f core core.coremaker coremaker.core corefile
304
305 distclean realclean: clean
306         -rm -f *~ core *.log *.plog *.sum *.psum site.*
307         -rm -f Makefile config.status *-init.exp
308         -rm -fr *.log summary detail *.plog *.sum *.psum site.*
309
310 Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
311         $(SHELL) ./config.status
312