]>
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 | ||
f9584c6d RP |
51 | BISON=bison -y |
52 | BISONFLAGS= | |
dc0c3f64 | 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. | |
44f0c5db JG |
128 | # TERMCAP comes after readline, since readline depends on it. |
129 | CLIBS = ${BFD_LIB} ${LIBIBERTY} ${RL_LIB} ${TERMCAP} ${XM_CLIBS} ${TM_CLIBS} | |
e73dbe5d | 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 | |
90d368c5 | 135 | VERSION = 4.0.3 |
dc0c3f64 | 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 | ||
188 | # Any additional files specified on these lines should also be added to | |
189 | # the OTHERS = definition below, so they go in the tar files. | |
190 | SFILES_STAND = $(SFILES) standalone.c | |
191 | SFILES_KGDB = $(SFILES) stuff.c kdb-start.c | |
192 | ||
193 | # Header files that are not named in tconfig/* or xconfig/* go here. | |
194 | HFILES= breakpoint.h command.h defs.h environ.h \ | |
195 | expression.h frame.h gdbcmd.h gdbcore.h \ | |
196 | getpagesize.h ieee-float.h inferior.h param-no-tm.h param.h \ | |
197 | signals.h signame.h symfile.h symtab.h \ | |
198 | target.h tdesc.h terminal.h tm-68k.h tm-i960.h tm-sunos.h \ | |
199 | value.h | |
200 | ||
e73dbe5d JG |
201 | # Header files for machine opcode tables. |
202 | # when OPCODE_DIR changes to ../include, remove the whole $(OPCODES) | |
203 | # business, since they will be included in the separate includes tar file | |
204 | # rather than in the gdb tar file. | |
205 | OPCODE_DIR = | |
206 | OPCODES = $(OPCODE_DIR)pn-opcode.h $(OPCODE_DIR)np1-opcode.h \ | |
207 | $(OPCODE_DIR)sparc-opcode.h $(OPCODE_DIR)vax-opcode.h \ | |
208 | $(OPCODE_DIR)m68k-opcode.h $(OPCODE_DIR)ns32k-opcode.h \ | |
209 | $(OPCODE_DIR)convx-opcode.h $(OPCODE_DIR)pyr-opcode.h \ | |
17563ca1 JG |
210 | $(OPCODE_DIR)mips-opcode.h $(OPCODE_DIR)am29k-opcode.h \ |
211 | $(OPCODE_DIR)arm-opcode.h $(OPCODE_DIR)m88k-opcode.h \ | |
212 | $(OPCODE_DIR)tahoe-opcode.h | |
bd5635a1 | 213 | |
17563ca1 | 214 | REMOTE_EXAMPLES = m68k-stub.c i386-stub.c rem-multi.shar |
bd5635a1 | 215 | |
31ef19fc | 216 | MALLOCSRC = gmalloc.c mcheck.c mtrace.c mtrace.awk \ |
4ffd3047 | 217 | ansidecl.h gmalloc.h |
bd5635a1 | 218 | |
63989338 JG |
219 | POSSLIBS_MAINDIR = regex.c regex.h alloca.c $(MALLOCSRC) |
220 | POSSLIBS = $(POSSLIBS_MAINDIR) | |
bd5635a1 RP |
221 | |
222 | TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c | |
223 | ||
bce4bf52 | 224 | # tdesc-lib cannot be named simply tdesc, because if it were, GNU make |
bd5635a1 RP |
225 | # would try to make it from tdesc.c. |
226 | # tdesc-lib removed from the list due to Motorola [email protected] | |
dc0c3f64 | 227 | OTHERS = Makefile.in depend alldeps.mak \ |
299eb5f1 | 228 | createtags munch configure configure.in config.sub \ |
625453dc | 229 | ChangeLog ChangeLog-3.x refcard.ps \ |
bce4bf52 | 230 | README TODO TAGS WHATS.NEW Projects \ |
17563ca1 | 231 | .gdbinit COPYING expread.tab.c \ |
bce4bf52 | 232 | copying.c Convex.notes copying.awk \ |
bd5635a1 | 233 | saber.suppress standalone.c stuff.c kdb-start.c \ |
bce4bf52 RP |
234 | putenv.c |
235 | ||
236 | # Subdirectories of gdb, which should be included in their entirety in | |
237 | # gdb-xxx.tar.Z: | |
238 | TARDIRS = doc hp-include # tests | |
bd5635a1 | 239 | |
7bfa94e2 RP |
240 | # GDB "info" files, which should be included in their entirety |
241 | INFOFILES = gdb.info* | |
242 | ||
bd5635a1 RP |
243 | DEPFILES= ${TDEPFILES} ${XDEPFILES} |
244 | ||
245 | SOURCES=$(SFILES) $(ALLDEPFILES) | |
246 | TAGFILES = $(SOURCES) ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS} | |
247 | TAGFILES_MAINDIR = $(SFILES_MAINDIR) $(ALLDEPFILES_MAINDIR) \ | |
248 | ${HFILES} ${OPCODES} ${ALLPARAM} ${POSSLIBS_MAINDIR} | |
249 | TARFILES = ${TAGFILES_MAINDIR} ${OTHERS} ${REMOTE_EXAMPLES} | |
250 | ||
251 | OBS = main.o blockframe.o breakpoint.o findvar.o stack.o source.o \ | |
252 | values.o eval.o valops.o valarith.o valprint.o printcmd.o \ | |
253 | symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \ | |
254 | command.o utils.o expread.o expprint.o environ.o version.o \ | |
255 | copying.o $(DEPFILES) signame.o cplus-dem.o mem-break.o target.o \ | |
31ef19fc | 256 | inftarg.o ieee-float.o putenv.o \ |
bd5635a1 RP |
257 | dbxread.o coffread.o # mipsread.o |
258 | ||
259 | RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES) | |
260 | ||
261 | TSOBS = core.o inflow.o | |
262 | ||
263 | NTSOBS = standalone.o | |
264 | ||
265 | TSSTART = /lib/crt0.o | |
266 | ||
267 | NTSSTART = kdb-start.o | |
268 | ||
bd5635a1 RP |
269 | # Prevent Sun make from putting in the machine type. Setting |
270 | # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. | |
271 | .c.o: | |
272 | ${CC} -c ${CFLAGS} $< | |
273 | ||
274 | all: gdb | |
275 | ||
276 | install: gdb | |
277 | cp gdb $(bindir)/gdb.new | |
278 | mv $(bindir)/gdb.new $(bindir)/gdb | |
279 | $(M_INSTALL) | |
280 | ||
625453dc | 281 | init.c: $(srcdir)/munch $(OBS) $(TSOBS) |
bd5635a1 RP |
282 | $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c |
283 | ||
e73dbe5d | 284 | gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o |
bd5635a1 | 285 | ${CC-LD} $(LDFLAGS) -o gdb init.o $(OBS) $(TSOBS) $(ADD_FILES) \ |
f9584c6d | 286 | $(CLIBS) $(LOADLIBES) |
bd5635a1 | 287 | |
63989338 | 288 | saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c |
5594d534 | 289 | #setopt load_flags $(CFLAGS) -I$(BFD_DIR) -DHOST_SYS=SUN4_SYS |
bd5635a1 | 290 | #load ./init.c $(SFILES) |
5594d534 JG |
291 | #unload ${srcdir}/expread.y ${srcdir}/vx-share/*.h |
292 | #unload ${srcdir}/nindy-share/[A-Z]* | |
17563ca1 | 293 | #load ${srcdir}/expread.tab.c |
bd5635a1 | 294 | #load copying.c version.c |
bd5635a1 | 295 | #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'` |
5594d534 JG |
296 | #load ${LIBIBERTY_DIR}/*.c |
297 | #load ${BFD_DIR}/*.c | |
e73dbe5d | 298 | #load ${READLINE_DIR}/*.c |
5594d534 | 299 | #load -ltermcap |
bd5635a1 | 300 | ##void mcheck(a) void (*a)(); { } |
5594d534 | 301 | ##void mtrace() { } |
bd5635a1 RP |
302 | |
303 | ||
304 | ||
305 | # This is useful when debugging GDB, because some Unix's don't let you run GDB | |
306 | # on itself without copying the executable. So "make gdb1" will make | |
307 | # gdb and put a copy in gdb1, and you can run it with "gdb gdb1". | |
308 | # Removing gdb1 before the copy is the right thing if gdb1 is open | |
309 | # in another process. | |
310 | gdb1: gdb | |
311 | rm -f gdb1 | |
312 | cp gdb gdb1 | |
313 | ||
314 | # This is a remote stub which runs under unix and starts up an | |
315 | # inferior process. This is at least useful for debugging GDB's | |
316 | # remote support. | |
317 | rapp: $(RAPP_OBS) | |
318 | rm -f rapp_init.c | |
44f0c5db | 319 | ${srcdir}/munch ${MUNCH_DEFINE} ${RAPP_OBS} > rapp_init.c |
bd5635a1 RP |
320 | ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS) |
321 | ||
e73dbe5d | 322 | # Support for building Makefile out of configured pieces, automatically |
dc0c3f64 JG |
323 | # generated dependencies, etc. alldeps.mak is a file that contains |
324 | # "make" variable definitions for all ALLDEPFILES, ALLDEPFILES_MAINDIR, | |
325 | # ALLDEPFILES_SUBDIR, ALLPARAM, and ALLCONFIG, all cadged from the current | |
326 | # contents of the xconfig and tconfig subdirectories. | |
bd5635a1 | 327 | |
e73dbe5d | 328 | alldeps.mak: ${srcdir}/tconfig ${srcdir}/xconfig |
bd5635a1 RP |
329 | rm -f alldeps.mak alldeps.tmp allparam.tmp allconfig.tmp |
330 | for i in `ls -d ${srcdir}/tconfig/*[0-9A-Za-z] \ | |
bce4bf52 RP |
331 | ${srcdir}/xconfig/*[0-9A-Za-z] | \ |
332 | grep -v RCS | grep -v CVS.adm | grep -v SCCS` ; do \ | |
bd5635a1 RP |
333 | echo $$i >>allconfig.tmp; \ |
334 | awk <$$i ' \ | |
335 | $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" { \ | |
336 | for (i = 2; i <= NF; i++) \ | |
337 | print $$i >> "alldeps.tmp" ; \ | |
338 | } \ | |
339 | $$1 == "TM_FILE=" || $$1 == "XM_FILE=" { \ | |
340 | print $$2 >> "allparam.tmp" }' ; \ | |
341 | done | |
342 | sort <alldeps.tmp | uniq | \ | |
343 | sed -e 's/arm-convert.o/arm-convert.s/' \ | |
344 | -e 's!^Onindy.o!nindy-share/Onindy.c!' \ | |
345 | -e 's!^nindy.o!nindy-share/nindy.c!' \ | |
346 | -e 's!ttybreak.o!nindy-share/ttybreak.c!' \ | |
347 | -e 's!ttyflush.o!nindy-share/ttyflush.c!' \ | |
348 | -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \ | |
349 | -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \ | |
350 | -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \ | |
351 | -e 's!xdr_regs.o!vx-share/xdr_regs.c!' \ | |
352 | -e 's/\.o/.c/' \ | |
353 | >alldeps2.tmp | |
dc0c3f64 JG |
354 | echo '# Start of "alldeps.mak" definitions' \ |
355 | >>alldeps.mak; | |
bd5635a1 RP |
356 | echo 'ALLDEPFILES = $$(ALLDEPFILES_MAINDIR) $$(ALLDEPFILES_SUBDIR)' \ |
357 | >>alldeps.mak; | |
358 | grep -v / alldeps2.tmp | \ | |
359 | awk 'BEGIN {printf "ALLDEPFILES_MAINDIR="} \ | |
360 | NR == 0 {printf $$0;} \ | |
361 | NR != 0 {printf "\\\n" $$0} \ | |
362 | END {printf "\n\n"}' >>alldeps.mak; | |
363 | grep / alldeps2.tmp | \ | |
364 | awk 'BEGIN {printf "ALLDEPFILES_SUBDIR="} \ | |
365 | NR == 0 {printf $$0;} \ | |
366 | NR != 0 {printf "\\\n" $$0} \ | |
367 | END {printf "\n\n"}' >>alldeps.mak; | |
368 | sort <allparam.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \ | |
369 | NR == 0 {printf $$0;} \ | |
370 | NR != 0 {printf "\\\n" $$0} \ | |
371 | END {printf "\n\n"}' >>alldeps.mak; | |
372 | sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \ | |
373 | NR == 0 {printf $$0;} \ | |
374 | NR != 0 {printf "\\\n" $$0} \ | |
375 | END {printf "\n\n"}' >>alldeps.mak; | |
dc0c3f64 JG |
376 | echo '# End of "alldeps.mak" definitions' \ |
377 | >>alldeps.mak; | |
bd5635a1 RP |
378 | rm -f alldeps.tmp alldeps2.tmp allparam.tmp allconfig.tmp |
379 | ||
380 | # The sed script makes everything which depends on {x,t}m.h depend on | |
381 | # config.status as well, in case someone reconfigures gdb out from | |
382 | # under an already compiled gdb. | |
dc0c3f64 | 383 | depend: $(SOURCES) Makefile.in |
bd5635a1 RP |
384 | @echo Ignore errors about non-existent system-supplied include files |
385 | @echo for systems other than the one you are using. | |
386 | @echo "If xm.h and tm.h don't exist, the error messages saying so" | |
387 | @echo can safely be ignored. | |
388 | @echo Also ignore parse errors in valops.c, and any errors in | |
389 | @echo arm-convert.s. | |
e73dbe5d | 390 | -$(GCC) -MM $(CFLAGS) -I$(BFD_DIR) \ |
dc0c3f64 | 391 | `ls $(SOURCES) | grep -v '\.[hy]$$' |sort -u` >depend.tmp |
6988f5c0 JG |
392 | # If running in srcdir, translate "./foo.c" into "$srcdir/foo.c" except |
393 | # for xm.h and tm.h. This allows the same "depend" file to be used | |
394 | # by the various subdirectories. | |
395 | if [ "${srcdir}" = "." ] ; then \ | |
396 | <depend.tmp sed \ | |
397 | -e 's; ./xm.h; xm.h;g' \ | |
398 | -e 's; ./tm.h; tm.h;g' \ | |
399 | -e 's; \./; $${srcdir}/;g' \ | |
400 | -e 's; vx-share/; $${srcdir}/vx-share/;g' \ | |
401 | -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \ | |
402 | >depend.tm2; \ | |
403 | rm depend.tmp; \ | |
404 | mv depend.tm2 depend.tmp; \ | |
405 | fi | |
406 | <depend.tmp sed \ | |
407 | -e 's; [xt]m.h;& config.status;g' \ | |
bd5635a1 | 408 | -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \ |
e73dbe5d | 409 | -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \ |
bd5635a1 | 410 | -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \ |
6988f5c0 JG |
411 | -e 's; ./xm.h; xm.h config.status;g' \ |
412 | -e 's; ./tm.h; tm.h config.status;g' \ | |
e73dbe5d | 413 | >depend |
bd5635a1 RP |
414 | rm depend.tmp |
415 | ||
416 | config.status: | |
417 | @echo "You must configure gdb. Look at the README file for details." | |
418 | @false | |
419 | ||
420 | # These are not generated by "make depend" because they only are there | |
421 | # for some machines. | |
a416228b JK |
422 | # But these rules don't do what we want; we want to hack the foo.o: tm.h |
423 | # dependency to do the right thing. | |
bd5635a1 RP |
424 | tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h : tm-68k.h |
425 | tm-hp300hpux.h tm-sun2.h tm-3b1.h : tm-68k.h | |
426 | xm-news1000.h : xm-news.h | |
427 | xm-i386-sv32.h : xm-i386.h | |
428 | tm-i386gas.h: tm-i386.h | |
429 | xm-sun4os4.h : xm-sparc.h | |
430 | tm-sun4os4.h : tm-sparc.h | |
431 | ||
e73dbe5d | 432 | kdb : $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS} |
bd5635a1 RP |
433 | rm -f init.c |
434 | $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c | |
435 | $(CC) $(LDFLAGS) -c init.c $(CLIBS) | |
436 | ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \ | |
e73dbe5d | 437 | -lc $(CLIBS) |
bd5635a1 RP |
438 | |
439 | # Put the proper machine-specific files first. | |
440 | # createtags will edit the .o in DEPFILES into .c | |
441 | TAGS: ${TAGFILES} | |
442 | $(srcdir)/createtags $(TM_FILE) ${XM_FILE} $(DEPFILES) ${TAGFILES} | |
443 | tags: TAGS | |
444 | ||
dc0c3f64 JG |
445 | gdb.tar.Z: force_update |
446 | ./configure none | |
72b1b275 | 447 | rm -f alldeps.mak |
18a00f08 | 448 | $(MAKE) $(MFLAGS) alldeps.mak |
dc0c3f64 | 449 | ./configure none |
72b1b275 | 450 | rm -f depend |
18a00f08 | 451 | $(MAKE) $(MFLAGS) depend |
dc0c3f64 | 452 | ./configure none |
b9def3d9 | 453 | (cd doc; $(MAKE) $(MFLAGS) rdl-apps.texi) |
18a00f08 | 454 | $(MAKE) $(MFLAGS) gdb.info |
81b0b547 | 455 | $(MAKE) $(MFLAGS) refcard.ps |
18a00f08 | 456 | $(MAKE) $(MFLAGS) gdb-$(VERSION).tar.Z |
dc0c3f64 | 457 | |
7bfa94e2 | 458 | gdb-$(VERSION).tar.Z: ${TARFILES} ${TARDIRS} gdb.info |
dc0c3f64 | 459 | rm -f gdb.tar gdb-$(VERSION).tar.Z; rm -rf $(DIST) |
bd5635a1 RP |
460 | mkdir $(DIST) |
461 | cd $(DIST) ; for i in ${TARFILES} ; do ln -s ../$$i . ; done | |
7bfa94e2 | 462 | cd $(DIST) ; ln -s ../${INFOFILES} . |
bce4bf52 RP |
463 | cd $(DIST); for i in ${TARDIRS}; do \ |
464 | (mkdir $$i; cd $$i; \ | |
465 | ln -s ../../$$i/* .; \ | |
466 | rm -rf SCCS CVS.adm RCS); done | |
bd5635a1 RP |
467 | mkdir $(DIST)/xconfig ${DIST}/tconfig |
468 | cd $(DIST)/tconfig ; \ | |
469 | for i in $(ALLCONFIG) ; do ln -s ../../$$i ../$$i ; done | |
470 | mkdir $(DIST)/vx-share $(DIST)/nindy-share | |
471 | cd $(DIST)/tconfig ; \ | |
dc0c3f64 | 472 | for i in $(SFILES_SUBDIR) $(NONSRC_SUBDIR) $(ALLDEPFILES_SUBDIR); \ |
bd5635a1 | 473 | do ln -s ../../$$i ../$$i ; done |
7bfa94e2 | 474 | chmod og=u `find . -print` |
dc0c3f64 | 475 | tar chf - $(DIST) | compress >gdb-$(VERSION).tar.Z |
bd5635a1 RP |
476 | rm -rf $(DIST) |
477 | ||
478 | clean: | |
479 | rm -f ${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} | |
480 | rm -f init.c init.o version.c | |
481 | rm -f gdb core gdb.tar gdb.tar.Z make.log | |
482 | rm -f gdb[0-9] | |
f5e011c6 | 483 | cd $(srcdir)/doc; $(MAKE) clean |
bd5635a1 RP |
484 | |
485 | distclean: clean expread.tab.c TAGS | |
486 | rm -f tm.h xm.h config.status | |
487 | rm -f y.output yacc.acts yacc.tmp | |
dc0c3f64 | 488 | rm -f ${TESTS} Makefile depend |
bd5635a1 RP |
489 | |
490 | realclean: clean | |
491 | rm -f expread.tab.c TAGS | |
492 | rm -f tm.h xm.h config.status | |
dc0c3f64 JG |
493 | rm -f Makefile depend |
494 | ||
807e8e4e JG |
495 | STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb |
496 | ||
497 | # Copy the object files from a particular stage into a subdirectory. | |
498 | stage1: force | |
499 | -mkdir stage1 | |
500 | -mv -f $(STAGESTUFF) stage1 | |
501 | ||
502 | stage2: force | |
503 | -mkdir stage2 | |
504 | -mv -f $(STAGESTUFF) stage2 | |
505 | ||
506 | stage3: force | |
507 | -mkdir stage3 | |
508 | -mv -f $(STAGESTUFF) stage3 | |
509 | ||
510 | against=stage2 | |
511 | ||
512 | comparison: force | |
513 | for i in $(STAGESTUFF) ; do cmp $$i $(against)/$$i ; done | |
514 | ||
515 | de-stage1: force | |
516 | - (cd stage1 ; mv -f * ..) | |
517 | - rmdir stage1 | |
518 | ||
519 | de-stage2: force | |
520 | - (cd stage2 ; mv -f * ..) | |
521 | - rmdir stage2 | |
522 | ||
523 | de-stage3: force | |
524 | - (cd stage3 ; mv -f * ..) | |
525 | - rmdir stage3 | |
526 | ||
527 | Makefile: $(srcdir)/Makefile.in $(srcdir)/configure | |
528 | (cd $(srcdir) ; \ | |
529 | ./configure +destdir=$(destdir) \ | |
530 | +norecurse \ | |
f9584c6d | 531 | `if [ "$(srcdir)" != "." ] ; then echo +subdirs; fi` \ |
807e8e4e JG |
532 | $(host) +target=$(target)) |
533 | ||
534 | force: | |
535 | ||
dc0c3f64 | 536 | # Documentation! |
7bfa94e2 | 537 | # GDB QUICK REFERENCE (TeX dvi file, CM fonts) |
807e8e4e | 538 | refcard.dvi : $(srcdir)/doc/refcard.tex |
f5e011c6 | 539 | ( cd $(srcdir)/doc; $(MAKE) refcard.dvi ) |
807e8e4e | 540 | mv $(srcdir)/doc/refcard.dvi . |
7bfa94e2 RP |
541 | |
542 | # GDB QUICK REFERENCE (PostScript output, common PS fonts) | |
807e8e4e | 543 | refcard.ps : $(srcdir)/doc/refcard.tex |
f5e011c6 | 544 | ( cd $(srcdir)/doc; $(MAKE) refcard.ps ) |
807e8e4e | 545 | mv $(srcdir)/doc/refcard.ps . |
72f6386b | 546 | |
7bfa94e2 | 547 | # GDB MANUAL: TeX dvi file |
2ecf0201 | 548 | gdb.dvi : $(srcdir)/doc/gdb-all.texi $(srcdir)/doc/rdl-apps.texi |
f5e011c6 | 549 | ( cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb.dvi ) |
807e8e4e | 550 | mv $(srcdir)/doc/gdb.dvi . |
72f6386b | 551 | |
7bfa94e2 | 552 | # GDB MANUAL: info file |
2ecf0201 | 553 | gdb.info: $(srcdir)/doc/gdb-all.texi |
f5e011c6 | 554 | ( cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb.info ) |
807e8e4e | 555 | mv $(srcdir)/doc/gdb.info* . |
bd5635a1 | 556 | |
2ecf0201 | 557 | $(srcdir)/doc/gdb-all.texi: |
f5e011c6 | 558 | (cd $(srcdir)/doc; $(MAKE) M4=$(M4) gdb-all.texi) |
b9def3d9 RP |
559 | $(srcdir)/doc/rdl-apps.texi: |
560 | (cd $(srcdir)/doc; $(MAKE) rdl-apps.texi) | |
299eb5f1 | 561 | |
bd5635a1 RP |
562 | # Make copying.c from COPYING |
563 | copying.c : COPYING copying.awk | |
564 | awk -f copying.awk < COPYING > copying.c | |
565 | ||
bdf3621b | 566 | version.c : Makefile.in |
bd5635a1 RP |
567 | echo 'char *version = "$(VERSION)";' >version.c |
568 | ||
dc0c3f64 JG |
569 | # expread.tab.c is generated in srcdir from expread.y, then compiled in target |
570 | # directory to expread.o. | |
bd5635a1 | 571 | ${srcdir}/expread.tab.c : $(srcdir)/expread.y |
dc0c3f64 | 572 | @echo 'Expect 4 shift/reduce conflicts.' |
bd5635a1 RP |
573 | ${YACC} $(srcdir)/expread.y |
574 | mv y.tab.c ${srcdir}/expread.tab.c | |
575 | ||
576 | expread.o : ${srcdir}/expread.tab.c defs.h param.h symtab.h \ | |
dc0c3f64 | 577 | frame.h expression.h value.h command.h |
bd5635a1 RP |
578 | $(CC) -c ${CFLAGS} `echo ${srcdir}/expread.tab.c | sed 's,^\./,,'` |
579 | mv expread.tab.o expread.o | |
580 | ||
581 | # dbxread, coffread, mipsread have dependencies on BFD header files. | |
582 | dbxread.o: ${srcdir}/dbxread.c | |
583 | ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/dbxread.c | |
584 | ||
585 | coffread.o: ${srcdir}/coffread.c | |
586 | ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/coffread.c | |
587 | ||
588 | mipsread.o: ${srcdir}/mipsread.c | |
589 | ${CC} -c ${CFLAGS} -I$(BFD_DIR) ${srcdir}/mipsread.c | |
590 | ||
591 | # Drag in the files that are in another directory. | |
592 | ||
bd5635a1 RP |
593 | xdr_ld.o: ${srcdir}/vx-share/xdr_ld.c |
594 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ld.c | |
595 | ||
596 | xdr_ptrace.o: ${srcdir}/vx-share/xdr_ptrace.c | |
597 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_ptrace.c | |
598 | ||
599 | xdr_rdb.o: ${srcdir}/vx-share/xdr_rdb.c | |
600 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_rdb.c | |
601 | ||
602 | xdr_regs.o: ${srcdir}/vx-share/xdr_regs.c | |
603 | ${CC} -c ${CFLAGS} ${srcdir}/vx-share/xdr_regs.c | |
604 | ||
605 | nindy.o: ${srcdir}/nindy-share/nindy.c | |
606 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/nindy.c | |
607 | ||
608 | Onindy.o: ${srcdir}/nindy-share/Onindy.c | |
609 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/Onindy.c | |
610 | ||
611 | ttybreak.o: ${srcdir}/nindy-share/ttybreak.c | |
612 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttybreak.c | |
613 | ||
614 | ttyflush.o: ${srcdir}/nindy-share/ttyflush.c | |
615 | ${CC} -c ${CFLAGS} ${srcdir}/nindy-share/ttyflush.c | |
616 | ||
617 | tdesc-lib/libdc.o : force_update | |
618 | cd tdesc-lib ; ${MAKE} "SYSV_DEFINE=${SYSV_DEFINE}" | |
619 | ||
bd5635a1 RP |
620 | lint: $(LINTFILES) |
621 | $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) | |
622 | ||
623 | gdb.cxref: $(SFILES) | |
624 | cxref -I. $(SFILES) >gdb.cxref | |
625 | ||
626 | force_update : | |
627 | ||
e1ce8aa5 JK |
628 | # When used with GDB, the demangler should never look for leading |
629 | # underscores because GDB strips them off during symbol read-in. Thus | |
630 | # -Dnounderscore. | |
631 | ||
bd5635a1 | 632 | cplus-dem.o : cplus-dem.c |
e1ce8aa5 JK |
633 | ${CC} -c ${CFLAGS} -Dnounderscore \ |
634 | `echo ${srcdir}/cplus-dem.c | sed 's,^\./,,'` | |
dc0c3f64 | 635 | |
625453dc SG |
636 | # GNU Make has an annoying habit of putting *all* the Makefile variables |
637 | # into the environment, unless you include this target as a circumvention. | |
638 | # Rumor is that this will be fixed (and this target can be removed) | |
639 | # in GNU Make 4.0. | |
640 | .NOEXPORT: | |
641 | ||
dc0c3f64 JG |
642 | # This is the end of "Makefile.in". When built into "Makefile" |
643 | # by the configure script, two things are added below this point: | |
644 | # alldeps.mak -- defintions of all files that are used in | |
645 | # host- or target-dependent configurations | |
646 | # depend -- what .o files depend on what .c and .h files, | |
647 | # for all configurations. | |
648 | ||
649 |