now handle doc subdir, too
[deliverable/binutils-gdb.git] / gdb / Makefile.in
CommitLineData
bd5635a1
RP
1##Copyright (C) 1989-1991 Free Software Foundation, Inc.
2
3# This file is part of GDB.
4
bdf3621b 5# This program is free software; you can redistribute it and/or modify
bd5635a1 6# it under the terms of the GNU General Public License as published by
bdf3621b
JG
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,
bd5635a1
RP
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.
bdf3621b 14#
bd5635a1 15# You should have received a copy of the GNU General Public License
bdf3621b
JG
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
19# Host and target-dependent makefile fragments come in here.
20####
6988f5c0 21# End of host and target-dependent makefile fragments
bd5635a1 22
e73dbe5d 23# Destination directory of the software tree build
02f25e46 24ddestdir = /usr/local
912e0732 25
e73dbe5d 26# Place to install binaries in the destination tree.
02f25e46 27bindir=$(ddestdir)/bin
bd5635a1
RP
28
29# System V: If you compile gdb with a compiler which uses the coff
30# encapsulation feature (this is a function of the compiler used, NOT
31# of the m-?.h file selected by config.gdb), you must make sure that
32# the GNU nm is the one that is used by munch.
33
34# If you are compiling with GCC, make sure that either 1) You use the
35# -traditional flag, or 2) You have the fixed include files where GCC
17563ca1 36# can reach them. Otherwise the ioctl calls in inflow.c
bd5635a1
RP
37# will be incorrectly compiled. The "fixincludes" script in the gcc
38# distribution will fix your include files up.
39#CC=cc
40#CC=gcc -traditional
41GCC=gcc
42
bdf3621b
JG
43# Directory containing source files. Don't clean up the spacing,
44# this exact string is matched for by the "configure" script.
45srcdir = .
bd5635a1
RP
46
47# It is also possible that you will need to add -I/usr/include/sys to the
48# CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
49# is where it should be according to Posix).
50
f9584c6d
RP
51BISON=bison -y
52BISONFLAGS=
dc0c3f64 53YACC=$(BISON) $(BISONFLAGS)
bd5635a1
RP
54# YACC=yacc
55SHELL=/bin/sh
56MAKE=make
59500745
RP
57
58# Documentation (gdb.dvi) needs either GNU m4 or SysV m4;
59# Berkeley/Sun don't have quite enough.
60#M4=/usr/5bin/m4
61M4=gm4
dc0c3f64
JG
62
63# where to find texinfo; GDB dist should include a recent one
59500745 64TEXIDIR=${srcdir}/../texinfo/fsf
bd5635a1 65
dc0c3f64
JG
66# where to find makeinfo, preferably one designed for texinfo-2
67MAKEINFO=makeinfo
68
bd5635a1
RP
69# Set this up with gcc if you have gnu ld and the loader will print out
70# line numbers for undefinded refs.
71#CC-LD=gcc -static
72CC-LD=${CC}
73
74# define this to be "gmalloc.o" if you want to use the gnu malloc routine
75# (useful for debugging memory allocation problems in gdb). To use your
76# system malloc, uncomment the following two lines.
77#GNU_MALLOC =
78#MALLOC_CFLAGS = -DNO_MALLOC_CHECK
31ef19fc 79GNU_MALLOC = gmalloc.o mcheck.o mtrace.o
bd5635a1
RP
80MALLOC_CFLAGS =
81
82# Where is the "include" directory? Traditionally ../include or ./include
83INCLUDE_DIR = ${srcdir}/../include
84INCLUDE_DEP = $$(INCLUDE_DIR)
85
77ac9392
JG
86# Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd
87# (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.)
bd5635a1
RP
88BFD_DIR = ${srcdir}/../bfd
89BFD_DEP = $$(BFD_DIR)
02f25e46 90BFD_LIB = $(unsubdir)/../bfd${subdir}/libbfd.a
bd5635a1 91
e73dbe5d
JG
92# Where is the source dir for the READLINE library? Traditionally in .. or .
93# (For the binary library built from it, we use ${READLINE_DIR}${subdir}.)
94READLINE_DIR = ${srcdir}/../readline
95READLINE_DEP = $$(READLINE_DIR)
02f25e46 96RL_LIB = $(unsubdir)/../readline${subdir}/libreadline.a
beff312e 97
bd5635a1
RP
98# All the includes used for CFLAGS and for lint.
99# -I. for config files.
63989338 100# -I${srcdir} possibly for regex.h also.
beff312e 101INCLUDE_CFLAGS = -I. -I${srcdir} -I$(INCLUDE_DIR) -I$(READLINE_DIR) -I${srcdir}/vx-share
bd5635a1
RP
102
103# {X,T}M_CFLAGS, if defined, has system-dependent CFLAGS.
17563ca1 104# CFLAGS for GDB
35350222
SC
105MINUS_G=-g
106GLOBAL_CFLAGS = $(MINUS_G) ${TM_CFLAGS} ${XM_CFLAGS}
bd5635a1
RP
107#PROFILE_CFLAGS = -pg
108
109CFLAGS = ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MALLOC_CFLAGS} ${INCLUDE_CFLAGS}
110# None of the things in CFLAGS will do any harm, and on some systems
111# (e.g. SunOS4) it is important to use the M_CFLAGS.
112LDFLAGS = $(CFLAGS)
113
63989338 114# Where is the "-liberty" library, containing getopt and obstack?
5594d534 115LIBIBERTY_DIR = ${srcdir}/../libiberty
02f25e46 116LIBIBERTY = $(unsubdir)/../libiberty${subdir}/libiberty.a
bd5635a1
RP
117
118# Flags that describe where you can find the termcap library.
119# You may need to make other arrangements for USG.
120TERMCAP = -ltermcap
121
e73dbe5d 122# The xconfig file must define REGEX and REGEX1 on USG machines.
bd5635a1 123# If your sysyem is missing alloca(), or, more likely, it's there but
e73dbe5d 124# it doesn't work, define ALLOCA & ALLOCA1 too.
17563ca1 125# If your system is missing putenv(), add putenv.c to XM_ADD_FILES.
bd5635a1 126
e73dbe5d
JG
127# Libraries and corresponding dependencies for compiling gdb.
128# {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs.
44f0c5db 129# TERMCAP comes after readline, since readline depends on it.
b715d5b4 130CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${LIBIBERTY} ${XM_CLIBS} ${TM_CLIBS}
e73dbe5d 131CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB}
bd5635a1 132
17563ca1
JG
133ADD_FILES = ${REGEX} ${ALLOCA} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
134ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES}
bd5635a1 135
19230be6 136VERSION = 4.2.3
dc0c3f64 137DIST=gdb
bd5635a1
RP
138
139LINT=/usr/5bin/lint
19230be6 140LINTFLAGS= -I${BFD_DIR}
bd5635a1
RP
141
142# Source files in the main directory.
143# Files which are included via a tconfig/* or xconfig/* file
144# should *not* be specified here; they're in "ALLDEPFILES".
145SFILES_MAINDIR = \
146 blockframe.c breakpoint.c command.c core.c \
147 environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \
148 main.c printcmd.c \
149 remote.c source.c stack.c symmisc.c symtab.c symfile.c \
56d921a8 150 utils.c valarith.c valops.c valprint.c values.c c-exp.y m2-exp.y \
bd5635a1 151 signame.c cplus-dem.c mem-break.c target.c inftarg.c \
19230be6 152 dbxread.c coffread.c elfread.c dwarfread.c xcoffread.c \
2ce38c6d 153 ieee-float.c language.c parse.c buildsym.c
bd5635a1
RP
154
155# Source files in subdirectories (which will be handled separately by
156# 'make gdb.tar.Z').
157# Files which are included via a tconfig/* or xconfig/* file
158# should *not* be specified here; they're in "ALLDEPFILES".
159SFILES_SUBDIR = \
160 ${srcdir}/vx-share/dbgRpcLib.h \
161 ${srcdir}/vx-share/ptrace.h \
162 ${srcdir}/vx-share/reg.h \
163 ${srcdir}/vx-share/vxTypes.h \
164 ${srcdir}/vx-share/vxWorks.h \
165 ${srcdir}/vx-share/wait.h \
166 ${srcdir}/vx-share/xdr_ld.h \
167 ${srcdir}/vx-share/xdr_ptrace.h \
168 ${srcdir}/vx-share/xdr_rdb.h \
169 ${srcdir}/vx-share/xdr_regs.h \
bd5635a1
RP
170 ${srcdir}/nindy-share/b.out.h \
171 ${srcdir}/nindy-share/block_io.h \
172 ${srcdir}/nindy-share/coff.h \
173 ${srcdir}/nindy-share/demux.h \
174 ${srcdir}/nindy-share/env.h \
175 ${srcdir}/nindy-share/stop.h \
176 ${srcdir}/nindy-share/ttycntl.h
177
dc0c3f64
JG
178# Non-source files in subdirs, that should go into gdb.tar.Z.
179NONSRC_SUBDIR = \
180 ${srcdir}/nindy-share/Makefile \
181 ${srcdir}/nindy-share/VERSION
182
bd5635a1
RP
183# All source files that go into linking GDB, except config-specified files.
184SFILES = $(SFILES_MAINDIR) $(SFILES_SUBDIR)
185
186# All source files that lint should look at
56d921a8 187LINTFILES = $(SFILES) $(YYFILES) init.c
bd5635a1
RP
188
189# Any additional files specified on these lines should also be added to
190# the OTHERS = definition below, so they go in the tar files.
191SFILES_STAND = $(SFILES) standalone.c
192SFILES_KGDB = $(SFILES) stuff.c kdb-start.c
193
194# Header files that are not named in tconfig/* or xconfig/* go here.
195HFILES= breakpoint.h command.h defs.h environ.h \
531dca49
JG
196 expression.h frame.h gdbcmd.h gdbcore.h getpagesize.h \
197 ieee-float.h inferior.h minimon.h param-no-tm.h param.h \
bd5635a1
RP
198 signals.h signame.h symfile.h symtab.h \
199 target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \
56d921a8 200 language.h parser-defs.h value.h
bd5635a1 201
e73dbe5d
JG
202# Header files for machine opcode tables.
203# when OPCODE_DIR changes to ../include, remove the whole $(OPCODES)
204# business, since they will be included in the separate includes tar file
205# rather than in the gdb tar file.
206OPCODE_DIR =
207OPCODES = $(OPCODE_DIR)pn-opcode.h $(OPCODE_DIR)np1-opcode.h \
208 $(OPCODE_DIR)sparc-opcode.h $(OPCODE_DIR)vax-opcode.h \
209 $(OPCODE_DIR)m68k-opcode.h $(OPCODE_DIR)ns32k-opcode.h \
210 $(OPCODE_DIR)convx-opcode.h $(OPCODE_DIR)pyr-opcode.h \
17563ca1
JG
211 $(OPCODE_DIR)mips-opcode.h $(OPCODE_DIR)am29k-opcode.h \
212 $(OPCODE_DIR)arm-opcode.h $(OPCODE_DIR)m88k-opcode.h \
213 $(OPCODE_DIR)tahoe-opcode.h
bd5635a1 214
17563ca1 215REMOTE_EXAMPLES = m68k-stub.c i386-stub.c rem-multi.shar
bd5635a1 216
31ef19fc 217MALLOCSRC = gmalloc.c mcheck.c mtrace.c mtrace.awk \
4ffd3047 218 ansidecl.h gmalloc.h
bd5635a1 219
63989338
JG
220POSSLIBS_MAINDIR = regex.c regex.h alloca.c $(MALLOCSRC)
221POSSLIBS = $(POSSLIBS_MAINDIR)
bd5635a1
RP
222
223TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c
224
bce4bf52 225# tdesc-lib cannot be named simply tdesc, because if it were, GNU make
bd5635a1 226# would try to make it from tdesc.c.
3dfb315e 227OTHERS = Makefile.in depend alldeps.mak createtags munch configure.in \
625453dc 228 ChangeLog ChangeLog-3.x refcard.ps \
bce4bf52 229 README TODO TAGS WHATS.NEW Projects \
56d921a8 230 .gdbinit COPYING $(YYFILES) \
bce4bf52 231 copying.c Convex.notes copying.awk \
19230be6 232 saber.suppress standalone.c stuff.c tdesc-lib kdb-start.c \
bce4bf52
RP
233 putenv.c
234
235# Subdirectories of gdb, which should be included in their entirety in
236# gdb-xxx.tar.Z:
3dfb315e 237TARDIRS = doc # tests
bd5635a1 238
7bfa94e2
RP
239# GDB "info" files, which should be included in their entirety
240INFOFILES = gdb.info*
241
bd5635a1
RP
242DEPFILES= ${TDEPFILES} ${XDEPFILES}
243
56d921a8 244SOURCES=$(SFILES) $(ALLDEPFILES) $(YYFILES)
bd5635a1
RP
245TAGFILES = $(SOURCES) ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS}
246TAGFILES_MAINDIR = $(SFILES_MAINDIR) $(ALLDEPFILES_MAINDIR) \
247 ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS_MAINDIR}
248TARFILES = ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES}
249
250OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \
251 values.o eval.o valops.o valarith.o valprint.o printcmd.o \
252 symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \
56d921a8 253 command.o utils.o expprint.o environ.o version.o \
bd5635a1 254 copying.o $(DEPFILES) signame.o cplus-dem.o mem-break.o target.o \
56d921a8 255 inftarg.o ieee-float.o putenv.o parse.o language.o $(YYOBJ) \
2ce38c6d 256 buildsym.o \
19230be6 257 dbxread.o coffread.o elfread.o dwarfread.o xcoffread.o # mipsread.o
bd5635a1
RP
258
259RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES)
260
261TSOBS = core.o inflow.o
262
263NTSOBS = standalone.o
264
265TSSTART = /lib/crt0.o
266
267NTSSTART = kdb-start.o
268
50d2bb5b
RP
269SUBDIRS = doc
270
56d921a8
JG
271# For now, shortcut the "configure GDB for fewer languages" stuff.
272YYFILES = c-exp.tab.c m2-exp.tab.c
273YYOBJ = c-exp.tab.o m2-exp.tab.o
274
bd5635a1
RP
275# Prevent Sun make from putting in the machine type. Setting
276# TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
277.c.o:
278 ${CC} -c ${CFLAGS} $<
279
280all: gdb
50d2bb5b 281 $(MAKE) subdir_do DO=all "DODIRS=$(SUBDIRS)"
bd5635a1
RP
282
283install: gdb
284 cp gdb $(bindir)/gdb.new
285 mv $(bindir)/gdb.new $(bindir)/gdb
286 $(M_INSTALL)
50d2bb5b 287 $(MAKE) subdir_do DO=install "DODIRS=$(SUBDIRS)"
bd5635a1 288
625453dc 289init.c: $(srcdir)/munch $(OBS) $(TSOBS)
bd5635a1
RP
290 $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c
291
e73dbe5d 292gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o
bd5635a1 293 ${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \
f9584c6d 294 $(CLIBS) $(LOADLIBES)
bd5635a1 295
63989338 296saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c
5594d534 297 #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS
bd5635a1 298 #load ./init.c $(SFILES)
56d921a8 299 #unload ${srcdir}/c-exp.y ${srcdir}/m2-exp.y ${srcdir}/vx-share/*.h
5594d534 300 #unload ${srcdir}/nindy-share/[A-Z]*
b0077123 301 #load c-exp.tab.c m2-exp.tab.c
bd5635a1 302 #load copying.c version.c
bd5635a1 303 #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'`
5594d534
JG
304 #load ${LIBIBERTY_DIR}/*.c
305 #load ${BFD_DIR}/*.c
e73dbe5d 306 #load ${READLINE_DIR}/*.c
5594d534 307 #load -ltermcap
bd5635a1 308 ##void mcheck(a) void (*a)(); { }
5594d534 309 ##void mtrace() { }
bd5635a1
RP
310
311
312
313# This is useful when debugging GDB, because some Unix's don't let you run GDB
314# on itself without copying the executable. So "make gdb1" will make
315# gdb and put a copy in gdb1, and you can run it with "gdb gdb1".
316# Removing gdb1 before the copy is the right thing if gdb1 is open
317# in another process.
318gdb1: gdb
319 rm -f gdb1
320 cp gdb gdb1
321
322# This is a remote stub which runs under unix and starts up an
323# inferior process. This is at least useful for debugging GDB's
324# remote support.
325rapp: $(RAPP_OBS)
326 rm -f rapp_init.c
44f0c5db 327 ${srcdir}/munch ${MUNCH_DEFINE} ${RAPP_OBS} > rapp_init.c
bd5635a1
RP
328 ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS)
329
e73dbe5d 330# Support for building Makefile out of configured pieces, automatically
dc0c3f64
JG
331# generated dependencies, etc. alldeps.mak is a file that contains
332# "make" variable definitions for all ALLDEPFILES, ALLDEPFILES_MAINDIR,
333# ALLDEPFILES_SUBDIR, ALLPARAM, and ALLCONFIG, all cadged from the current
334# contents of the xconfig and tconfig subdirectories.
bd5635a1 335
e73dbe5d 336alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig
bd5635a1
RP
337 rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp
338 for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \
bce4bf52
RP
339 ${srcdir}/xconfig/*[0-9A-Za-z] | \
340 grep -v RCS | grep -v CVS.adm | grep -v SCCS` ; do \
bd5635a1
RP
341 echo $$i >>allconfig.tmp; \
342 awk <$$i ' \
343 $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \
344 for (i = 2; i <= NF; i++) \
345 print $$i >> "alldeps.tmp" ; \
346 } \
347 $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \
348 print $$2 >> "allparam.tmp" }' ; \
349 done
350 sort <alldeps.tmp | uniq | \
351 sed -e 's/arm-convert.o/arm-convert.s/' \
352 -e 's!^Onindy.o!nindy-share/Onindy.c!' \
353 -e 's!^nindy.o!nindy-share/nindy.c!' \
354 -e 's!ttybreak.o!nindy-share/ttybreak.c!' \
355 -e 's!ttyflush.o!nindy-share/ttyflush.c!' \
356 -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \
357 -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \
358 -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \
359 -e 's!xdr_regs.o!vx-share/xdr_regs.c!' \
360 -e 's/\.o/.c/' \
361 >alldeps2.tmp
dc0c3f64
JG
362 echo '# Start of "alldeps.mak" definitions' \
363 >>alldeps.mak;
bd5635a1
RP
364 echo 'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \
365 >>alldeps.mak;
366 grep -v / alldeps2.tmp | \
367 awk 'BEGIN {printf "ALLDEPFILES_MAINDIR="} \
368 NR == 0 {printf $$0;} \
369 NR != 0 {printf "\\\n" $$0} \
370 END {printf "\n\n"}' >>alldeps.mak;
371 grep / alldeps2.tmp | \
372 awk 'BEGIN {printf "ALLDEPFILES_SUBDIR="} \
373 NR == 0 {printf $$0;} \
374 NR != 0 {printf "\\\n" $$0} \
375 END {printf "\n\n"}' >>alldeps.mak;
376 sort <allparam.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \
377 NR == 0 {printf $$0;} \
378 NR != 0 {printf "\\\n" $$0} \
379 END {printf "\n\n"}' >>alldeps.mak;
380 sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \
381 NR == 0 {printf $$0;} \
382 NR != 0 {printf "\\\n" $$0} \
383 END {printf "\n\n"}' >>alldeps.mak;
dc0c3f64
JG
384 echo '# End of "alldeps.mak" definitions' \
385 >>alldeps.mak;
bd5635a1
RP
386 rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp
387
388# The sed script makes everything which depends on {x,t}m.h depend on
389# config.status as well, in case someone reconfigures gdb out from
390# under an already compiled gdb.
dc0c3f64 391depend: $(SOURCES) Makefile.in
bd5635a1
RP
392 @echo Ignore errors about non-existent system-supplied include files
393 @echo for systems other than the one you are using.
394 @echo "If xm.h and tm.h don't exist, the error messages saying so"
395 @echo can safely be ignored.
396 @echo Also ignore parse errors in valops.c, and any errors in
397 @echo arm-convert.s.
e73dbe5d 398 -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \
dc0c3f64 399 `ls $(SOURCES) | grep -v '\.[hy]$$' |sort -u` >depend.tmp
6988f5c0
JG
400# If running in srcdir, translate "./foo.c" into "$srcdir/foo.c" except
401# for xm.h and tm.h. This allows the same "depend" file to be used
402# by the various subdirectories.
403 if [ "${srcdir}" = "." ] ; then \
404 <depend.tmp sed \
405 -e 's; ./xm.h; xm.h;g' \
406 -e 's; ./tm.h; tm.h;g' \
407 -e 's; \./; $${srcdir}/;g' \
408 -e 's; vx-share/; $${srcdir}/vx-share/;g' \
409 -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \
410 >depend.tm2; \
411 rm depend.tmp; \
412 mv depend.tm2 depend.tmp; \
413 fi
414 <depend.tmp sed \
415 -e 's; [xt]m.h;& config.status;g' \
bd5635a1 416 -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \
e73dbe5d 417 -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \
bd5635a1 418 -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \
6988f5c0
JG
419 -e 's; ./xm.h; xm.h config.status;g' \
420 -e 's; ./tm.h; tm.h config.status;g' \
e73dbe5d 421 >depend
bd5635a1
RP
422 rm depend.tmp
423
424config.status:
425 @echo "You must configure gdb. Look at the README file for details."
426 @false
427
428# These are not generated by "make depend" because they only are there
429# for some machines.
a416228b
JK
430# But these rules don't do what we want; we want to hack the foo.o: tm.h
431# dependency to do the right thing.
bd5635a1
RP
432tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h : tm-68k.h
433tm-hp300hpux.h tm-sun2.h tm-3b1.h : tm-68k.h
434xm-news1000.h : xm-news.h
435xm-i386-sv32.h : xm-i386.h
436tm-i386gas.h: tm-i386.h
437xm-sun4os4.h : xm-sparc.h
438tm-sun4os4.h : tm-sparc.h
439
e73dbe5d 440kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS}
bd5635a1
RP
441 rm -f init.c
442 $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c
443 $(CC) $(LDFLAGS) -c init.c $(CLIBS)
444 ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \
e73dbe5d 445 -lc $(CLIBS)
bd5635a1
RP
446
447# Put the proper machine-specific files first.
448# createtags will edit the .o in DEPFILES into .c
449TAGS: ${TAGFILES}
450 $(srcdir)/createtags $(TM_FILE) ${XM_FILE} $(DEPFILES) ${TAGFILES}
451tags: TAGS
452
b7ced322
RP
453# Making distributions of GDB and friends.
454
455# Make a directory `proto-gdb.dir' that contains an image of the GDB
456# directory of the distribution, built up with symlinks.
457make-proto-gdb.dir: force_update
458 $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist
459 $(MAKE) $(MFLAGS) -f Makefile make-proto-gdb-1
460
461# Make a tar file containing the GDB directory of the distribution.
dc0c3f64 462gdb.tar.Z: force_update
b7ced322
RP
463 $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist
464 $(MAKE) $(MFLAGS) -f Makefile.in gdb-$(VERSION).tar.Z
465
466# Set up the GDB directory for distribution, by building all files that
467# are products of other files.
468setup-to-dist: force_update
7ff46684 469 ../configure none
72b1b275 470 rm -f alldeps.mak
18a00f08 471 $(MAKE) $(MFLAGS) alldeps.mak
7ff46684 472 ../configure none
72b1b275 473 rm -f depend
18a00f08 474 $(MAKE) $(MFLAGS) depend
7ff46684 475 ../configure none
b7ced322 476 (cd doc; $(MAKE) $(MFLAGS) rdl-apps.texi gdbVN.m4)
18a00f08 477 $(MAKE) $(MFLAGS) gdb.info
81b0b547 478 $(MAKE) $(MFLAGS) refcard.ps
b7ced322
RP
479
480# Build a tar file from a proto-gdb.dir.
481gdb-$(VERSION).tar.Z: force_update
482 rm -f gdb.tar gdb-$(VERSION).tar.Z
483 $(MAKE) $(MFLAGS) -f Makefile make-proto-gdb-1
484 ln -s proto-gdb.dir $(DIST)
485 tar chf - $(DIST) | compress >gdb-$(VERSION).tar.Z
486 rm -rf $(DIST) proto-gdb.dir
487
488# Build a proto-gdb.dir after GDB has been set up for distribution.
489# This stuff must be run in `Makefile', not `Makefile.in`; we use the makefile
490# built in the setup-to-dist process, since it defines things like ALLCONFIG
491# and ALLDEPFILES, that we need.
492make-proto-gdb-1: ${TARFILES} ${TARDIRS} gdb.info
493 rm -rf proto-gdb.dir
494 mkdir proto-gdb.dir
495 cd proto-gdb.dir ; for i in ${TARFILES} ; do ln -s ../$$i . ; done
496 cd proto-gdb.dir ; ln -s ../${INFOFILES} .
497 cd proto-gdb.dir ; for i in ${TARDIRS}; do \
bce4bf52
RP
498 (mkdir $$i; cd $$i; \
499 ln -s ../../$$i/* .; \
500 rm -rf SCCS CVS.adm RCS); done
b7ced322
RP
501 mkdir proto-gdb.dir/xconfig proto-gdb.dir/tconfig
502 cd proto-gdb.dir/tconfig ; \
bd5635a1 503 for i in $(ALLCONFIG) ; do ln -s ../../$$i ../$$i ; done
b7ced322
RP
504 mkdir proto-gdb.dir/vx-share proto-gdb.dir/nindy-share
505 cd proto-gdb.dir/tconfig ; \
dc0c3f64 506 for i in $(SFILES_SUBDIR) $(NONSRC_SUBDIR) $(ALLDEPFILES_SUBDIR); \
bd5635a1 507 do ln -s ../../$$i ../$$i ; done
7bfa94e2 508 chmod og=u `find . -print`
bd5635a1
RP
509
510clean:
511 rm -f ${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES}
512 rm -f init.c init.o version.c
513 rm -f gdb core gdb.tar gdb.tar.Z make.log
514 rm -f gdb[0-9]
50d2bb5b 515 $(MAKE) subdir_do DO=clean "DODIRS=$(SUBDIRS)"
bd5635a1 516
56d921a8 517distclean: clean c-exp.tab.c m2-exp.tab.c TAGS
bd5635a1
RP
518 rm -f tm.h xm.h config.status
519 rm -f y.output yacc.acts yacc.tmp
dc0c3f64 520 rm -f ${TESTS} Makefile depend
50d2bb5b 521 $(MAKE) subdir_do DO=distclean "DODIRS=$(SUBDIRS)"
bd5635a1
RP
522
523realclean: clean
56d921a8 524 rm -f c-exp.tab.c m2-exp.tab.c TAGS
bd5635a1 525 rm -f tm.h xm.h config.status
dc0c3f64 526 rm -f Makefile depend
50d2bb5b 527 $(MAKE) subdir_do DO=realclean "DODIRS=$(SUBDIRS)"
dc0c3f64 528
807e8e4e
JG
529STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb
530
50d2bb5b
RP
531subdir_do: force
532 for i in $(DODIRS); do \
533 if [ -d $(unsubdir)/$$i ] ; then \
534 if (cd $(unsubdir)/$$i$(subdir); \
535 $(MAKE) \
536 "against=$(against)" \
537 "AR=$(AR)" \
538 "CC=$(CC)" \
539 "AR_FLAGS=$(AR_FLAGS)" \
540 "RANLIB=$(RANLIB)" \
541 "BISON=$(BISON)" $(DO)) ; then true ; \
542 else exit 1 ; fi ; \
543 else true ; fi ; \
544 done
545
807e8e4e
JG
546# Copy the object files from a particular stage into a subdirectory.
547stage1: force
548 -mkdir stage1
549 -mv -f $(STAGESTUFF) stage1
50d2bb5b 550 $(MAKE) subdir_do DO=stage1 "DODIRS=$(SUBDIRS)"
807e8e4e
JG
551
552stage2: force
553 -mkdir stage2
554 -mv -f $(STAGESTUFF) stage2
50d2bb5b 555 $(MAKE) subdir_do DO=stage2 "DODIRS=$(SUBDIRS)"
807e8e4e
JG
556
557stage3: force
558 -mkdir stage3
559 -mv -f $(STAGESTUFF) stage3
50d2bb5b 560 $(MAKE) subdir_do DO=stage3 "DODIRS=$(SUBDIRS)"
807e8e4e
JG
561
562against=stage2
563
564comparison: force
565 for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done
50d2bb5b 566 $(MAKE) subdir_do DO=comparison "DODIRS=$(SUBDIRS)"
807e8e4e
JG
567
568de-stage1: force
569 - (cd stage1 ; mv -f * ..)
570 - rmdir stage1
50d2bb5b 571 $(MAKE) subdir_do DO=de-stage1 "DODIRS=$(SUBDIRS)"
807e8e4e
JG
572
573de-stage2: force
574 - (cd stage2 ; mv -f * ..)
575 - rmdir stage2
50d2bb5b 576 $(MAKE) subdir_do DO=de-stage2 "DODIRS=$(SUBDIRS)"
807e8e4e
JG
577
578de-stage3: force
579 - (cd stage3 ; mv -f * ..)
580 - rmdir stage3
50d2bb5b 581 $(MAKE) subdir_do DO=de-stage3 "DODIRS=$(SUBDIRS)"
807e8e4e 582
f1eb48b6 583Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag)
bcb14db5 584 $(SHELL) ./config.status
807e8e4e
JG
585
586force:
587
dc0c3f64 588# Documentation!
7bfa94e2 589# GDB QUICK REFERENCE (TeX dvi file, CM fonts)
807e8e4e 590refcard.dvi : $(srcdir)/doc/refcard.tex
f5e011c6 591 ( cd $(srcdir)/doc; $(MAKE) refcard.dvi )
807e8e4e 592 mv $(srcdir)/doc/refcard.dvi .
7bfa94e2
RP
593
594# GDB QUICK REFERENCE (PostScript output, common PS fonts)
807e8e4e 595refcard.ps : $(srcdir)/doc/refcard.tex
f5e011c6 596 ( cd $(srcdir)/doc; $(MAKE) refcard.ps )
807e8e4e 597 mv $(srcdir)/doc/refcard.ps .
72f6386b 598
7bfa94e2 599# GDB MANUAL: TeX dvi file
2ecf0201 600gdb.dvi : $(srcdir)/doc/gdb-all.texi $(srcdir)/doc/rdl-apps.texi
f5e011c6 601 ( cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb.dvi )
807e8e4e 602 mv $(srcdir)/doc/gdb.dvi .
72f6386b 603
7bfa94e2 604# GDB MANUAL: info file
2ecf0201 605gdb.info: $(srcdir)/doc/gdb-all.texi
f5e011c6 606 ( cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb.info )
807e8e4e 607 mv $(srcdir)/doc/gdb.info* .
bd5635a1 608
2ecf0201 609$(srcdir)/doc/gdb-all.texi:
f5e011c6 610 (cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb-all.texi)
b9def3d9
RP
611$(srcdir)/doc/rdl-apps.texi:
612 (cd $(srcdir)/doc; $(MAKE) rdl-apps.texi)
299eb5f1 613
bd5635a1 614# Make copying.c from COPYING
19230be6
JG
615copying.c: ${srcdir}/COPYING ${srcdir}/copying.awk
616 awk -f ${srcdir}/copying.awk < ${srcdir}/COPYING > copying.c
bd5635a1 617
bdf3621b 618version.c : Makefile.in
bd5635a1
RP
619 echo 'char *version = "$(VERSION)";' >version.c
620
b0077123
JG
621# c-exp.tab.c is generated in target dir from c-exp.y if it doesn't exist
622# in srcdir, then compiled in target dir to c-exp.tab.o.
623c-exp.tab.o: c-exp.tab.c
624c-exp.tab.c: $(srcdir)/c-exp.y
dc0c3f64 625 @echo 'Expect 4 shift/reduce conflicts.'
56d921a8 626 ${YACC} $(srcdir)/c-exp.y
0aaa124f 627 - mv y.tab.c c-exp.tab.c
56d921a8 628
b0077123
JG
629# m2-exp.tab.c is generated in target dir from m2-exp.y if it doesn't exist
630# in srcdir, then compiled in target dir to m2-exp.tab.o.
631m2-exp.tab.o: m2-exp.tab.c
632m2-exp.tab.c: $(srcdir)/m2-exp.y
56d921a8 633 ${YACC} $(srcdir)/m2-exp.y
0aaa124f 634 - mv y.tab.c m2-exp.tab.c
bd5635a1 635
2ce38c6d 636# The symbol-file readers have dependencies on BFD header files.
bd5635a1
RP
637dbxread.o: ${srcdir}/dbxread.c
638 ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dbxread.c
639
640coffread.o: ${srcdir}/coffread.c
641 ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/coffread.c
642
643mipsread.o: ${srcdir}/mipsread.c
644 ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/mipsread.c
645
bb4ff694
FF
646elfread.o: ${srcdir}/elfread.c
647 ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/elfread.c
648
2ce38c6d
JG
649xcoffread.o: ${srcdir}/xcoffread.c
650 ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffread.c
651
19230be6
JG
652xcoffexec.o: ${srcdir}/xcoffexec.c
653 ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/xcoffexec.c
654
bd5635a1
RP
655# Drag in the files that are in another directory.
656
bd5635a1
RP
657xdr_ld.o: ${srcdir}/vx-share/xdr_ld.c
658 ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ld.c
659
660xdr_ptrace.o: ${srcdir}/vx-share/xdr_ptrace.c
661 ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ptrace.c
662
663xdr_rdb.o: ${srcdir}/vx-share/xdr_rdb.c
664 ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_rdb.c
665
666xdr_regs.o: ${srcdir}/vx-share/xdr_regs.c
667 ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_regs.c
668
669nindy.o: ${srcdir}/nindy-share/nindy.c
670 ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/nindy.c
671
672Onindy.o: ${srcdir}/nindy-share/Onindy.c
673 ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/Onindy.c
674
675ttybreak.o: ${srcdir}/nindy-share/ttybreak.c
676 ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttybreak.c
677
678ttyflush.o: ${srcdir}/nindy-share/ttyflush.c
679 ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttyflush.c
680
19230be6
JG
681disasm.o: $(srcdir)/tdesc-lib/disasm.c
682 $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/disasm.c
683
684classify.o: $(srcdir)/tdesc-lib/classify.c
685 $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/classify.c
686
687fcns.o: $(srcdir)/tdesc-lib/fcns.c
688 $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/fcns.c
689
690table.o: $(TABHDRS) $(srcdir)/tdesc-lib/table.c
691 $(CC) -c $(CFLAGS) $(srcdir)/tdesc-lib/table.c
bd5635a1 692
bd5635a1 693lint: $(LINTFILES)
19230be6
JG
694 $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \
695 `echo ${DEPFILES} | sed 's/\.o /\.c /g'
bd5635a1
RP
696
697gdb.cxref: $(SFILES)
698 cxref -I. $(SFILES) >gdb.cxref
699
700force_update :
701
e1ce8aa5
JK
702# When used with GDB, the demangler should never look for leading
703# underscores because GDB strips them off during symbol read-in. Thus
704# -Dnounderscore.
705
bd5635a1 706cplus-dem.o : cplus-dem.c
e1ce8aa5
JK
707 ${CC} -c ${CFLAGS} -Dnounderscore \
708 `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'`
dc0c3f64 709
625453dc
SG
710# GNU Make has an annoying habit of putting *all* the Makefile variables
711# into the environment, unless you include this target as a circumvention.
712# Rumor is that this will be fixed (and this target can be removed)
713# in GNU Make 4.0.
714.NOEXPORT:
715
dc0c3f64
JG
716# This is the end of "Makefile.in". When built into "Makefile"
717# by the configure script, two things are added below this point:
718# alldeps.mak -- defintions of all files that are used in
719# host- or target-dependent configurations
720# depend -- what .o files depend on what .c and .h files,
721# for all configurations.
722
723
This page took 0.075546 seconds and 4 git commands to generate.