Commit | Line | Data |
---|---|---|
dd3b648e RP |
1 | ##Copyright (C) 1989-1991 Free Software Foundation, Inc. |
2 | ||
3 | # This file is part of GDB. | |
4 | ||
5 | # GDB 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 1, or (at your option) | |
8 | # any later version. | |
9 | ||
10 | # GDB 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 GDB; see the file COPYING. If not, write to | |
17 | # the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
18 | ||
e73dbe5d | 19 | # Destination directory of the software tree build |
912e0732 RP |
20 | destdir = /usr/local |
21 | ||
e73dbe5d | 22 | # Place to install binaries in the destination tree. |
912e0732 | 23 | bindir=$(destdir)/bin |
dd3b648e RP |
24 | |
25 | # System V: If you compile gdb with a compiler which uses the coff | |
26 | # encapsulation feature (this is a function of the compiler used, NOT | |
27 | # of the m-?.h file selected by config.gdb), you must make sure that | |
28 | # the GNU nm is the one that is used by munch. | |
29 | ||
30 | # If you are compiling with GCC, make sure that either 1) You use the | |
31 | # -traditional flag, or 2) You have the fixed include files where GCC | |
17563ca1 | 32 | # can reach them. Otherwise the ioctl calls in inflow.c |
dd3b648e RP |
33 | # will be incorrectly compiled. The "fixincludes" script in the gcc |
34 | # distribution will fix your include files up. | |
35 | #CC=cc | |
36 | #CC=gcc -traditional | |
37 | GCC=gcc | |
38 | ||
39 | VPATH=$(srcdir) | |
40 | ||
41 | # It is also possible that you will need to add -I/usr/include/sys to the | |
42 | # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which | |
43 | # is where it should be according to Posix). | |
44 | ||
45 | YACC=bison -y | |
46 | # YACC=yacc | |
47 | SHELL=/bin/sh | |
48 | MAKE=make | |
59500745 RP |
49 | |
50 | # Documentation (gdb.dvi) needs either GNU m4 or SysV m4; | |
51 | # Berkeley/Sun don't have quite enough. | |
52 | #M4=/usr/5bin/m4 | |
53 | M4=gm4 | |
54 | # where to find texinfo; if you have PostScript fonts you may want to try | |
55 | # the Cygnus mods (which also have different header/footer layout) | |
56 | #TEXIDIR=${srcdir}/../texinfo/cygnus | |
57 | TEXIDIR=${srcdir}/../texinfo/fsf | |
dd3b648e RP |
58 | |
59 | # Set this up with gcc if you have gnu ld and the loader will print out | |
60 | # line numbers for undefinded refs. | |
61 | #CC-LD=gcc -static | |
62 | CC-LD=${CC} | |
63 | ||
64 | # define this to be "gmalloc.o" if you want to use the gnu malloc routine | |
65 | # (useful for debugging memory allocation problems in gdb). To use your | |
66 | # system malloc, uncomment the following two lines. | |
67 | #GNU_MALLOC = | |
68 | #MALLOC_CFLAGS = -DNO_MALLOC_CHECK | |
3f2e006b | 69 | GNU_MALLOC = gmalloc.o mcheck.o mtrace.o |
dd3b648e RP |
70 | MALLOC_CFLAGS = |
71 | ||
72 | # Where is the "include" directory? Traditionally ../include or ./include | |
73 | INCLUDE_DIR = ${srcdir}/../include | |
74 | INCLUDE_DEP = $$(INCLUDE_DIR) | |
75 | ||
77ac9392 JG |
76 | # Where is the source dir for the BFD library? Traditionally ../bfd or ./bfd |
77 | # (When we want the binary library built from it, we use ${BFD_DIR}${subdir}.) | |
dd3b648e RP |
78 | BFD_DIR = ${srcdir}/../bfd |
79 | BFD_DEP = $$(BFD_DIR) | |
e73dbe5d | 80 | BFD_LIB = $(BFD_DIR)${subdir}/libbfd.a |
dd3b648e | 81 | |
e73dbe5d JG |
82 | # Where is the source dir for the READLINE library? Traditionally in .. or . |
83 | # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.) | |
84 | READLINE_DIR = ${srcdir}/../readline | |
85 | READLINE_DEP = $$(READLINE_DIR) | |
86 | RL_LIB = $(READLINE_DIR)${subdir}/libreadline.a | |
beff312e | 87 | |
dd3b648e RP |
88 | # All the includes used for CFLAGS and for lint. |
89 | # -I. for config files. | |
63989338 | 90 | # -I${srcdir} possibly for regex.h also. |
beff312e | 91 | INCLUDE_CFLAGS = -I. -I${srcdir} -I$(INCLUDE_DIR) -I$(READLINE_DIR) -I${srcdir}/vx-share |
dd3b648e RP |
92 | |
93 | # {X,T}M_CFLAGS, if defined, has system-dependent CFLAGS. | |
17563ca1 | 94 | # CFLAGS for GDB |
dd3b648e RP |
95 | GLOBAL_CFLAGS = -g ${TM_CFLAGS} ${XM_CFLAGS} |
96 | #PROFILE_CFLAGS = -pg | |
97 | ||
98 | CFLAGS = ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MALLOC_CFLAGS} ${INCLUDE_CFLAGS} | |
99 | # None of the things in CFLAGS will do any harm, and on some systems | |
100 | # (e.g. SunOS4) it is important to use the M_CFLAGS. | |
101 | LDFLAGS = $(CFLAGS) | |
102 | ||
63989338 | 103 | # Where is the "-liberty" library, containing getopt and obstack? |
5594d534 JG |
104 | LIBIBERTY_DIR = ${srcdir}/../libiberty |
105 | LIBIBERTY = ${LIBIBERTY_DIR}${subdir}/libiberty.a | |
dd3b648e RP |
106 | |
107 | # Flags that describe where you can find the termcap library. | |
108 | # You may need to make other arrangements for USG. | |
109 | TERMCAP = -ltermcap | |
110 | ||
e73dbe5d | 111 | # The xconfig file must define REGEX and REGEX1 on USG machines. |
dd3b648e | 112 | # If your sysyem is missing alloca(), or, more likely, it's there but |
e73dbe5d | 113 | # it doesn't work, define ALLOCA & ALLOCA1 too. |
17563ca1 | 114 | # If your system is missing putenv(), add putenv.c to XM_ADD_FILES. |
dd3b648e | 115 | |
e73dbe5d JG |
116 | # Libraries and corresponding dependencies for compiling gdb. |
117 | # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs. | |
118 | # TERMCAP comes last, since readline depends on it. | |
119 | CLIBS = $(XM_CLIBS) ${TM_CLIBS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB} ${TERMCAP} | |
120 | CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${BFD_LIB} ${LIBIBERTY} ${RL_LIB} | |
dd3b648e | 121 | |
17563ca1 JG |
122 | ADD_FILES = ${REGEX} ${ALLOCA} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES} |
123 | ADD_DEPS = ${REGEX1} ${ALLOCA1} ${GNU_MALLOC} ${XM_ADD_FILES} ${TM_ADD_FILES} | |
dd3b648e | 124 | |
4ffd3047 | 125 | VERSION = 3.96 |
dd3b648e RP |
126 | DIST=gdb-$(VERSION) |
127 | ||
128 | LINT=/usr/5bin/lint | |
129 | LINTFLAGS= | |
130 | ||
131 | # Source files in the main directory. | |
132 | # Files which are included via a tconfig/* or xconfig/* file | |
133 | # should *not* be specified here; they're in "ALLDEPFILES". | |
134 | SFILES_MAINDIR = \ | |
135 | blockframe.c breakpoint.c command.c core.c \ | |
136 | environ.c eval.c expprint.c findvar.c infcmd.c inflow.c infrun.c \ | |
137 | main.c printcmd.c \ | |
138 | remote.c source.c stack.c symmisc.c symtab.c symfile.c \ | |
139 | utils.c valarith.c valops.c valprint.c values.c expread.y \ | |
140 | signame.c cplus-dem.c mem-break.c target.c inftarg.c \ | |
141 | dbxread.c coffread.c \ | |
142 | ieee-float.c | |
143 | ||
144 | # Source files in subdirectories (which will be handled separately by | |
145 | # 'make gdb.tar.Z'). | |
146 | # Files which are included via a tconfig/* or xconfig/* file | |
147 | # should *not* be specified here; they're in "ALLDEPFILES". | |
148 | SFILES_SUBDIR = \ | |
149 | ${srcdir}/vx-share/dbgRpcLib.h \ | |
150 | ${srcdir}/vx-share/ptrace.h \ | |
151 | ${srcdir}/vx-share/reg.h \ | |
152 | ${srcdir}/vx-share/vxTypes.h \ | |
153 | ${srcdir}/vx-share/vxWorks.h \ | |
154 | ${srcdir}/vx-share/wait.h \ | |
155 | ${srcdir}/vx-share/xdr_ld.h \ | |
156 | ${srcdir}/vx-share/xdr_ptrace.h \ | |
157 | ${srcdir}/vx-share/xdr_rdb.h \ | |
158 | ${srcdir}/vx-share/xdr_regs.h \ | |
159 | ${srcdir}/nindy-share/Makefile \ | |
160 | ${srcdir}/nindy-share/VERSION \ | |
161 | ${srcdir}/nindy-share/b.out.h \ | |
162 | ${srcdir}/nindy-share/block_io.h \ | |
163 | ${srcdir}/nindy-share/coff.h \ | |
164 | ${srcdir}/nindy-share/demux.h \ | |
165 | ${srcdir}/nindy-share/env.h \ | |
166 | ${srcdir}/nindy-share/stop.h \ | |
167 | ${srcdir}/nindy-share/ttycntl.h | |
168 | ||
169 | # All source files that go into linking GDB, except config-specified files. | |
170 | SFILES = $(SFILES_MAINDIR) $(SFILES_SUBDIR) | |
171 | ||
172 | # All source files that lint should look at | |
173 | LINTFILES = $(SFILES) expread.tab.c init.c | |
174 | ||
59500745 RP |
175 | # Documentation source files |
176 | SFILES_DOCDIR = \ | |
177 | ${srcdir}/doc/gdb.texinfo \ | |
178 | ${srcdir}/doc/pretex.m4 \ | |
179 | ${srcdir}/doc/none.m4 \ | |
180 | ${srcdir}/doc/all.m4 \ | |
181 | ${srcdir}/doc/gdb.alter-m4 \ | |
182 | ${srcdir}/doc/gdb.bugs-m4 \ | |
183 | ${srcdir}/doc/gdb.canned-m4 \ | |
184 | ${srcdir}/doc/gdb.cmds-m4 \ | |
185 | ${srcdir}/doc/gdb.ctl-m4 \ | |
186 | ${srcdir}/doc/gdb.data-m4 \ | |
187 | ${srcdir}/doc/gdb.emacs-m4 \ | |
188 | ${srcdir}/doc/gdb.files-m4 \ | |
189 | ${srcdir}/doc/gdb.gpl-m4 \ | |
190 | ${srcdir}/doc/gdb.install-m4 \ | |
191 | ${srcdir}/doc/gdb.inv.m-m4 \ | |
192 | ${srcdir}/doc/gdb.inv.s-m4 \ | |
193 | ${srcdir}/doc/gdb.invoc-m4 \ | |
194 | ${srcdir}/doc/gdb.rdln-m4 \ | |
195 | ${srcdir}/doc/gdb.rename-m4 \ | |
196 | ${srcdir}/doc/gdb.run-m4 \ | |
197 | ${srcdir}/doc/gdb.sample-m4 \ | |
198 | ${srcdir}/doc/gdb.src-m4 \ | |
199 | ${srcdir}/doc/gdb.stack-m4 \ | |
200 | ${srcdir}/doc/gdb.stop-m4 \ | |
201 | ${srcdir}/doc/gdb.symb-m4 \ | |
202 | ${srcdir}/doc/gdb.tgts-m4 \ | |
203 | ${srcdir}/doc/gdb.top-m4 | |
204 | ||
dd3b648e RP |
205 | # Any additional files specified on these lines should also be added to |
206 | # the OTHERS = definition below, so they go in the tar files. | |
207 | SFILES_STAND = $(SFILES) standalone.c | |
208 | SFILES_KGDB = $(SFILES) stuff.c kdb-start.c | |
209 | ||
210 | # Header files that are not named in tconfig/* or xconfig/* go here. | |
211 | HFILES= breakpoint.h command.h defs.h environ.h \ | |
212 | expression.h frame.h gdbcmd.h gdbcore.h \ | |
213 | getpagesize.h ieee-float.h inferior.h param-no-tm.h param.h \ | |
214 | signals.h signame.h symfile.h symtab.h \ | |
215 | target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \ | |
216 | value.h | |
217 | ||
e73dbe5d JG |
218 | # Header files for machine opcode tables. |
219 | # when OPCODE_DIR changes to ../include, remove the whole $(OPCODES) | |
220 | # business, since they will be included in the separate includes tar file | |
221 | # rather than in the gdb tar file. | |
222 | OPCODE_DIR = | |
223 | OPCODES = $(OPCODE_DIR)pn-opcode.h $(OPCODE_DIR)np1-opcode.h \ | |
224 | $(OPCODE_DIR)sparc-opcode.h $(OPCODE_DIR)vax-opcode.h \ | |
225 | $(OPCODE_DIR)m68k-opcode.h $(OPCODE_DIR)ns32k-opcode.h \ | |
226 | $(OPCODE_DIR)convx-opcode.h $(OPCODE_DIR)pyr-opcode.h \ | |
17563ca1 JG |
227 | $(OPCODE_DIR)mips-opcode.h $(OPCODE_DIR)am29k-opcode.h \ |
228 | $(OPCODE_DIR)arm-opcode.h $(OPCODE_DIR)m88k-opcode.h \ | |
229 | $(OPCODE_DIR)tahoe-opcode.h | |
dd3b648e | 230 | |
17563ca1 | 231 | REMOTE_EXAMPLES = m68k-stub.c i386-stub.c rem-multi.shar |
dd3b648e | 232 | |
3f2e006b | 233 | MALLOCSRC = gmalloc.c mcheck.c mtrace.c mtrace.awk \ |
4ffd3047 | 234 | ansidecl.h gmalloc.h |
dd3b648e | 235 | |
63989338 JG |
236 | POSSLIBS_MAINDIR = regex.c regex.h alloca.c $(MALLOCSRC) |
237 | POSSLIBS = $(POSSLIBS_MAINDIR) | |
dd3b648e RP |
238 | |
239 | TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c | |
240 | ||
d6cbb709 | 241 | # tdesc-lib cannot be named simply tdesc, because if it were, GNU make |
dd3b648e RP |
242 | # would try to make it from tdesc.c. |
243 | # tdesc-lib removed from the list due to Motorola copyrights...gnu@cygnus.com | |
4ffd3047 | 244 | OTHERS = Makefile Makefile.dist depend alldeps.mak Makefile.sdir \ |
dd3b648e RP |
245 | createtags munch config.gdb config.status \ |
246 | ChangeLog ChangeLog-3.x \ | |
d6cbb709 | 247 | README TODO TAGS WHATS.NEW Projects \ |
17563ca1 | 248 | .gdbinit COPYING expread.tab.c \ |
d6cbb709 | 249 | copying.c Convex.notes copying.awk \ |
dd3b648e | 250 | saber.suppress standalone.c stuff.c kdb-start.c \ |
d6cbb709 JG |
251 | putenv.c |
252 | ||
253 | # Subdirectories of gdb, which should be included in their entirety in | |
254 | # gdb-xxx.tar.Z: | |
255 | TARDIRS = doc hp-include # tests | |
dd3b648e RP |
256 | |
257 | DEPFILES= ${TDEPFILES} ${XDEPFILES} | |
258 | ||
259 | SOURCES=$(SFILES) $(ALLDEPFILES) | |
260 | TAGFILES = $(SOURCES) ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS} | |
261 | TAGFILES_MAINDIR = $(SFILES_MAINDIR) $(ALLDEPFILES_MAINDIR) \ | |
262 | ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS_MAINDIR} | |
263 | TARFILES = ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES} | |
264 | ||
265 | OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \ | |
266 | values.o eval.o valops.o valarith.o valprint.o printcmd.o \ | |
267 | symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \ | |
268 | command.o utils.o expread.o expprint.o environ.o version.o \ | |
269 | copying.o $(DEPFILES) signame.o cplus-dem.o mem-break.o target.o \ | |
31ef19fc | 270 | inftarg.o ieee-float.o putenv.o \ |
dd3b648e RP |
271 | dbxread.o coffread.o # mipsread.o |
272 | ||
273 | RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES) | |
274 | ||
275 | TSOBS = core.o inflow.o | |
276 | ||
277 | NTSOBS = standalone.o | |
278 | ||
279 | TSSTART = /lib/crt0.o | |
280 | ||
281 | NTSSTART = kdb-start.o | |
282 | ||
dd3b648e RP |
283 | # Prevent Sun make from putting in the machine type. Setting |
284 | # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. | |
285 | .c.o: | |
286 | ${CC} -c ${CFLAGS} $< | |
287 | ||
288 | all: gdb | |
289 | ||
290 | install: gdb | |
291 | cp gdb $(bindir)/gdb.new | |
292 | mv $(bindir)/gdb.new $(bindir)/gdb | |
293 | $(M_INSTALL) | |
294 | ||
295 | init.c: $(srcdir)/munch $(MUNCH_DEFINE) $(OBS) $(TSOBS) | |
296 | $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c | |
297 | ||
e73dbe5d | 298 | gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o |
dd3b648e | 299 | ${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \ |
e73dbe5d | 300 | $(CLIBS) |
dd3b648e | 301 | |
63989338 | 302 | saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c |
5594d534 | 303 | #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS |
dd3b648e | 304 | #load ./init.c $(SFILES) |
5594d534 JG |
305 | #unload ${srcdir}/expread.y ${srcdir}/vx-share/*.h |
306 | #unload ${srcdir}/nindy-share/[A-Z]* | |
17563ca1 | 307 | #load ${srcdir}/expread.tab.c |
dd3b648e | 308 | #load copying.c version.c |
dd3b648e | 309 | #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'` |
5594d534 JG |
310 | #load ${LIBIBERTY_DIR}/*.c |
311 | #load ${BFD_DIR}/*.c | |
e73dbe5d | 312 | #load ${READLINE_DIR}/*.c |
5594d534 | 313 | #load -ltermcap |
dd3b648e | 314 | ##void mcheck(a) void (*a)(); { } |
5594d534 | 315 | ##void mtrace() { } |
dd3b648e RP |
316 | |
317 | ||
318 | ||
319 | # This is useful when debugging GDB, because some Unix's don't let you run GDB | |
320 | # on itself without copying the executable. So "make gdb1" will make | |
321 | # gdb and put a copy in gdb1, and you can run it with "gdb gdb1". | |
322 | # Removing gdb1 before the copy is the right thing if gdb1 is open | |
323 | # in another process. | |
324 | gdb1: gdb | |
325 | rm -f gdb1 | |
326 | cp gdb gdb1 | |
327 | ||
328 | # This is a remote stub which runs under unix and starts up an | |
329 | # inferior process. This is at least useful for debugging GDB's | |
330 | # remote support. | |
331 | rapp: $(RAPP_OBS) | |
332 | rm -f rapp_init.c | |
333 | ${srcdir}/munch ${RAPP_OBS} > rapp_init.c | |
334 | ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS) | |
335 | ||
e73dbe5d JG |
336 | # Support for building Makefile out of configured pieces, automatically |
337 | # generated dependencies, etc. | |
338 | Makefiles= Makefile.sdir $(M_MAKEFILE) \ | |
339 | ${srcdir}/alldeps.mak ${srcdir}/Makefile.dist | |
dd3b648e | 340 | |
e73dbe5d JG |
341 | MAKE_MAKEFILE= echo "M_MAKEFILE=$(M_MAKEFILE)" | \ |
342 | cat - ${Makefiles} ${srcdir}/depend > Makefile | |
dd3b648e | 343 | |
e73dbe5d JG |
344 | Makefile: $(Makefiles) |
345 | $(MAKE_MAKEFILE) | |
dd3b648e | 346 | |
e73dbe5d | 347 | alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig |
dd3b648e RP |
348 | rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp |
349 | for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \ | |
d6cbb709 JG |
350 | ${srcdir}/xconfig/*[0-9A-Za-z] | \ |
351 | grep -v RCS | grep -v CVS.adm | grep -v SCCS` ; do \ | |
dd3b648e RP |
352 | echo $$i >>allconfig.tmp; \ |
353 | awk <$$i ' \ | |
354 | $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \ | |
355 | for (i = 2; i <= NF; i++) \ | |
356 | print $$i >> "alldeps.tmp" ; \ | |
357 | } \ | |
358 | $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \ | |
359 | print $$2 >> "allparam.tmp" }' ; \ | |
360 | done | |
361 | sort <alldeps.tmp | uniq | \ | |
362 | sed -e 's/arm-convert.o/arm-convert.s/' \ | |
363 | -e 's!^Onindy.o!nindy-share/Onindy.c!' \ | |
364 | -e 's!^nindy.o!nindy-share/nindy.c!' \ | |
365 | -e 's!ttybreak.o!nindy-share/ttybreak.c!' \ | |
366 | -e 's!ttyflush.o!nindy-share/ttyflush.c!' \ | |
367 | -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \ | |
368 | -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \ | |
369 | -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \ | |
370 | -e 's!xdr_regs.o!vx-share/xdr_regs.c!' \ | |
371 | -e 's/\.o/.c/' \ | |
372 | >alldeps2.tmp | |
373 | echo 'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \ | |
374 | >>alldeps.mak; | |
375 | grep -v / alldeps2.tmp | \ | |
376 | awk 'BEGIN {printf "ALLDEPFILES_MAINDIR="} \ | |
377 | NR == 0 {printf $$0;} \ | |
378 | NR != 0 {printf "\\\n" $$0} \ | |
379 | END {printf "\n\n"}' >>alldeps.mak; | |
380 | grep / alldeps2.tmp | \ | |
381 | awk 'BEGIN {printf "ALLDEPFILES_SUBDIR="} \ | |
382 | NR == 0 {printf $$0;} \ | |
383 | NR != 0 {printf "\\\n" $$0} \ | |
384 | END {printf "\n\n"}' >>alldeps.mak; | |
385 | sort <allparam.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \ | |
386 | NR == 0 {printf $$0;} \ | |
387 | NR != 0 {printf "\\\n" $$0} \ | |
388 | END {printf "\n\n"}' >>alldeps.mak; | |
389 | sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \ | |
390 | NR == 0 {printf $$0;} \ | |
391 | NR != 0 {printf "\\\n" $$0} \ | |
392 | END {printf "\n\n"}' >>alldeps.mak; | |
393 | rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp | |
394 | ||
395 | # The sed script makes everything which depends on {x,t}m.h depend on | |
396 | # config.status as well, in case someone reconfigures gdb out from | |
397 | # under an already compiled gdb. | |
398 | depend: $(SOURCES) Makefile.dist | |
399 | @echo Ignore errors about non-existent system-supplied include files | |
400 | @echo for systems other than the one you are using. | |
401 | @echo "If xm.h and tm.h don't exist, the error messages saying so" | |
402 | @echo can safely be ignored. | |
403 | @echo Also ignore parse errors in valops.c, and any errors in | |
404 | @echo arm-convert.s. | |
e73dbe5d JG |
405 | -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \ |
406 | `ls $(SOURCES) | grep -v \.h$$ |sort -u` >depend.tmp | |
dd3b648e RP |
407 | <depend.tmp sed -e 's/ [xt]m.h/& config.status/g' \ |
408 | -e 's; vx-share/; $${srcdir}/vx-share/;g' \ | |
409 | -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \ | |
410 | -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \ | |
e73dbe5d | 411 | -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \ |
dd3b648e | 412 | -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \ |
dd3b648e | 413 | -e 's; \./; $${srcdir}/;g' \ |
e73dbe5d JG |
414 | >depend |
415 | $(MAKE_MAKEFILE) | |
dd3b648e RP |
416 | rm depend.tmp |
417 | ||
418 | config.status: | |
419 | @echo "You must configure gdb. Look at the README file for details." | |
420 | @false | |
421 | ||
422 | # These are not generated by "make depend" because they only are there | |
423 | # for some machines. | |
a416228b JK |
424 | # But these rules don't do what we want; we want to hack the foo.o: tm.h |
425 | # dependency to do the right thing. | |
dd3b648e RP |
426 | tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h : tm-68k.h |
427 | tm-hp300hpux.h tm-sun2.h tm-3b1.h : tm-68k.h | |
428 | xm-news1000.h : xm-news.h | |
429 | xm-i386-sv32.h : xm-i386.h | |
430 | tm-i386gas.h: tm-i386.h | |
431 | xm-sun4os4.h : xm-sparc.h | |
432 | tm-sun4os4.h : tm-sparc.h | |
433 | ||
e73dbe5d | 434 | kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS} |
dd3b648e RP |
435 | rm -f init.c |
436 | $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c | |
437 | $(CC) $(LDFLAGS) -c init.c $(CLIBS) | |
438 | ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \ | |
e73dbe5d | 439 | -lc $(CLIBS) |
dd3b648e RP |
440 | |
441 | # Put the proper machine-specific files first. | |
442 | # createtags will edit the .o in DEPFILES into .c | |
443 | TAGS: ${TAGFILES} | |
444 | $(srcdir)/createtags $(TM_FILE) ${XM_FILE} $(DEPFILES) ${TAGFILES} | |
445 | tags: TAGS | |
446 | ||
447 | # FIXME: Get alldeps.mak up to date, config.gdb none, THEN make gdb.tar.Z! | |
d6cbb709 | 448 | gdb.tar.Z: ${TARFILES} ${TARDIRS} |
dd3b648e | 449 | rm -f gdb.tar; rm -rf $(DIST) |
dd3b648e RP |
450 | mkdir $(DIST) |
451 | cd $(DIST) ; for i in ${TARFILES} ; do ln -s ../$$i . ; done | |
d6cbb709 JG |
452 | cd $(DIST); for i in ${TARDIRS}; do \ |
453 | (mkdir $$i; cd $$i; \ | |
454 | ln -s ../../$$i/* .; \ | |
455 | rm -rf SCCS CVS.adm RCS); done | |
dd3b648e RP |
456 | mkdir $(DIST)/xconfig ${DIST}/tconfig |
457 | cd $(DIST)/tconfig ; \ | |
458 | for i in $(ALLCONFIG) ; do ln -s ../../$$i ../$$i ; done | |
459 | mkdir $(DIST)/vx-share $(DIST)/nindy-share | |
460 | cd $(DIST)/tconfig ; \ | |
461 | for i in $(SFILES_SUBDIR) $(ALLDEPFILES_SUBDIR); \ | |
462 | do ln -s ../../$$i ../$$i ; done | |
463 | tar chf - $(DIST) | compress >gdb.tar.Z | |
464 | rm -rf $(DIST) | |
465 | ||
466 | clean: | |
467 | rm -f ${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} | |
468 | rm -f init.c init.o version.c | |
469 | rm -f gdb core gdb.tar gdb.tar.Z make.log | |
470 | rm -f gdb[0-9] | |
bce4bf52 | 471 | rm -f gdb.dvi rdl-apps.texinfo gdb-all* |
dd3b648e RP |
472 | |
473 | distclean: clean expread.tab.c TAGS | |
474 | rm -f tm.h xm.h config.status | |
475 | rm -f y.output yacc.acts yacc.tmp | |
476 | rm -f ${TESTS} Makefile | |
477 | ||
478 | realclean: clean | |
479 | rm -f expread.tab.c TAGS | |
480 | rm -f tm.h xm.h config.status | |
481 | rm -f Makefile | |
482 | ||
bce4bf52 RP |
483 | rdl-apps.texinfo: ${READLINE_DIR}/inc-readline.texinfo \ |
484 | ${READLINE_DIR}/inc-history.texinfo | |
485 | echo "@include ${READLINE_DIR}/inc-readline.texinfo" >rdl-apps.texinfo | |
486 | echo "@include ${READLINE_DIR}/inc-history.texinfo" >>rdl-apps.texinfo | |
487 | ||
59500745 RP |
488 | gdb-all.texinfo: ${SFILES_DOCDIR} |
489 | ( cd $(srcdir)/doc; \ | |
490 | ${M4} pretex.m4 none.m4 all.m4 gdb.texinfo ) >gdb-all.texinfo | |
72f6386b | 491 | |
bce4bf52 | 492 | gdb.dvi : gdb-all.texinfo rdl-apps.texinfo |
59500745 | 493 | TEXINPUTS=${TEXIDIR}:$$TEXINPUTS tex gdb-all.texinfo |
72f6386b | 494 | texindex gdb-all.?? |
59500745 | 495 | TEXINPUTS=${TEXIDIR}:$$TEXINPUTS tex gdb-all.texinfo |
72f6386b RP |
496 | mv gdb-all.dvi gdb.dvi |
497 | rm -f gdb-all.?? gdb-all.??? | |
498 | ||
499 | # This should work eventually, but we're using texinfo2, and many makeinfo's | |
500 | # can't cope with all the markup. In the meantime, we distribute the info | |
501 | # files as formatted by the elisp texinfo2 code. | |
502 | #gdb.info: gdb-all.texinfo | |
503 | # makeinfo gdb-all.texinfo | |
dd3b648e RP |
504 | |
505 | # Make copying.c from COPYING | |
506 | copying.c : COPYING copying.awk | |
507 | awk -f copying.awk < COPYING > copying.c | |
508 | ||
509 | version.c : Makefile.dist | |
510 | echo 'char *version = "$(VERSION)";' >version.c | |
511 | ||
512 | ${srcdir}/expread.tab.c : $(srcdir)/expread.y | |
513 | @echo 'Expect 4 shift/reduce conflict.' | |
514 | ${YACC} $(srcdir)/expread.y | |
515 | mv y.tab.c ${srcdir}/expread.tab.c | |
516 | ||
517 | expread.o : ${srcdir}/expread.tab.c defs.h param.h symtab.h \ | |
518 | frame.h expression.h | |
519 | $(CC) -c ${CFLAGS} `echo ${srcdir}/expread.tab.c | sed 's,^\./,,'` | |
520 | mv expread.tab.o expread.o | |
521 | ||
522 | # dbxread, coffread, mipsread have dependencies on BFD header files. | |
523 | dbxread.o: ${srcdir}/dbxread.c | |
524 | ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dbxread.c | |
525 | ||
526 | coffread.o: ${srcdir}/coffread.c | |
527 | ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/coffread.c | |
528 | ||
529 | mipsread.o: ${srcdir}/mipsread.c | |
530 | ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/mipsread.c | |
531 | ||
532 | # Drag in the files that are in another directory. | |
533 | ||
dd3b648e RP |
534 | xdr_ld.o: ${srcdir}/vx-share/xdr_ld.c |
535 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ld.c | |
536 | ||
537 | xdr_ptrace.o: ${srcdir}/vx-share/xdr_ptrace.c | |
538 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ptrace.c | |
539 | ||
540 | xdr_rdb.o: ${srcdir}/vx-share/xdr_rdb.c | |
541 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_rdb.c | |
542 | ||
543 | xdr_regs.o: ${srcdir}/vx-share/xdr_regs.c | |
544 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_regs.c | |
545 | ||
546 | nindy.o: ${srcdir}/nindy-share/nindy.c | |
547 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/nindy.c | |
548 | ||
549 | Onindy.o: ${srcdir}/nindy-share/Onindy.c | |
550 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/Onindy.c | |
551 | ||
552 | ttybreak.o: ${srcdir}/nindy-share/ttybreak.c | |
553 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttybreak.c | |
554 | ||
555 | ttyflush.o: ${srcdir}/nindy-share/ttyflush.c | |
556 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttyflush.c | |
557 | ||
558 | tdesc-lib/libdc.o : force_update | |
559 | cd tdesc-lib ; ${MAKE} "SYSV_DEFINE=${SYSV_DEFINE}" | |
560 | ||
dd3b648e RP |
561 | lint: $(LINTFILES) |
562 | $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) | |
563 | ||
564 | gdb.cxref: $(SFILES) | |
565 | cxref -I. $(SFILES) >gdb.cxref | |
566 | ||
567 | force_update : | |
568 | ||
e1ce8aa5 JK |
569 | # When used with GDB, the demangler should never look for leading |
570 | # underscores because GDB strips them off during symbol read-in. Thus | |
571 | # -Dnounderscore. | |
572 | ||
dd3b648e | 573 | cplus-dem.o : cplus-dem.c |
e1ce8aa5 JK |
574 | ${CC} -c ${CFLAGS} -Dnounderscore \ |
575 | `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'` |