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