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