aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/Makefile.in
blob: e25db0de939f66524902fc852fdde11ab78f7059 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
# Makefile for regression testing the GNU debugger.
#   Copyright (C) 1992, 93, 1994 Free Software Foundation, Inc.

# This file is part of GDB.

# GDB is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2, or (at your option)
# any later version.

# GDB is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# You should have received a copy of the GNU General Public License
# along with this program; see the file COPYING.  If not, write to
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.

srcdir = .
prefix = /usr/local
program_transform_name =

exec_prefix = $(prefix)
bindir = $(exec_prefix)/bin
libdir = $(exec_prefix)/lib
tooldir = $(libdir)/$(target_alias)

datadir = $(exec_prefix)/lib/dejagnu
mandir = $(prefix)/man
man1dir = $(mandir)/man1
man2dir = $(mandir)/man2
man3dir = $(mandir)/man3
man4dir = $(mandir)/man4
man5dir = $(mandir)/man5
man6dir = $(mandir)/man6
man7dir = $(mandir)/man7
man8dir = $(mandir)/man8
man9dir = $(mandir)/man9
infodir = $(prefix)/info
includedir = $(prefix)/include
gxx_includedir = $(tooldir)/g++-include
docdir = $(datadir)/doc
targetdir = $(datadir)/$(target_alias)

SHELL = /bin/sh

INSTALL = install -c
INSTALL_PROGRAM = $(INSTALL)
INSTALL_DATA = $(INSTALL)

CFLAGS = -g
# start-sanitize-chill
CHILLFLAGS = $(CFLAGS)
# end-sanitize-chill
# This should probably be consistent with the top-level Makefile.in,
# gdb/Makefile.in, and gdb/testsuite/gdb.t2*/Makefile.in, so that "make check"
# has the same effect no matter where it is run.
CXXFLAGS = -g -O

LINK=		ln -s

RUNTEST = runtest

EXPECT = `if [ -f $${rootme}/../../expect/expect ] ; then \
          echo $${rootme}/../../expect/expect ; \
          else echo expect ; fi`

RUNTEST_FOR_TARGET = ` \
  if [ -f $${rootme}/../../dejagnu/site.exp ] ; then \
    echo $${rootme}/../../dejagnu/runtest ; \
  else \
    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
      echo $(RUNTEST); \
    else \
      t='$(program_transform_name)'; echo runtest | sed -e '' $$t; \
    fi; \
  fi`

RUNTESTFLAGS = 

CC_FOR_TARGET = ` \
  if [ -f $${rootme}/../../gcc/xgcc ] ; then \
    echo $${rootme}/../../gcc/xgcc -B$${rootme}/../../gcc/; \
  else \
    if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \
      echo $(CC); \
    else \
      t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \
    fi; \
  fi`

CFLAGS_FOR_TARGET = $(CFLAGS)

GDB = ` \
  if [ -f $${rootme}/../gdb ] ; \
    then echo $${rootme}|sed -e 's@/[^/]*$$@@'|sed -e 's@$$@/gdb@' ; \
    else echo gdb; \
  fi`

GDBFLAGS = -nx

#### host, target, and site specific Makefile frags come in here.

EXECUTABLES =  \
	bitfields  \
	break  \
	callfuncs  \
	coremaker  \
	exprs  \
	funcargs  \
	interrupt  \
	list  \
	mips_pro  \
	nodebug  \
	opaque  \
	opaque-info.exp  \
	printcmds  \
	ptype  \
	recurse  \
	return  \
	run  \
	scope  \
	setvar  \
	signals  \
	t10  \
	twice  \
	watchpoint  \
	whatis  \
	whatis-info.exp  \
	$(CROSS_EXECUTABLES)

# List of test executables that we have available.  They are kept in
# uuencoded format to avoid SCCS/RCS problems with binary files.

CROSS_EXECUTABLES =  \
	i486-elf  \
	i860-elf  \
	m68k-elf  \
	m68k-aout  \
	m68k-aout2  \
	mips-ecoff  \
	sparc-aout  \
	sparc-elf

all:	$(EXECUTABLES) corefile

CC_CFLAGS_LD_FOR_TARGET = $(CC_FOR_TARGET) $(CFLAGS) $(LDFLAGS_FOR_TARGET)

CC_CFLAGS_FOR_TARGET = $(CC_FOR_TARGET) $(CFLAGS_FOR_TARGET)

run: run.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o run run.o $(LIBS)

run.o: run.c
	$(CC_FOR_TARGET) $(CFLAGS) -c $(srcdir)/run.c

# We want to make sure comp-info.exp reflects the way that whatis was compiled;
# that's why this isn't a separate rule.

whatis whatis-info.exp: whatis.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o whatis.tmp whatis.o $(LIBS)
	$(CC_FOR_TARGET) $(CFLAGS) -E $(srcdir)/whatis-info.c >whatis-info.tmp
	mv whatis-info.tmp whatis-info.exp
	mv whatis.tmp whatis

.PRECIOUS: whatis whatis-info.exp

whatis.o: whatis.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/whatis.c

ptype: ptype.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o ptype ptype.o $(LIBS)

ptype.o: ptype.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/ptype.c

setvar: setvar.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o setvar setvar.o $(LIBS)

setvar.o: setvar.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/setvar.c

exprs: exprs.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o exprs exprs.o $(LIBS)

exprs.o: exprs.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/exprs.c

break: break.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o break break.o $(LIBS)

break.o: break.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/break.c

signals: signals.o
	${CC} ${CFLAGS} ${LDFLAGS_FOR_TARGET} -o signals signals.o ${LIBS}

signals.o: signals.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/signals.c

twice: twice.c
	echo '#include "twice.c"' >twice-tmp.c
	$(CC_CFLAGS_LD_FOR_TARGET) -I$(srcdir) -o twice twice-tmp.c $(LIBS)
	rm -f twice-tmp.c

watchpoint: watchpoint.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o watchpoint watchpoint.o $(LIBS)

watchpoint.o: watchpoint.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/watchpoint.c

recurse: recurse.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o recurse recurse.o $(LIBS)

recurse.o: recurse.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/recurse.c

# We want to make sure opaque-info.exp reflects the way that opaque
# was compiled; that's why this isn't a separate rule.

opaque opaque-info.exp: opaque0.o opaque1.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o opaque.tmp opaque0.o opaque1.o $(LIBS)
	$(CC_CFLAGS_FOR_TARGET) -E $(srcdir)/opaque-info.c >opaque-info.tmp
	mv opaque-info.tmp opaque-info.exp
	mv opaque.tmp opaque

opaque0.o: opaque0.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/opaque0.c

opaque1.o: opaque1.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/opaque1.c

coremaker: coremaker.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o coremaker coremaker.o $(LIBS)

coremaker.o: coremaker.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/coremaker.c

# Create a core file named "corefile" rather than just "core", to
# avoid problems with sys admin types that like to regularly prune all
# files named "core" from the system.
# bsd 386 systems append the name of the program to the corefile name.

corefile: coremaker
	-rm -f core
	-echo Expect a coredump from this next command...
	-./coremaker >/dev/null 2>&1 || true
	-if [ -f core ]; then mv core corefile; else true; fi
	-if [ -f core.coremaker ]; then mv core.coremaker corefile; else true; fi

nodebug: nodebug.o
	$(CC_FOR_TARGET) $(LDFLAGS_FOR_TARGET) -o nodebug nodebug.o $(LIBS)

# This gets compiled *without* -g, so don't add CFLAGS here.

nodebug.o: nodebug.c
	$(CC_FOR_TARGET) -c $(srcdir)/nodebug.c

# For VPATH and Sun Make, we have to make explicit dependencies.
# DEC make doesn't seem to understand the ".u" dependency w/VPATH either.

m68k-elf: $(srcdir)/m68k-elf.u
	uudecode $(srcdir)/m68k-elf.u

m68k-aout: $(srcdir)/m68k-aout.u
	uudecode $(srcdir)/m68k-aout.u

m68k-aout2: $(srcdir)/m68k-aout2.u
	uudecode $(srcdir)/m68k-aout2.u

mips-ecoff: $(srcdir)/mips-ecoff.u
	uudecode $(srcdir)/mips-ecoff.u

i486-elf: $(srcdir)/i486-elf.u
	uudecode $(srcdir)/i486-elf.u

sparc-aout: $(srcdir)/sparc-aout.u
	uudecode $(srcdir)/sparc-aout.u

i860-elf: $(srcdir)/i860-elf.u
	uudecode $(srcdir)/i860-elf.u

sparc-elf: $(srcdir)/sparc-elf.u
	uudecode $(srcdir)/sparc-elf.u

t10: t10.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o t10 t10.o $(LIBS)

list: list0.o list1.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o list list0.o list1.o $(LIBS)

list0.o: list0.c list0.h
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/list0.c

list1.o: list1.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/list1.c

scope: scope0.o scope1.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o scope scope0.o scope1.o $(LIBS)

scope0.o: scope0.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/scope0.c

scope1.o: scope1.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/scope1.c

bitfields: bitfields.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o bitfields.tmp bitfields.o $(LIBS)
	mv bitfields.tmp bitfields

.PRECIOUS: bitfields

bitfields.o: bitfields.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/bitfields.c

funcargs: funcargs.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o funcargs funcargs.o $(LIBS)

funcargs.o: funcargs.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/funcargs.c

return: return.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o return return.o $(LIBS)

return.o: return.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/return.c

mips_pro: mips_pro.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o mips_pro mips_pro.o $(LIBS)

mips_pro.o: mips_pro.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/mips_pro.c

printcmds: printcmds.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o printcmds printcmds.o $(LIBS)

printcmds.o: printcmds.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/printcmds.c

callfuncs: callfuncs.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o callfuncs callfuncs.o $(LIBS)

callfuncs.o: callfuncs.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/callfuncs.c

interrupt: interrupt.o
	$(CC_CFLAGS_LD_FOR_TARGET) -o interrupt interrupt.o $(LIBS)

interrupt.o: interrupt.c
	$(CC_CFLAGS_FOR_TARGET) -c $(srcdir)/interrupt.c

.NOEXPORT:
INFODIRS=doc
info:
install-info:
dvi:

install:

uninstall: force

site.exp: ./config.status Makefile
	@echo "Making a new config file..."
	-@rm -f ./tmp?
	@touch site.exp
	-@mv site.exp site.bak
	@echo "## these variables are automatically generated by make ##" > ./tmp0
	@echo "# Do not edit here. If you wish to override these values" >> ./tmp0
	@echo "# add them to the last section" >> ./tmp0
	@echo "set GDBFLAGS \"${GDBFLAGS}\"" >> ./tmp0
	@echo "set host_os ${host_os}" >> ./tmp0
	@echo "set host_alias ${host_alias}" >> ./tmp0
	@echo "set host_cpu ${host_cpu}" >> ./tmp0
	@echo "set host_vendor ${host_vendor}" >> ./tmp0
	@echo "set target_os ${target_os}" >> ./tmp0
	@echo "set target_alias ${target_alias}" >> ./tmp0
	@echo "set target_cpu ${target_cpu}" >> ./tmp0
	@echo "set target_vendor ${target_vendor}" >> ./tmp0
	@echo "set host_triplet ${host_canonical}" >> ./tmp0
	@echo "set target_triplet ${target_canonical}" >> ./tmp0
	@echo "set srcdir ${srcdir}" >> ./tmp0
		@echo "set objdir `pwd`" >> ./tmp0
	@echo "set tool gdb" >> ./tmp0
	@echo "## All variables above are generated by configure. Do Not Edit ##" >> ./tmp0
		@cat ./tmp0 > site.exp
	@cat site.bak | sed \
			-e '1,/^## All variables above are.*##/ d' >> site.exp
	-@rm -f ./tmp?

installcheck:
check: site.exp all just-check
just-check:
	rootme=`pwd`; export rootme; \
	srcdir=${srcdir} ; export srcdir ; \
	EXPECT=${EXPECT} ; export EXPECT ; \
	if [ -f $${rootme}/../../expect/expect ] ; then  \
	  TCL_LIBRARY=$${srcdir}/../../tcl/library ; \
	  export TCL_LIBRARY ; fi ; \
	$(RUNTEST_FOR_TARGET) $(RUNTESTFLAGS) --tool gdb GDB=$(GDB) --srcdir $(srcdir)

clean mostlyclean:
	-rm -f *~ *.o a.out xgdb *.x $(EXECUTABLES)
	-rm -f core core.coremaker corefile

distclean realclean: clean
	-rm -f *~ core *.log *.plog *.sum *.psum site.*
	-rm -f Makefile config.status *-init.exp
	-rm -fr *.log summary detail *.plog *.sum *.psum site.*

Makefile : $(srcdir)/Makefile.in $(srcdir)/configure.in $(host_makefile_frag) $(target_makefile_frag)
	$(SHELL) ./config.status