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