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