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