]>
Commit | Line | Data |
---|---|---|
be813d02 | 1 | # Makefile for the base tests for GDB. |
65424cda | 2 | # Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc. |
ef44eed1 SS |
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 | |
ce102e96 FF |
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. | |
ef44eed1 SS |
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 | |
ef44eed1 | 53 | |
be813d02 | 54 | RUNTESTFLAGS = |
ef44eed1 | 55 | |
be813d02 | 56 | LINK= ln -s |
ef44eed1 | 57 | |
be813d02 C |
58 | EXPECT = ` \ |
59 | if [ -f $${rootme}/../../../expect/expect ] ; then \ | |
60 | echo $${rootme}/../../../expect/expect ; \ | |
61 | else \ | |
62 | echo expect ; \ | |
63 | fi` | |
ef44eed1 | 64 | |
be813d02 | 65 | RUNTEST = ` \ |
ef44eed1 SS |
66 | if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \ |
67 | echo $${rootme}/../../dejagnu/runtest ; \ | |
68 | else \ | |
69 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
be813d02 | 70 | echo runtest; \ |
ef44eed1 SS |
71 | else \ |
72 | t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \ | |
73 | fi; \ | |
74 | fi` | |
75 | ||
be813d02 C |
76 | CC = ` \ |
77 | if [ -f $${rootme}/../../../gcc/xgcc ] ; then \ | |
78 | echo $${rootme}/../../../gcc/xgcc -B$${rootme}/../../../gcc/; \ | |
ef44eed1 SS |
79 | else \ |
80 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
be813d02 | 81 | echo gcc; \ |
ef44eed1 SS |
82 | else \ |
83 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
84 | fi; \ | |
85 | fi` | |
86 | ||
ef44eed1 SS |
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 \ | |
be813d02 | 97 | langs \ |
ef44eed1 SS |
98 | list \ |
99 | mips_pro \ | |
100 | nodebug \ | |
101 | opaque \ | |
ef44eed1 SS |
102 | printcmds \ |
103 | ptype \ | |
104 | recurse \ | |
105 | return \ | |
106 | run \ | |
107 | scope \ | |
108 | setvar \ | |
be813d02 | 109 | sigall \ |
ef44eed1 | 110 | signals \ |
ef44eed1 SS |
111 | twice \ |
112 | watchpoint \ | |
113 | whatis \ | |
ef44eed1 SS |
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 | ||
be813d02 C |
129 | .c.o: |
130 | $(CC) -c $(CFLAGS) $< | |
ce102e96 FF |
131 | $(CC) -E $(CFLAGS) $(srcdir)/compiler.c >$*.tmp |
132 | mv $*.tmp $*.ci | |
ef44eed1 | 133 | |
be813d02 | 134 | all: $(EXECUTABLES) |
ef44eed1 SS |
135 | |
136 | run: run.o | |
be813d02 | 137 | $(CC) $(CFLAGS) $(LDFLAGS) -o run run.o $(LIBS) |
ef44eed1 | 138 | |
ce102e96 FF |
139 | whatis: whatis.o |
140 | $(CC) $(CFLAGS) $(LDFLAGS) -o whatis whatis.o $(LIBS) | |
ef44eed1 | 141 | |
ce102e96 | 142 | .PRECIOUS: whatis |
ef44eed1 | 143 | |
ef44eed1 | 144 | ptype: ptype.o |
be813d02 | 145 | $(CC) $(CFLAGS) $(LDFLAGS) -o ptype ptype.o $(LIBS) |
ef44eed1 SS |
146 | |
147 | setvar: setvar.o | |
be813d02 | 148 | $(CC) $(CFLAGS) $(LDFLAGS) -o setvar setvar.o $(LIBS) |
ef44eed1 SS |
149 | |
150 | exprs: exprs.o | |
be813d02 | 151 | $(CC) $(CFLAGS) $(LDFLAGS) -o exprs exprs.o $(LIBS) |
ef44eed1 SS |
152 | |
153 | break: break.o | |
be813d02 | 154 | $(CC) $(CFLAGS) $(LDFLAGS) -o break break.o $(LIBS) |
ef44eed1 SS |
155 | |
156 | signals: signals.o | |
be813d02 | 157 | $(CC) $(CFLAGS) $(LDFLAGS) -o signals signals.o $(LIBS) |
ef44eed1 | 158 | |
be813d02 C |
159 | sigall: sigall.o |
160 | $(CC) $(CFLAGS) $(LDFLAGS) -o sigall sigall.o $(LIBS) | |
ef44eed1 SS |
161 | |
162 | twice: twice.c | |
163 | echo '#include "twice.c"' >twice-tmp.c | |
be813d02 | 164 | $(CC) $(CFLAGS) $(LDFLAGS) -I$(srcdir) -o twice twice-tmp.c $(LIBS) |
ef44eed1 SS |
165 | rm -f twice-tmp.c |
166 | ||
167 | watchpoint: watchpoint.o | |
be813d02 | 168 | $(CC) $(CFLAGS) $(LDFLAGS) -o watchpoint watchpoint.o $(LIBS) |
ef44eed1 SS |
169 | |
170 | recurse: recurse.o | |
be813d02 | 171 | $(CC) $(CFLAGS) $(LDFLAGS) -o recurse recurse.o $(LIBS) |
ef44eed1 | 172 | |
ce102e96 FF |
173 | opaque: opaque0.o opaque1.o |
174 | $(CC) $(CFLAGS) $(LDFLAGS) -o opaque opaque0.o opaque1.o $(LIBS) | |
ef44eed1 | 175 | |
ef44eed1 | 176 | coremaker: coremaker.o |
be813d02 | 177 | $(CC) $(CFLAGS) $(LDFLAGS) -o coremaker coremaker.o $(LIBS) |
ef44eed1 SS |
178 | |
179 | nodebug: nodebug.o | |
be813d02 | 180 | $(CC) $(LDFLAGS) $(NODEBUG_FLAGS) -o nodebug nodebug.o $(LIBS) |
ef44eed1 SS |
181 | |
182 | # This gets compiled *without* -g, so don't add CFLAGS here. | |
183 | ||
184 | nodebug.o: nodebug.c | |
be813d02 | 185 | $(CC) -c $(srcdir)/nodebug.c |
5762d8c6 FF |
186 | $(CC) -E $(srcdir)/compiler.c >nodebug.tmp |
187 | mv nodebug.tmp nodebug.ci | |
ef44eed1 SS |
188 | |
189 | # For VPATH and Sun Make, we have to make explicit dependencies. | |
190 | # DEC make doesn't seem to understand the ".u" dependency w/VPATH either. | |
191 | ||
192 | m68k-elf: $(srcdir)/m68k-elf.u | |
193 | uudecode $(srcdir)/m68k-elf.u | |
194 | ||
195 | m68k-aout: $(srcdir)/m68k-aout.u | |
196 | uudecode $(srcdir)/m68k-aout.u | |
197 | ||
198 | m68k-aout2: $(srcdir)/m68k-aout2.u | |
199 | uudecode $(srcdir)/m68k-aout2.u | |
200 | ||
201 | mips-ecoff: $(srcdir)/mips-ecoff.u | |
202 | uudecode $(srcdir)/mips-ecoff.u | |
203 | ||
204 | i486-elf: $(srcdir)/i486-elf.u | |
205 | uudecode $(srcdir)/i486-elf.u | |
206 | ||
207 | sparc-aout: $(srcdir)/sparc-aout.u | |
208 | uudecode $(srcdir)/sparc-aout.u | |
209 | ||
210 | i860-elf: $(srcdir)/i860-elf.u | |
211 | uudecode $(srcdir)/i860-elf.u | |
212 | ||
213 | sparc-elf: $(srcdir)/sparc-elf.u | |
214 | uudecode $(srcdir)/sparc-elf.u | |
215 | ||
ef44eed1 | 216 | list: list0.o list1.o |
be813d02 | 217 | $(CC) $(CFLAGS) $(LDFLAGS) -o list list0.o list1.o $(LIBS) |
ef44eed1 SS |
218 | |
219 | scope: scope0.o scope1.o | |
be813d02 | 220 | $(CC) $(CFLAGS) $(LDFLAGS) -o scope scope0.o scope1.o $(LIBS) |
ef44eed1 | 221 | |
be813d02 C |
222 | langs: langs0.o langs1.o langs2.o |
223 | $(CC) $(CFLAGS) $(LDFLAGS) -o langs langs0.o langs1.o langs2.o $(LIBS) | |
ef44eed1 SS |
224 | |
225 | bitfields: bitfields.o | |
be813d02 | 226 | $(CC) $(CFLAGS) $(LDFLAGS) -o bitfields.tmp bitfields.o $(LIBS) |
ef44eed1 SS |
227 | mv bitfields.tmp bitfields |
228 | ||
229 | .PRECIOUS: bitfields | |
230 | ||
ef44eed1 | 231 | funcargs: funcargs.o |
be813d02 | 232 | $(CC) $(CFLAGS) $(LDFLAGS) -o funcargs funcargs.o $(LIBS) |
ef44eed1 SS |
233 | |
234 | return: return.o | |
be813d02 | 235 | $(CC) $(CFLAGS) $(LDFLAGS) -o return return.o $(LIBS) |
ef44eed1 SS |
236 | |
237 | mips_pro: mips_pro.o | |
be813d02 | 238 | $(CC) $(CFLAGS) $(LDFLAGS) -o mips_pro mips_pro.o $(LIBS) |
ef44eed1 SS |
239 | |
240 | printcmds: printcmds.o | |
be813d02 | 241 | $(CC) $(CFLAGS) $(LDFLAGS) -o printcmds printcmds.o $(LIBS) |
ef44eed1 | 242 | |
96fd3d08 PS |
243 | # Try compiling this with prototypes, if that fails maybe the compiler |
244 | # is a pre-ANSI compiler, in which case don't use prototypes. | |
245 | callfuncs.o: callfuncs.c | |
ce102e96 | 246 | (echo set prototypes 1 >callfuncs.tmp; \ |
96fd3d08 | 247 | $(CC) -c $(CFLAGS) $(srcdir)/callfuncs.c 2>/dev/null) \ |
ce102e96 | 248 | || (echo set prototypes 0 >callfuncs.tmp; \ |
96fd3d08 | 249 | $(CC) -c $(CFLAGS) -DNO_PROTOTYPES $(srcdir)/callfuncs.c) |
ce102e96 FF |
250 | $(CC) $(CFLAGS) -E $(srcdir)/compiler.c >>callfuncs.tmp |
251 | mv callfuncs.tmp callfuncs.ci | |
96fd3d08 | 252 | |
ef44eed1 | 253 | callfuncs: callfuncs.o |
be813d02 | 254 | $(CC) $(CFLAGS) $(LDFLAGS) -o callfuncs callfuncs.o $(LIBS) |
ef44eed1 SS |
255 | |
256 | interrupt: interrupt.o | |
be813d02 | 257 | $(CC) $(CFLAGS) $(LDFLAGS) -o interrupt interrupt.o $(LIBS) |
ef44eed1 SS |
258 | |
259 | .NOEXPORT: | |
be813d02 | 260 | |
ef44eed1 | 261 | INFODIRS=doc |
be813d02 | 262 | |
ef44eed1 | 263 | info: |
be813d02 | 264 | |
ef44eed1 | 265 | install-info: |
be813d02 | 266 | |
ef44eed1 SS |
267 | dvi: |
268 | ||
269 | install: | |
270 | ||
271 | uninstall: force | |
272 | ||
273 | site.exp: ./config.status Makefile | |
274 | @echo "Making a new config file..." | |
275 | -@rm -f ./tmp? | |
276 | @touch site.exp | |
277 | -@mv site.exp site.bak | |
278 | @echo "## these variables are automatically generated by make ##" > ./tmp0 | |
279 | @echo "# Do not edit here. If you wish to override these values" >> ./tmp0 | |
280 | @echo "# add them to the last section" >> ./tmp0 | |
ef44eed1 SS |
281 | @echo "set host_triplet ${host_canonical}" >> ./tmp0 |
282 | @echo "set target_triplet ${target_canonical}" >> ./tmp0 | |
283 | @echo "set srcdir ${srcdir}" >> ./tmp0 | |
284 | @echo "set objdir `pwd`" >> ./tmp0 | |
285 | @echo "set tool gdb" >> ./tmp0 | |
286 | @echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0 | |
287 | @cat ./tmp0 > site.exp | |
288 | @cat site.bak | sed \ | |
289 | -e '1,/^## All variables above are.*##/ d' >> site.exp | |
290 | -@rm -f ./tmp? | |
291 | ||
292 | installcheck: | |
293 | check: site.exp all just-check | |
294 | just-check: | |
295 | rootme=`pwd`; export rootme; \ | |
296 | srcdir=${srcdir} ; export srcdir ; \ | |
297 | EXPECT=${EXPECT} ; export EXPECT ; \ | |
298 | if [ -f $${rootme}/../../expect/expect ] ; then \ | |
299 | TCL_LIBRARY=$${srcdir}/../../tcl/library ; \ | |
300 | export TCL_LIBRARY ; fi ; \ | |
65424cda | 301 | $(RUNTEST) $(RUNTESTFLAGS) --tool gdb --srcdir $(srcdir) |
ef44eed1 SS |
302 | |
303 | clean mostlyclean: | |
ce102e96 | 304 | -rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES) *.ci *.tmp |
be813d02 | 305 | -rm -f core core.coremaker coremaker.core corefile |
ef44eed1 SS |
306 | |
307 | distclean realclean: clean | |
308 | -rm -f *~ core *.log *.plog *.sum *.psum site.* | |
309 | -rm -f Makefile config.status *-init.exp | |
310 | -rm -fr *.log summary detail *.plog *.sum *.psum site.* | |
311 | ||
312 | Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag) | |
313 | $(SHELL) ./config.status | |
314 |