Commit | Line | Data |
---|---|---|
62e859f0 | 1 | #Copyright 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. |
33cf356a SG |
2 | |
3 | # This file is part of GDB. | |
4 | ||
5 | # This program is free software; you can redistribute it and/or modify | |
3e5afc2c RP |
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 | |
33cf356a | 17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
3e5afc2c RP |
18 | |
19 | prefix = /usr/local | |
20 | ||
b68b44fa | 21 | program_transform_name = |
4db3902a RP |
22 | exec_prefix = $(prefix) |
23 | bindir = $(exec_prefix)/bin | |
24 | libdir = $(exec_prefix)/lib | |
6a1f93f6 | 25 | tooldir = $(libdir)/$(target_alias) |
4db3902a | 26 | |
3e5afc2c | 27 | datadir = $(prefix)/lib |
4db3902a | 28 | mandir = $(prefix)/man |
3e5afc2c RP |
29 | man1dir = $(mandir)/man1 |
30 | man2dir = $(mandir)/man2 | |
31 | man3dir = $(mandir)/man3 | |
32 | man4dir = $(mandir)/man4 | |
33 | man5dir = $(mandir)/man5 | |
34 | man6dir = $(mandir)/man6 | |
35 | man7dir = $(mandir)/man7 | |
36 | man8dir = $(mandir)/man8 | |
37 | man9dir = $(mandir)/man9 | |
4db3902a | 38 | infodir = $(prefix)/info |
3e5afc2c RP |
39 | includedir = $(prefix)/include |
40 | docdir = $(datadir)/doc | |
41 | ||
42 | SHELL = /bin/sh | |
43 | ||
44 | INSTALL = install -c | |
45 | INSTALL_PROGRAM = $(INSTALL) | |
46 | INSTALL_DATA = $(INSTALL) | |
47 | ||
48 | AR = ar | |
33cf356a | 49 | AR_FLAGS = qv |
3e5afc2c RP |
50 | RANLIB = ranlib |
51 | ||
33cf356a SG |
52 | # Flags that describe where you can find the termcap library. |
53 | # This can be overridden in the host Makefile fragment file. | |
54 | TERMCAP = -ltermcap | |
55 | ||
56 | # System V: If you compile gdb with a compiler which uses the coff | |
57 | # encapsulation feature (this is a function of the compiler used, NOT | |
58 | # of the m-?.h file selected by config.gdb), you must make sure that | |
59 | # the GNU nm is the one that is used by munch. | |
60 | ||
61 | # If you are compiling with GCC, make sure that either 1) You use the | |
62 | # -traditional flag, or 2) You have the fixed include files where GCC | |
63 | # can reach them. Otherwise the ioctl calls in inflow.c | |
64 | # will be incorrectly compiled. The "fixincludes" script in the gcc | |
65 | # distribution will fix your include files up. | |
66 | #CC=cc | |
67 | #CC=gcc -traditional | |
68 | GCC=gcc | |
69 | ||
70 | # Directory containing source files. Don't clean up the spacing, | |
71 | # this exact string is matched for by the "configure" script. | |
72 | srcdir = . | |
d941d8c3 | 73 | |
33cf356a SG |
74 | # It is also possible that you will need to add -I/usr/include/sys to the |
75 | # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which | |
76 | # is where it should be according to Posix). | |
77 | ||
19d0f3f4 | 78 | # If you use bison instead of yacc, it needs to include the "-y" argument. |
0b81fc43 | 79 | #BISON=bison -y |
33cf356a SG |
80 | BISON=yacc |
81 | YACC=$(BISON) | |
33cf356a | 82 | |
33cf356a | 83 | # where to find texinfo; GDB dist should include a recent one |
967007ca | 84 | TEXIDIR=${srcdir}/../texinfo |
33cf356a SG |
85 | |
86 | # where to find makeinfo, preferably one designed for texinfo-2 | |
87 | MAKEINFO=makeinfo | |
88 | ||
89 | # Set this up with gcc if you have gnu ld and the loader will print out | |
90 | # line numbers for undefinded refs. | |
91 | #CC-LD=gcc -static | |
92 | CC-LD=${CC} | |
93 | ||
94 | # Where is the "include" directory? Traditionally ../include or ./include | |
95 | INCLUDE_DIR = ${srcdir}/../include | |
96 | INCLUDE_DEP = $$(INCLUDE_DIR) | |
97 | ||
98 | # Where is the source dir for the MMALLOC library? Traditionally ../mmalloc | |
99 | # or ./mmalloc (When we want the binary library built from it, we use | |
100 | # ${MMALLOC_DIR}${subdir}.) | |
101 | # Note that mmalloc can still be used on systems without mmap(). | |
102 | # To use your system malloc, comment out the following defines. | |
103 | MMALLOC_DIR = ${srcdir}/../mmalloc | |
104 | MMALLOC_DEP = $$(MMALLOC_DIR) | |
105 | MMALLOC_LIB = ./../mmalloc${subdir}/libmmalloc.a | |
106 | # To use your system malloc, uncomment MMALLOC_DISABLE. | |
107 | #MMALLOC_DISABLE = -DNO_MMALLOC | |
108 | # To use mmalloc but disable corruption checking, uncomment MMALLOC_CHECK | |
109 | #MMALLOC_CHECK = -DNO_MMALLOC_CHECK | |
110 | MMALLOC_CFLAGS = ${MMALLOC_CHECK} ${MMALLOC_DISABLE} | |
111 | ||
6f4a4fbb FF |
112 | # Where are the source and binary directories for the BFD library? |
113 | BFD_SRC_DIR = ${srcdir}/../bfd | |
114 | BFD_OBJ_DIR = ./../bfd${subdir} | |
115 | BFD_DEP = $$(BFD_SRC_DIR) | |
116 | BFD_LIB = $(BFD_OBJ_DIR)/libbfd.a | |
33cf356a SG |
117 | |
118 | # Where is the source dir for the READLINE library? Traditionally in .. or . | |
119 | # (For the binary library built from it, we use ${READLINE_DIR}${subdir}.) | |
120 | READLINE_DIR = ${srcdir}/../readline | |
121 | READLINE_DEP = $$(READLINE_DIR) | |
122 | RL_LIB = ./../readline${subdir}/libreadline.a | |
123 | ||
124 | # All the includes used for CFLAGS and for lint. | |
125 | # -I. for config files. | |
126 | # -I${srcdir} possibly for regex.h also. | |
1a0edbc7 | 127 | # -I${srcdir}/config for more generic config files. |
31d16514 | 128 | INCLUDE_CFLAGS = -I. -I${srcdir} -I${srcdir}/config -I$(INCLUDE_DIR) |
33cf356a SG |
129 | |
130 | # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS | |
131 | # from the config/ directory. | |
132 | GLOBAL_CFLAGS = ${MT_CFLAGS} ${MH_CFLAGS} | |
133 | #PROFILE_CFLAGS = -pg | |
134 | ||
135 | # CFLAGS is specifically reserved for setting from the command line | |
136 | # when running make. I.E. "make USER_CFLAGS=-Wmissing-prototypes". | |
137 | CFLAGS = -g | |
138 | # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros. | |
139 | INTERNAL_CFLAGS = ${CFLAGS} ${GLOBAL_CFLAGS} ${PROFILE_CFLAGS} ${MMALLOC_CFLAGS} ${INCLUDE_CFLAGS} ${USER_CFLAGS} | |
140 | # None of the things in CFLAGS will do any harm, and on some systems | |
d40309c7 | 141 | # (e.g. SunOS4) it is important to use the MH_CFLAGS. |
33cf356a SG |
142 | LDFLAGS = $(CFLAGS) |
143 | ||
144 | # Where is the "-liberty" library, containing getopt and obstack? | |
145 | LIBIBERTY_DIR = ${srcdir}/../libiberty | |
146 | LIBIBERTY = ./../libiberty${subdir}/libiberty.a | |
147 | ||
1e4f3c20 KR |
148 | # Where is the "-lopcodes" library, with (some of) the opcode tables and |
149 | # disassemblers? | |
150 | OPCODES = ./../opcodes${subdir}/libopcodes.a | |
151 | ||
33cf356a | 152 | # The config/mh-* file must define REGEX and REGEX1 on USG machines. |
31d16514 | 153 | # If your system is missing alloca(), or, more likely, it's there but |
33cf356a | 154 | # it doesn't work, define ALLOCA & ALLOCA1 too. |
33cf356a SG |
155 | |
156 | # Libraries and corresponding dependencies for compiling gdb. | |
157 | # {X,T}M_CLIBS, defined in *config files, have host- and target-dependent libs. | |
158 | # TERMCAP comes after readline, since readline depends on it. | |
5b40415c JK |
159 | # If you have the Cygnus libraries installed, |
160 | # you can use 'CLIBS=${INSTALLED_LIBS}' 'CDEPS=' | |
161 | INSTALLED_LIBS=-lbfd -lreadline ${TERMCAP} -lopcodes -lmmalloc \ | |
162 | -liberty ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS} | |
d39fbfe3 FF |
163 | CLIBS = ${BFD_LIB} ${RL_LIB} ${TERMCAP} ${OPCODES} ${MMALLOC_LIB} \ |
164 | ${LIBIBERTY} ${XM_CLIBS} ${TM_CLIBS} ${NAT_CLIBS} | |
d40309c7 | 165 | CDEPS = ${XM_CDEPS} ${TM_CDEPS} ${NAT_CDEPS} \ |
d39fbfe3 | 166 | ${BFD_LIB} ${RL_LIB} ${OPCODES} ${MMALLOC_LIB} ${LIBIBERTY} |
33cf356a | 167 | |
d39fbfe3 FF |
168 | ADD_FILES = ${REGEX} ${ALLOCA} ${XM_ADD_FILES} ${TM_ADD_FILES} \ |
169 | ${NAT_ADD_FILES} | |
170 | ADD_DEPS = ${REGEX1} ${ALLOCA1} ${XM_ADD_FILES} ${TM_ADD_FILES} \ | |
171 | ${NAT_ADD_FILES} | |
33cf356a | 172 | |
6e50aeb4 | 173 | VERSION = 4.9.1 |
33cf356a SG |
174 | DIST=gdb |
175 | ||
176 | LINT=/usr/5bin/lint | |
6f4a4fbb | 177 | LINTFLAGS= -I${BFD_SRC_DIR} -I${BFD_OBJ_DIR} |
33cf356a | 178 | |
e7d3b7d1 RS |
179 | RUNTEST=runtest |
180 | RUNTESTFLAGS= | |
6fcb280e | 181 | |
fd382d28 JK |
182 | # This is ser-unix.o for any system which supports a v7/BSD/SYSV/POSIX |
183 | # interface to the serial port. Hopefully if get ported to OS/2, VMS, | |
184 | # etc., then there will be (as part of the C library or perhaps as | |
185 | # part of libiberty) a POSIX interface. But at least for now the | |
186 | # host-dependent makefile fragment might need to use something else | |
187 | # besides ser-unix.o | |
bd91ddd1 | 188 | SER_HARDWIRE=ser-unix.o |
fd382d28 | 189 | |
33cf356a SG |
190 | # Host and target-dependent makefile fragments come in here. |
191 | #### | |
192 | # End of host and target-dependent makefile fragments | |
193 | ||
ef131e13 | 194 | FLAGS_TO_PASS = \ |
2fcc38b8 FF |
195 | "prefix=$(prefix)" \ |
196 | "exec_prefix=$(exec_prefix)" \ | |
ef131e13 JG |
197 | "against=$(against)" \ |
198 | "AR=$(AR)" \ | |
199 | "AR_FLAGS=$(AR_FLAGS)" \ | |
200 | "CC=$(CC)" \ | |
201 | "CFLAGS=$(CFLAGS)" \ | |
aecc5459 ILT |
202 | "CHILLFLAGS=$(CHILLFLAGS)" \ |
203 | "CHILL=$(CHILL)" \ | |
204 | "CHILL_LIB=$(CHILL_LIB)" \ | |
aecc5459 ILT |
205 | "CXX=$(CXX)" \ |
206 | "CXXFLAGS=$(CXXFLAGS)" \ | |
ef131e13 JG |
207 | "RANLIB=$(RANLIB)" \ |
208 | "MAKEINFO=$(MAKEINFO)" \ | |
209 | "INSTALL=$(INSTALL)" \ | |
210 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
211 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
e7d3b7d1 RS |
212 | "RUNTEST=$(RUNTEST)" \ |
213 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ | |
ef131e13 JG |
214 | "BISON=$(BISON)" |
215 | ||
aecc5459 ILT |
216 | # Flags that we pass when building the testsuite. |
217 | ||
218 | CC_FOR_TARGET = ` \ | |
219 | if [ -f $${rootme}/../gcc/Makefile ] ; then \ | |
220 | echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \ | |
221 | else \ | |
222 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
223 | echo $(CC); \ | |
224 | else \ | |
225 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
226 | fi; \ | |
227 | fi` | |
228 | ||
229 | CXX = gcc | |
230 | ||
231 | CXX_FOR_TARGET = ` \ | |
232 | if [ -f $${rootme}/../gcc/Makefile ] ; then \ | |
233 | echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/; \ | |
234 | else \ | |
235 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
236 | echo $(CXX); \ | |
237 | else \ | |
238 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
239 | fi; \ | |
240 | fi` | |
241 | ||
aecc5459 ILT |
242 | CHILLFLAGS = $(CFLAGS) |
243 | CHILL = gcc | |
244 | CHILL_FOR_TARGET = ` \ | |
245 | if [ -f $${rootme}/../gcc/Makefile ] ; then \ | |
246 | echo $${rootme}/../gcc/xgcc -B$${rootme}/../gcc/ -L$${rootme}/../chillrt/; \ | |
247 | else \ | |
248 | if [ "$(host_canonical)" = "$(target_canonical)" ] ; then \ | |
249 | echo $(CC); \ | |
250 | else \ | |
251 | t='$(program_transform_name)'; echo gcc | sed -e '' $$t; \ | |
252 | fi; \ | |
253 | fi` | |
254 | CHILL_LIB = -lchill | |
1fa66e36 | 255 | |
0b96ed06 FF |
256 | # The use of $$(x_FOR_TARGET) reduces the command line length by not |
257 | # duplicating the lengthy definition. | |
aecc5459 ILT |
258 | TARGET_FLAGS_TO_PASS = \ |
259 | "prefix=$(prefix)" \ | |
260 | "exec_prefix=$(exec_prefix)" \ | |
261 | "against=$(against)" \ | |
0b96ed06 FF |
262 | 'CC=$$(CC_FOR_TARGET)' \ |
263 | "CC_FOR_TARGET=$(CC_FOR_TARGET)" \ | |
aecc5459 | 264 | "CFLAGS=$(CFLAGS)" \ |
aecc5459 | 265 | "CHILLFLAGS=$(CHILLFLAGS)" \ |
0b96ed06 FF |
266 | 'CHILL=$$(CHILL_FOR_TARGET)' \ |
267 | "CHILL_FOR_TARGET=$(CHILL_FOR_TARGET)" \ | |
aecc5459 | 268 | "CHILL_LIB=$(CHILL_LIB)" \ |
0b96ed06 FF |
269 | 'CXX=$$(CXX_FOR_TARGET)' \ |
270 | "CXX_FOR_TARGET=$(CXX_FOR_TARGET)" \ | |
aecc5459 ILT |
271 | "CXXFLAGS=$(CXXFLAGS)" \ |
272 | "MAKEINFO=$(MAKEINFO)" \ | |
273 | "INSTALL=$(INSTALL)" \ | |
274 | "INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \ | |
275 | "INSTALL_DATA=$(INSTALL_DATA)" \ | |
e7d3b7d1 RS |
276 | "RUNTEST=$(RUNTEST)" \ |
277 | "RUNTESTFLAGS=$(RUNTESTFLAGS)" \ | |
aecc5459 ILT |
278 | "BISON=$(BISON)" |
279 | ||
5287eacd | 280 | # All source files that go into linking GDB. |
2531303c FF |
281 | # Source files which are included via a config/*/* Makefile fragment should |
282 | # *not* be specified here; they're in "ALLDEPFILES". | |
5287eacd FF |
283 | # Neither should links made at configuration time be specified here, since |
284 | # SFILES is used in building the distribution archive. | |
285 | ||
24c2857c JK |
286 | SFILES = ${srcdir}/blockframe.c ${srcdir}/breakpoint.c ${srcdir}/buildsym.c \ |
287 | ${srcdir}/c-exp.y ${srcdir}/c-lang.c ${srcdir}/c-typeprint.c \ | |
288 | ${srcdir}/c-valprint.c ${srcdir}/ch-exp.y ${srcdir}/ch-lang.c \ | |
289 | ${srcdir}/ch-typeprint.c ${srcdir}/ch-valprint.c ${srcdir}/coffread.c \ | |
290 | ${srcdir}/command.c ${srcdir}/complaints.c ${srcdir}/core.c \ | |
291 | ${srcdir}/cp-valprint.c ${srcdir}/dbxread.c ${srcdir}/demangle.c \ | |
292 | ${srcdir}/dwarfread.c ${srcdir}/elfread.c ${srcdir}/environ.c \ | |
293 | ${srcdir}/eval.c ${srcdir}/expprint.c ${srcdir}/findvar.c \ | |
294 | ${srcdir}/gdbtypes.c \ | |
295 | ${srcdir}/infcmd.c ${srcdir}/inflow.c ${srcdir}/infrun.c \ | |
5287eacd FF |
296 | ${srcdir}/language.c ${srcdir}/putenv.c ${srcdir}/m2-exp.y \ |
297 | ${srcdir}/m2-lang.c ${srcdir}/m2-typeprint.c \ | |
24c2857c JK |
298 | ${srcdir}/m2-valprint.c ${srcdir}/main.c ${srcdir}/maint.c \ |
299 | ${srcdir}/mem-break.c ${srcdir}/minsyms.c ${srcdir}/mipsread.c \ | |
300 | ${srcdir}/objfiles.c ${srcdir}/parse.c ${srcdir}/printcmd.c \ | |
301 | ${srcdir}/remote.c ${srcdir}/source.c ${srcdir}/stabsread.c \ | |
302 | ${srcdir}/stack.c \ | |
303 | ${srcdir}/symfile.c ${srcdir}/symmisc.c ${srcdir}/symtab.c \ | |
304 | ${srcdir}/target.c ${srcdir}/typeprint.c ${srcdir}/utils.c \ | |
305 | ${srcdir}/valarith.c \ | |
306 | ${srcdir}/valops.c ${srcdir}/valprint.c ${srcdir}/values.c \ | |
bd91ddd1 | 307 | ${srcdir}/serial.c ${srcdir}/ser-unix.c |
2531303c FF |
308 | |
309 | # Files that are not source code, but need to go into gdb-$(VERSION).tar.Z. | |
24c2857c JK |
310 | NONSRC = ${srcdir}/Makefile.in ${srcdir}/depend ${srcdir}/alldeps.mak \ |
311 | ${srcdir}/munch ${srcdir}/configure.in \ | |
6e50aeb4 FF |
312 | ${srcdir}/ChangeLog ${srcdir}/ChangeLog-9091 ${srcdir}/ChangeLog-92 \ |
313 | ${srcdir}/ChangeLog-3.x \ | |
24c2857c JK |
314 | ${srcdir}/gdb.1 ${srcdir}/refcard.ps ${srcdir}/README ${srcdir}/TODO \ |
315 | TAGS ${srcdir}/NEWS ${srcdir}/Projects ${srcdir}/.gdbinit \ | |
316 | ${srcdir}/COPYING $(YYFILES) ${srcdir}/copying.c \ | |
317 | ${srcdir}/copying.awk \ | |
318 | ${srcdir}/saber.suppress ${srcdir}/standalone.c ${srcdir}/stuff.c \ | |
5287eacd | 319 | ${srcdir}/kdb-start.c ${srcdir}/gcc.patch \ |
2531303c FF |
320 | ${srcdir}/nindy-share/Makefile ${srcdir}/nindy-share/VERSION \ |
321 | ${srcdir}/nindy-share/README ${srcdir}/vx-share/README \ | |
d8aaff82 | 322 | ${srcdir}/29k-share/README \ |
2531303c FF |
323 | ${srcdir}/config/convex/Convex.notes |
324 | ||
33cf356a SG |
325 | # All source files that lint should look at |
326 | LINTFILES = $(SFILES) $(YYFILES) init.c | |
327 | ||
328 | # Any additional files specified on these lines should also be added to | |
2531303c | 329 | # the NONSRC definition, so they go in the tar files. |
33cf356a SG |
330 | SFILES_STAND = $(SFILES) standalone.c |
331 | SFILES_KGDB = $(SFILES) stuff.c kdb-start.c | |
332 | ||
1a0edbc7 | 333 | # Header files that are not named in config/*/* Makefile fragments go here. |
24c2857c JK |
334 | HFILES = ${srcdir}/breakpoint.h ${srcdir}/buildsym.h ${srcdir}/call-cmds.h \ |
335 | ${srcdir}/command.h ${srcdir}/defs.h ${srcdir}/environ.h \ | |
336 | ${srcdir}/expression.h ${srcdir}/frame.h ${srcdir}/gdbcmd.h \ | |
337 | ${srcdir}/gdbcore.h ${srcdir}/gdbtypes.h ${srcdir}/gdb-stabs.h \ | |
338 | ${srcdir}/inferior.h ${srcdir}/language.h ${srcdir}/minimon.h \ | |
339 | ${srcdir}/objfiles.h ${srcdir}/parser-defs.h \ | |
340 | ${srcdir}/partial-stab.h ${srcdir}/serial.h ${srcdir}/signals.h \ | |
341 | ${srcdir}/solib.h ${srcdir}/symfile.h ${srcdir}/symtab.h \ | |
342 | ${srcdir}/stabsread.h ${srcdir}/target.h ${srcdir}/terminal.h \ | |
343 | ${srcdir}/typeprint.h ${srcdir}/xcoffsolib.h ${srcdir}/value.h \ | |
344 | ${srcdir}/c-lang.h ${srcdir}/ch-lang.h ${srcdir}/m2-lang.h \ | |
345 | ${srcdir}/complaints.h ${srcdir}/ns32k-opcode.h ${srcdir}/valprint.h \ | |
346 | ${srcdir}/config/m68k/tm-m68k.h ${srcdir}/config/pa/tm-hppa.h \ | |
347 | ${srcdir}/config/i960/tm-i960.h ${srcdir}/config/sparc/tm-sparc.h \ | |
348 | ${srcdir}/config/tm-sunos.h \ | |
349 | ${srcdir}/config/tm-sysv4.h ${srcdir}/config/m68k/xm-m68k.h \ | |
350 | ${srcdir}/config/sparc/xm-sparc.h \ | |
351 | ${srcdir}/config/xm-sysv4.h ${srcdir}/config/vax/xm-vax.h \ | |
d8aaff82 | 352 | ${srcdir}/config/nm-trash.h ${srcdir}/29k-share/udi/udiids.h \ |
fd382d28 | 353 | ${srcdir}/29k-share/udi/udiphcfg.h ${srcdir}/29k-share/udi/udiphunix.h \ |
2531303c FF |
354 | ${srcdir}/29k-share/udi/udiproc.h ${srcdir}/29k-share/udi/udipt29k.h \ |
355 | ${srcdir}/29k-share/udi/udiptcfg.h ${srcdir}/29k-share/udi/udisoc.h \ | |
356 | ${srcdir}/29k-share/udi_soc ${srcdir}/nindy-share/b.out.h \ | |
357 | ${srcdir}/nindy-share/block_io.h ${srcdir}/nindy-share/coff.h \ | |
358 | ${srcdir}/nindy-share/demux.h ${srcdir}/nindy-share/env.h \ | |
359 | ${srcdir}/nindy-share/stop.h ${srcdir}/nindy-share/ttycntl.h \ | |
360 | ${srcdir}/vx-share/dbgRpcLib.h ${srcdir}/vx-share/ptrace.h \ | |
361 | ${srcdir}/vx-share/vxTypes.h ${srcdir}/vx-share/vxWorks.h \ | |
362 | ${srcdir}/vx-share/wait.h ${srcdir}/vx-share/xdr_ld.h \ | |
363 | ${srcdir}/vx-share/xdr_ptrace.h ${srcdir}/vx-share/xdr_rdb.h | |
364 | ||
365 | # GDB "info" files, which should be included in their entirety | |
366 | INFOFILES = gdb.info* | |
33cf356a | 367 | |
22473f72 | 368 | REMOTE_EXAMPLES = m68k-stub.c i386-stub.c sparc-stub.c rem-multi.shar |
33cf356a | 369 | |
24c2857c | 370 | POSSLIBS = ${srcdir}/regex.c ${srcdir}/regex.h ${srcdir}/alloca.c |
33cf356a SG |
371 | |
372 | TESTS = testbpt.c testfun.c testrec.c testreg.c testregs.c | |
373 | ||
33cf356a SG |
374 | # Subdirectories of gdb, which should be included in their entirety in |
375 | # gdb-xxx.tar.Z: | |
f4ed8840 | 376 | TARDIRS = doc sparclite # tests |
33cf356a | 377 | |
fd382d28 JK |
378 | # {X,T,NAT}DEPFILES are something of a pain in that it's hard to |
379 | # default their values the way we do for SER_HARDWIRE; in the future | |
380 | # maybe much of the stuff now in {X,T,NAT}DEPFILES will go into other | |
381 | # variables analogous to SER_HARDWIRE which get defaulted in this | |
382 | # Makefile.in | |
383 | ||
384 | DEPFILES = ${TDEPFILES} ${XDEPFILES} ${SER_HARDWIRE} ${NATDEPFILES} | |
33cf356a | 385 | |
2531303c | 386 | SOURCES = $(SFILES) $(ALLDEPFILES) $(YYFILES) |
33cf356a | 387 | TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS} |
2531303c FF |
388 | |
389 | TARFILES = ${SFILES} ${HFILES} ${NONSRC} ${ALLDEPFILES} $(ALLCONFIG) \ | |
0f0834c5 | 390 | $(ALLPARAM) $(INFOFILES) ${POSSLIBS} ${REMOTE_EXAMPLES} |
33cf356a | 391 | |
327f7197 | 392 | OBS = version.o main.o blockframe.o breakpoint.o findvar.o stack.o source.o \ |
33cf356a | 393 | values.o eval.o valops.o valarith.o valprint.o printcmd.o \ |
17cb669f | 394 | symtab.o symfile.o symmisc.o infcmd.o infrun.o remote.o \ |
327f7197 | 395 | command.o utils.o expprint.o environ.o gdbtypes.o \ |
3402b1cf | 396 | copying.o $(DEPFILES) mem-break.o target.o \ |
00cea52f | 397 | putenv.o parse.o language.o $(YYOBJ) \ |
781fa085 | 398 | buildsym.o objfiles.o minsyms.o maint.o demangle.o \ |
f4ed8840 | 399 | dbxread.o coffread.o elfread.o dwarfread.o mipsread.o \ |
a8a69e63 FF |
400 | stabsread.o core.o c-lang.o ch-lang.o m2-lang.o complaints.o \ |
401 | typeprint.o c-typeprint.o ch-typeprint.o m2-typeprint.o \ | |
4e772f44 | 402 | c-valprint.o cp-valprint.o ch-valprint.o m2-valprint.o \ |
fd382d28 | 403 | serial.o |
33cf356a SG |
404 | |
405 | RAPP_OBS = rgdb.o rudp.o rserial.o serial.o udp.o $(XDEPFILES) | |
406 | ||
c9c23412 | 407 | TSOBS = inflow.o |
33cf356a SG |
408 | |
409 | NTSOBS = standalone.o | |
410 | ||
411 | TSSTART = /lib/crt0.o | |
412 | ||
413 | NTSSTART = kdb-start.o | |
414 | ||
aecc5459 | 415 | SUBDIRS = doc testsuite |
33cf356a SG |
416 | |
417 | # For now, shortcut the "configure GDB for fewer languages" stuff. | |
e58de8a2 FF |
418 | YYFILES = c-exp.tab.c m2-exp.tab.c ch-exp.tab.c |
419 | YYOBJ = c-exp.tab.o m2-exp.tab.o ch-exp.tab.o | |
33cf356a SG |
420 | |
421 | # Prevent Sun make from putting in the machine type. Setting | |
422 | # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1. | |
423 | .c.o: | |
424 | ${CC} -c ${INTERNAL_CFLAGS} $< | |
425 | ||
426 | all: gdb | |
0139c441 | 427 | @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do |
6fcb280e | 428 | |
80c8fd72 | 429 | installcheck: |
e7d3b7d1 | 430 | check: force |
0139c441 | 431 | @rootme=`pwd`; export rootme; $(MAKE) $(TARGET_FLAGS_TO_PASS) DO=check DODIRS=testsuite subdir_do |
b396a969 | 432 | info dvi: force |
0139c441 | 433 | @$(MAKE) $(FLAGS_TO_PASS) DO=$@ "DODIRS=$(SUBDIRS)" subdir_do |
33cf356a | 434 | install-info: force |
0139c441 | 435 | @$(MAKE) $(FLAGS_TO_PASS) DO=install-info "DODIRS=$(SUBDIRS)" subdir_do |
33cf356a | 436 | clean-info: force |
0139c441 | 437 | @$(MAKE) $(FLAGS_TO_PASS) DO=clean-info "DODIRS=$(SUBDIRS)" subdir_do |
33cf356a SG |
438 | |
439 | gdb.z:gdb.1 | |
440 | nroff -man $(srcdir)/gdb.1 | col -b > gdb.t | |
441 | pack gdb.t ; rm -f gdb.t | |
442 | mv gdb.t.z gdb.z | |
443 | ||
702c0ff7 JK |
444 | # Traditionally this depends on "all". But it is probably more useful |
445 | # not to; for example, if the user has made some trivial change to a | |
446 | # source file and doesn't care about rebuilding or just wants to save the | |
447 | # time it takes for make to check that all is up to date. | |
448 | install: | |
ef131e13 JG |
449 | -parent=`echo $(bindir)|sed -e 's@/[^/]*$$@@'`; \ |
450 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi | |
451 | -if [ -d $(bindir) ] ; then true ; else mkdir $(bindir) ; fi | |
452 | -parent=`echo $(man1dir)|sed -e 's@/[^/]*$$@@'`; \ | |
453 | if [ -d $$parent ] ; then true ; else mkdir $$parent ; fi | |
454 | -if [ -d $(man1dir) ] ; then true ; else mkdir $(man1dir) ; fi | |
b68b44fa ILT |
455 | -n=`t='$(program_transform_name)'; echo gdb | sed -e "" $$t`; \ |
456 | $(INSTALL_PROGRAM) gdb $(bindir)/$$n; \ | |
457 | $(INSTALL_DATA) $(srcdir)/gdb.1 $(man1dir)/$$n.1 | |
33cf356a | 458 | $(M_INSTALL) |
0139c441 | 459 | @$(MAKE) DO=install "DODIRS=$(SUBDIRS)" $(FLAGS_TO_PASS) subdir_do |
33cf356a SG |
460 | |
461 | init.c: $(srcdir)/munch $(OBS) $(TSOBS) | |
462 | $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(TSOBS) > init.c | |
463 | ||
464 | gdb: $(OBS) $(TSOBS) ${ADD_DEPS} ${CDEPS} init.o | |
465 | ${CC-LD} $(GLOBAL_CFLAGS) $(LDFLAGS) -o gdb \ | |
466 | init.o $(OBS) $(TSOBS) $(ADD_FILES) $(CLIBS) $(LOADLIBES) | |
467 | ||
468 | saber_gdb: $(SFILES) $(DEPFILES) copying.c version.c | |
6f4a4fbb | 469 | #setopt load_flags $(CFLAGS) -I$(BFD_SRC_DIR) -I${BFD_OBJ_DIR} -DHOST_SYS=SUN4_SYS |
33cf356a | 470 | #load ./init.c $(SFILES) |
b076b3f8 FF |
471 | #unload ${srcdir}/c-exp.y ${srcdir}/m2-exp.y ${srcdir}/ch-exp.y |
472 | #unload ${srcdir}/vx-share/*.h | |
33cf356a | 473 | #unload ${srcdir}/nindy-share/[A-Z]* |
e58de8a2 | 474 | #load c-exp.tab.c m2-exp.tab.c ch-exp.tab.c |
33cf356a | 475 | #load copying.c version.c |
1e4f3c20 | 476 | #load ../opcodes/libopcodes.a |
33cf356a SG |
477 | #load ../libiberty/libiberty.a |
478 | #load ../bfd/libbfd.a | |
479 | #load ../readline/libreadline.a | |
480 | #load ../mmalloc/libmmalloc.a | |
481 | #load -ltermcap | |
482 | #load `echo " "$(DEPFILES) | sed -e 's/\.o/.c/g' -e 's, , ../,g'` | |
483 | echo "Load .c corresponding to:" $(DEPFILES) | |
484 | ||
485 | ||
486 | # This is useful when debugging GDB, because some Unix's don't let you run GDB | |
487 | # on itself without copying the executable. So "make gdb1" will make | |
488 | # gdb and put a copy in gdb1, and you can run it with "gdb gdb1". | |
489 | # Removing gdb1 before the copy is the right thing if gdb1 is open | |
490 | # in another process. | |
491 | gdb1: gdb | |
492 | rm -f gdb1 | |
493 | cp gdb gdb1 | |
494 | ||
495 | # This is a remote stub which runs under unix and starts up an | |
496 | # inferior process. This is at least useful for debugging GDB's | |
497 | # remote support. | |
498 | rapp: $(RAPP_OBS) | |
499 | rm -f rapp_init.c | |
500 | ${srcdir}/munch ${MUNCH_DEFINE} ${RAPP_OBS} > rapp_init.c | |
501 | ${CC-LD} $(LDFLAGS) -o $@ rapp_init.c $(RAPP_OBS) | |
502 | ||
503 | # Support for building Makefile out of configured pieces, automatically | |
504 | # generated dependencies, etc. alldeps.mak is a file that contains | |
2531303c FF |
505 | # "make" variable definitions for all ALLDEPFILES, ALLPARAM, and ALLCONFIG, |
506 | # all cadged from the current contents of the config subtree. | |
33cf356a | 507 | |
fd382d28 JK |
508 | # using sort and uniq is not a violation of the GNU coding standards |
509 | # because this rule is not part of building and installing GDB. | |
2531303c FF |
510 | alldeps.mak: force |
511 | rm -f alldeps.mak alldeps*.tmp allparam*.tmp allconfig*.tmp | |
24c2857c | 512 | for i in `(cd ${srcdir}; find config -name '*.m[ht]' -print)` ; do \ |
33cf356a | 513 | echo $$i >>allconfig.tmp; \ |
24c2857c | 514 | awk <${srcdir}/$$i ' \ |
d40309c7 | 515 | $$1 == "TDEPFILES=" || $$1 == "XDEPFILES=" \ |
fd382d28 | 516 | || $$1 == "NATDEPFILES=" || $$1 == "SER_HARDWIRE=" { \ |
33cf356a SG |
517 | for (i = 2; i <= NF; i++) \ |
518 | print $$i >> "alldeps.tmp" ; \ | |
519 | } \ | |
f4ed8840 | 520 | $$1 == "TM_FILE=" || $$1 == "XM_FILE=" || $$1 == "NAT_FILE=" { \ |
33cf356a SG |
521 | print $$2 >> "allparam.tmp" }' ; \ |
522 | done | |
523 | sort <alldeps.tmp | uniq | \ | |
524 | sed -e 's/arm-convert.o/arm-convert.s/' \ | |
525 | -e 's!^Onindy.o!nindy-share/Onindy.c!' \ | |
526 | -e 's!^nindy.o!nindy-share/nindy.c!' \ | |
527 | -e 's!ttybreak.o!nindy-share/ttybreak.c!' \ | |
528 | -e 's!ttyflush.o!nindy-share/ttyflush.c!' \ | |
529 | -e 's!xdr_ld.o!vx-share/xdr_ld.c!' \ | |
530 | -e 's!xdr_ptrace.o!vx-share/xdr_ptrace.c!' \ | |
531 | -e 's!xdr_rdb.o!vx-share/xdr_rdb.c!' \ | |
6881fb6d | 532 | -e 's!udr.o!29k-share/udi/udr.c!' \ |
6881fb6d | 533 | -e 's!udip2soc.o!29k-share/udi/udip2soc.c!' \ |
2531303c FF |
534 | -e '/..\/sim\//d' \ |
535 | -e '/..\/opcodes\//d' \ | |
33cf356a SG |
536 | -e 's/\.o/.c/' \ |
537 | >alldeps2.tmp | |
1a0edbc7 | 538 | for i in `cat allparam.tmp` ; do \ |
24c2857c JK |
539 | (cd ${srcdir} ; \ |
540 | find config -name $$i -print ) >>allparam2.tmp ; \ | |
1a0edbc7 | 541 | done |
2531303c FF |
542 | echo '# Start of "alldeps.mak" definitions' >>alldeps.mak; |
543 | sort <alldeps2.tmp | uniq | awk 'BEGIN {printf "ALLDEPFILES="} \ | |
24c2857c JK |
544 | NR == 0 {printf "$${srcdir}/" $$0;} \ |
545 | NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \ | |
2531303c | 546 | END {printf "\n\n"}' >>alldeps.mak; |
1a0edbc7 | 547 | sort <allparam2.tmp | uniq | awk 'BEGIN {printf "ALLPARAM="} \ |
24c2857c JK |
548 | NR == 0 {printf "$${srcdir}/" $$0;} \ |
549 | NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \ | |
2531303c | 550 | END {printf "\n\n"}' >>alldeps.mak; |
33cf356a | 551 | sort <allconfig.tmp | uniq | awk 'BEGIN {printf "ALLCONFIG="} \ |
24c2857c JK |
552 | NR == 0 {printf "$${srcdir}/" $$0;} \ |
553 | NR != 0 {printf "\\\n" "$${srcdir}/" $$0} \ | |
2531303c FF |
554 | END {printf "\n\n"}' >>alldeps.mak; |
555 | echo '# End of "alldeps.mak" definitions' >>alldeps.mak; | |
556 | rm -f alldeps*.tmp allparam*.tmp allconfig*.tmp | |
33cf356a | 557 | |
33cf356a SG |
558 | depend: $(SOURCES) Makefile.in |
559 | @echo Ignore errors about non-existent system-supplied include files | |
560 | @echo for systems other than the one you are using. | |
ee7e82fe | 561 | @echo Also ignore any errors in arm-convert.s. |
6f4a4fbb FF |
562 | -$(GCC) -MM -nostdinc -I/usr/include -I${BFD_SRC_DIR} \ |
563 | -I${BFD_OBJ_DIR} -I${READLINE_DIR} $(INTERNAL_CFLAGS) \ | |
3402b1cf | 564 | `ls $(SOURCES) | grep -v '\.[hy]$$' | \ |
33cf356a | 565 | sort -u` >depend.tmp |
31d16514 | 566 | #BEGIN COMMENTED OUT CODE -- this should now be taken care of below. |
33cf356a | 567 | # If running in srcdir, translate "./foo.c" into "$srcdir/foo.c" except |
b6113cc4 | 568 | # for xm.h, tm.h and nm.h. This allows the same "depend" file to be used |
33cf356a | 569 | # by the various subdirectories. |
31d16514 JK |
570 | # if [ "${srcdir}" = "." ] ; then \ |
571 | # <depend.tmp sed \ | |
572 | # -e 's; ./xm.h; xm.h;g' \ | |
573 | # -e 's; ./tm.h; tm.h;g' \ | |
574 | # -e 's; ./nm.h; nm.h;g' \ | |
575 | # -e 's; \./; $${srcdir}/;g' \ | |
576 | # -e 's; vx-share/; $${srcdir}/vx-share/;g' \ | |
577 | # -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \ | |
578 | # -e 's; 29k-share/; $${srcdir}/29k-share/;g' \ | |
579 | # >depend.tm2; \ | |
580 | # rm depend.tmp; \ | |
581 | # mv depend.tm2 depend.tmp; \ | |
582 | # fi | |
583 | #END COMMENTED OUT CODE | |
584 | # Make everything which depends on {x,t,n}m.h depend on config.status as | |
585 | # well, in case someone reconfigures gdb out from under an already | |
586 | # compiled gdb. | |
587 | # | |
588 | # Translate SRCDIR/foo.c to $srcdir/foo.c. This allows this "depend" file | |
589 | # to be used by any dir, or included in a distribution. It's possible | |
590 | # we should write the generated copy into SRCDIR like "make headers" does | |
591 | # in bfd. We do not try to quote the regexp, so if SRCDIR/ is "./" it will | |
592 | # also match any single character followed by "/". This is OK. | |
33cf356a | 593 | <depend.tmp sed \ |
33cf356a SG |
594 | -e 's; $(INCLUDE_DIR)/; $(INCLUDE_DEP)/;g' \ |
595 | -e 's; $(READLINE_DIR)/; $(READLINE_DEP)/;g' \ | |
596 | -e 's; [a-z0-9./]*bfd/; $(BFD_DEP)/;g' \ | |
90494078 RP |
597 | -e 's; $(BFD_DEP)/bfd\.h; ../bfd/bfd.h;g' \ |
598 | -e 's; $(INCLUDE_DEP)/../bfd/bfd\.h; ../bfd/bfd.h;g' \ | |
31d16514 JK |
599 | -e 's; \./xm.h; xm.h config.status;g' \ |
600 | -e 's; \./tm.h; tm.h config.status;g' \ | |
601 | -e 's; \./nm.h; nm.h config.status;g' \ | |
602 | -e 's; ${srcdir}/; $${srcdir}/;g' \ | |
603 | -e 's; vx-share/; $${srcdir}/vx-share/;g' \ | |
604 | -e 's; nindy-share/; $${srcdir}/nindy-share/;g' \ | |
605 | -e 's; 29k-share/; $${srcdir}/29k-share/;g' \ | |
5b8462fa | 606 | >depend.tm3; |
67d2bd1a | 607 | # OK, get your sed manual out. This script makes the rules in |
5b8462fa JK |
608 | # depend explicitly state the rule, rather than relying on VPATH |
609 | # or a .c.o implicit rule. This is needed for Sun make, and should | |
67d2bd1a FF |
610 | # be portable to any make worthy of the name. |
611 | # There is one exception: the *.tab.c files can exist either in srcdir | |
612 | # or in ., so make sure not to use an explicit rule for them. | |
31d16514 | 613 | # |
6f4a4fbb FF |
614 | # Adding -I${BFD_SRC_DIR} and -I${BFD_OBJ_DIR} is required for all the files |
615 | # which use BFD internals. This is because some bfd include files are in the | |
616 | # source directory, and some (bfd.h for example) are generated in the bfd | |
617 | # build directory. | |
31d16514 JK |
618 | # Adding -I${READLINE_DIR} is required because the readline header files |
619 | # are in readline not in include. They probably should be moved. | |
5b8462fa JK |
620 | <depend.tm3 sed \ |
621 | -e '/:/h' \ | |
622 | -e '/\\$$/b end' \ | |
623 | -e 'p' \ | |
624 | -e 'g' \ | |
67d2bd1a | 625 | -e '/:.*\.tab\.c/d' \ |
5b8462fa | 626 | -e 's/.*:\(.*\.c\).*/ $${CC} -c $${INTERNAL_CFLAGS} \1/' \ |
6f4a4fbb | 627 | -e 's;$${srcdir}/xcoffread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ |
702c0ff7 JK |
628 | -e 's;$${srcdir}/xcoffexec.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ |
629 | -e 's;$${srcdir}/paread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ | |
6f4a4fbb FF |
630 | -e 's;$${srcdir}/stabsread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ |
631 | -e 's;$${srcdir}/dwarfread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ | |
632 | -e 's;$${srcdir}/elfread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ | |
633 | -e 's;$${srcdir}/mipsread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ | |
634 | -e 's;$${srcdir}/coffread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ | |
635 | -e 's;$${srcdir}/dbxread.c;-I$${BFD_SRC_DIR} -I$${BFD_OBJ_DIR} &;' \ | |
31d16514 | 636 | -e 's;$${srcdir}/main.c;-I$${READLINE_DIR} &;' \ |
5b8462fa JK |
637 | -e ': end' \ |
638 | >depend.tm4; | |
639 | mv depend.tm4 depend | |
31d16514 | 640 | # rm depend.tm? |
33cf356a SG |
641 | |
642 | config.status: | |
643 | @echo "You must configure gdb. Look at the README file for details." | |
644 | @false | |
645 | ||
ef131e13 JG |
646 | # This checks the configure.in file versus the config/ directory. |
647 | config-check: config-check-hosts config-check-targets | |
648 | config-check-hosts: | |
649 | grep gdb_host= ${srcdir}/configure.in | \ | |
650 | sed -e 's/.*gdb_host=//' -e 's/ ;;$$/.mh/' | sort -u >HOSTconf.o | |
651 | (cd ${srcdir}/config; ls *.mh) >HOSTdir.o | |
652 | diff -u HOSTconf.o HOSTdir.o | |
653 | ||
654 | config-check-targets: | |
655 | grep gdb_target= ${srcdir}/configure.in | \ | |
656 | sed -e 's/.*gdb_target=//' -e 's/ ;;$$/.mh/' | sort -u >TARGconf.o | |
657 | (cd ${srcdir}/config; ls *.mt) >TARGdir.o | |
658 | diff -u HOSTconf.o HOSTdir.o | |
659 | ||
33cf356a SG |
660 | # These are not generated by "make depend" because they only are there |
661 | # for some machines. | |
662 | # But these rules don't do what we want; we want to hack the foo.o: tm.h | |
663 | # dependency to do the right thing. | |
2225eb85 FF |
664 | tm-isi.h tm-sun3.h tm-news.h tm-hp300bsd.h tm-altos.h: tm-m68k.h |
665 | tm-hp300hpux.h tm-sun2.h tm-3b1.h: tm-m68k.h | |
33cf356a SG |
666 | xm-news1000.h: xm-news.h |
667 | xm-i386-sv32.h: xm-i386.h | |
668 | tm-i386gas.h: tm-i386.h | |
669 | xm-sun4os4.h: xm-sparc.h | |
670 | tm-sun4os4.h: tm-sparc.h | |
671 | xm-vaxult.h: xm-vax.h | |
672 | xm-vaxbsd.h: xm-vax.h | |
673 | ||
2531303c | 674 | kdb: $(NTSSTART) $(OBS) $(NTSOBS) ${ADD_DEPS} ${CDEPS} |
33cf356a SG |
675 | rm -f init.c |
676 | $(srcdir)/munch ${MUNCH_DEFINE} $(OBS) $(NTSOBS) > init.c | |
677 | $(CC) $(LDFLAGS) -c init.c $(CLIBS) | |
678 | ld -o kdb $(NTSSTART) $(OBS) $(NTSOBS) init.o $(ADD_FILES) \ | |
679 | -lc $(CLIBS) | |
680 | ||
8d57a263 JK |
681 | # Put the proper machine-specific files first, so M-. on a machine |
682 | # specific routine gets the one for the correct machine. | |
db7c818b | 683 | # The xyzzy stuff below deals with empty DEPFILES |
2531303c | 684 | TAGS: ${TAGFILES} |
24c2857c JK |
685 | etags `find ${srcdir}/config -name $(TM_FILE) -print` \ |
686 | `find ${srcdir}/config -name ${XM_FILE} -print` \ | |
687 | `find ${srcdir}/config -name ${NAT_FILE} -print` \ | |
db7c818b JK |
688 | `for i in yzzy ${DEPFILES}; do \ |
689 | if [ x$$i != xyzzy ]; then \ | |
690 | echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \ | |
691 | fi; \ | |
692 | done` \ | |
24c2857c | 693 | ${TAGFILES} |
33cf356a SG |
694 | tags: TAGS |
695 | ||
696 | # Making distributions of GDB and friends. | |
697 | ||
33cf356a SG |
698 | # Make a tar file containing the GDB directory of the distribution. |
699 | gdb.tar.Z: force_update | |
700 | $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist | |
701 | $(MAKE) $(MFLAGS) -f Makefile.in gdb-$(VERSION).tar.Z | |
702 | ||
2531303c FF |
703 | # Make a directory `proto-gdb.dir' that contains an image of the GDB |
704 | # directory of the distribution, built up with symlinks. Note that this | |
705 | # make target is not directly referenced by any other rules in this makefile, | |
706 | # it is referenced by the makefile in the parent directory. | |
707 | make-proto-gdb.dir: force_update | |
708 | $(MAKE) $(MFLAGS) -f Makefile.in setup-to-dist | |
709 | $(MAKE) $(MFLAGS) -f Makefile make-proto-gdb-1 | |
710 | ||
711 | # Set up the GDB source directory for distribution, by building all files that | |
712 | # are products of other files. | |
713 | setup-to-dist: update-depend force_update | |
714 | ../configure none | |
715 | (cd doc; $(MAKE) $(MFLAGS) GDBvn.texi) | |
716 | $(MAKE) $(MFLAGS) gdb.info | |
717 | $(MAKE) $(MFLAGS) refcard.ps | |
22473f72 JG |
718 | |
719 | # Update the "depend" and "alldeps.mak" files in a source directory. | |
720 | # We update alldeps.mak first, since it is used to generate the list | |
721 | # of files to be checked for dependencies. | |
722 | update-depend: update-alldeps force_update | |
b3d4dd73 | 723 | ../configure none -norecursion |
6f4a4fbb FF |
724 | (cd ../bfd; ../configure sun4 -norecursion; rm -f stmp-bfd.h) |
725 | (cd ../bfd; $(MAKE) $(MFLAGS) bfd.h) | |
33cf356a SG |
726 | rm -f depend |
727 | $(MAKE) $(MFLAGS) depend | |
22473f72 | 728 | |
2531303c FF |
729 | # Update the "alldeps.mak" file in a source directory. |
730 | update-alldeps: force_update | |
731 | ../configure none -norecursion | |
732 | rm -f alldeps.mak | |
733 | $(MAKE) $(MFLAGS) alldeps.mak | |
33cf356a SG |
734 | |
735 | # Build a tar file from a proto-gdb.dir. | |
736 | gdb-$(VERSION).tar.Z: force_update | |
737 | rm -f gdb.tar gdb-$(VERSION).tar.Z | |
2531303c | 738 | $(MAKE) $(MFLAGS) -f Makefile make-proto-gdb-1 |
33cf356a SG |
739 | ln -s proto-gdb.dir $(DIST) |
740 | tar chf - $(DIST) | compress >gdb-$(VERSION).tar.Z | |
741 | rm -rf $(DIST) proto-gdb.dir | |
742 | ||
743 | # Build a proto-gdb.dir after GDB has been set up for distribution. | |
744 | # This stuff must be run in `Makefile', not `Makefile.in`; we use the makefile | |
745 | # built in the setup-to-dist process, since it defines things like ALLCONFIG | |
746 | # and ALLDEPFILES, that we need. | |
747 | make-proto-gdb-1: ${TARFILES} ${TARDIRS} gdb.info | |
748 | rm -rf proto-gdb.dir | |
749 | mkdir proto-gdb.dir | |
2531303c FF |
750 | rootme=`pwd`/ ; export rootme ; \ |
751 | for i in `echo ${TARDIRS}`; do \ | |
752 | (cd proto-gdb.dir ; \ | |
753 | mkdir -p $$i; \ | |
754 | cd $$i; \ | |
755 | ln -s $${rootme}/$$i/* .; \ | |
756 | rm -rf SCCS CVS CVS.adm RCS config.status; \ | |
757 | if test -f Makefile.in; then rm Makefile; else true; fi;); \ | |
758 | done ; \ | |
759 | for i in `echo ${TARFILES}`; do \ | |
760 | (cd proto-gdb.dir ; \ | |
761 | dir=`dirname $$i`; \ | |
762 | if test -d $$dir; then true; else mkdir -p $$dir; fi; \ | |
763 | ln -s $${rootme}/$$i $$i;); \ | |
764 | done | |
33cf356a SG |
765 | chmod og=u `find . -print` |
766 | ||
97e72c06 FF |
767 | # Build a proto-testsuite.dir. |
768 | make-proto-testsuite.dir: force_update | |
769 | rm -rf proto-testsuite.dir | |
770 | mkdir proto-testsuite.dir | |
771 | rootme=`pwd`/ ; export rootme ; \ | |
772 | for i in `find testsuite -type f -print`; do \ | |
773 | (cd proto-testsuite.dir ; \ | |
774 | dir=`dirname $$i`; \ | |
775 | if test -d $$dir; then true; else mkdir -p $$dir; fi; \ | |
776 | ln -s $${rootme}/$$i $$i;); \ | |
777 | done | |
778 | find proto-testsuite.dir -name Makefile -exec rm {} \; | |
779 | find proto-testsuite.dir -name config.status -exec rm {} \; | |
780 | ||
33cf356a | 781 | clean: |
4e772f44 | 782 | @$(MAKE) $(FLAGS_TO_PASS) DO=clean "DODIRS=$(SUBDIRS)" subdir_do |
33cf356a SG |
783 | rm -f *.o ${ADD_FILES} *~ |
784 | rm -f init.c version.c | |
2531303c | 785 | rm -f gdb core make.log |
33cf356a | 786 | rm -f gdb[0-9] |
33cf356a | 787 | |
39d4639b JK |
788 | # This used to depend on c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS |
789 | # I believe this is wrong; the makefile standards for distclean just | |
790 | # describe removing files; the only sort of "re-create a distribution" | |
791 | # functionality described is if the distributed files are unmodified. | |
792 | distclean: clean | |
4e772f44 | 793 | @$(MAKE) $(FLAGS_TO_PASS) DO=distclean "DODIRS=$(SUBDIRS)" subdir_do |
39d4639b | 794 | rm -f nm.h tm.h xm.h config.status |
33cf356a SG |
795 | rm -f y.output yacc.acts yacc.tmp |
796 | rm -f ${TESTS} Makefile depend | |
33cf356a SG |
797 | |
798 | realclean: clean | |
4e772f44 | 799 | @$(MAKE) $(FLAGS_TO_PASS) DO=realclean "DODIRS=$(SUBDIRS)" subdir_do |
e58de8a2 | 800 | rm -f c-exp.tab.c m2-exp.tab.c ch-exp.tab.c TAGS |
39d4639b JK |
801 | rm -f nm.h tm.h xm.h config.status |
802 | rm -f y.output yacc.acts yacc.tmp | |
803 | rm -f ${TESTS} Makefile depend | |
33cf356a SG |
804 | |
805 | STAGESTUFF=${OBS} ${TSOBS} ${NTSOBS} ${ADD_FILES} init.c init.o version.c gdb | |
806 | ||
807 | subdir_do: force | |
808 | @for i in $(DODIRS); do \ | |
6f4a4fbb | 809 | if [ -f ./$$i/Makefile ] ; then \ |
33cf356a | 810 | if (cd ./$$i; \ |
ef131e13 | 811 | $(MAKE) $(FLAGS_TO_PASS) $(DO)) ; then true ; \ |
33cf356a SG |
812 | else exit 1 ; fi ; \ |
813 | else true ; fi ; \ | |
814 | done | |
d941d8c3 | 815 | |
33cf356a SG |
816 | Makefile: $(srcdir)/Makefile.in $(host_makefile_frag) $(target_makefile_frag) |
817 | $(SHELL) ./config.status | |
d941d8c3 | 818 | |
33cf356a | 819 | force: |
d941d8c3 | 820 | |
33cf356a SG |
821 | # Documentation! |
822 | # GDB QUICK REFERENCE (TeX dvi file, CM fonts) | |
2b21d8aa | 823 | refcard.dvi: |
ef131e13 | 824 | ( cd ./doc; $(MAKE) refcard.dvi $(FLAGS_TO_PASS) ) |
33cf356a | 825 | mv ./doc/refcard.dvi . |
d941d8c3 | 826 | |
33cf356a | 827 | # GDB QUICK REFERENCE (PostScript output, common PS fonts) |
2b21d8aa | 828 | refcard.ps: |
ef131e13 | 829 | ( cd ./doc; $(MAKE) refcard.ps $(FLAGS_TO_PASS) ) |
33cf356a | 830 | mv ./doc/refcard.ps . |
d941d8c3 | 831 | |
33cf356a | 832 | # GDB MANUAL: TeX dvi file |
259d1dea | 833 | gdb.dvi: |
2b21d8aa | 834 | ( cd ./doc; $(MAKE) gdb.dvi $(FLAGS_TO_PASS) ) |
33cf356a | 835 | mv ./doc/gdb.dvi . |
d941d8c3 | 836 | |
33cf356a | 837 | # GDB MANUAL: info file |
259d1dea | 838 | gdb.info: |
24b88ae8 | 839 | ( cd ./doc; $(MAKE) gdb.info $(FLAGS_TO_PASS) ) |
33cf356a | 840 | mv ./doc/gdb.info* . |
d941d8c3 | 841 | |
33cf356a SG |
842 | # Make copying.c from COPYING |
843 | copying.c: ${srcdir}/COPYING ${srcdir}/copying.awk | |
844 | awk -f ${srcdir}/copying.awk < ${srcdir}/COPYING > copying.c | |
d941d8c3 | 845 | |
33cf356a SG |
846 | version.c: Makefile |
847 | echo 'char *version = "$(VERSION)";' >version.c | |
90494078 RP |
848 | echo 'char *host_canonical = "$(host_canonical)";' >> version.c |
849 | echo 'char *target_canonical = "$(target_canonical)";' >> version.c | |
d941d8c3 | 850 | |
33cf356a SG |
851 | # c-exp.tab.c is generated in target dir from c-exp.y if it doesn't exist |
852 | # in srcdir, then compiled in target dir to c-exp.tab.o. | |
f4ed8840 JG |
853 | # ././c-exp.tab.c is so the command argument will never match $(srcdir)/c-exp.y |
854 | # (some "makes" rewrite the VPATH into command arguments if they match deps). | |
9aa44833 SG |
855 | # Remove bogus decls for malloc/realloc/free which conflict with everything |
856 | # else. | |
33cf356a | 857 | c-exp.tab.o: c-exp.tab.c |
f4ed8840 | 858 | c-exp.tab.c: $(srcdir)/c-exp.y $(srcdir)/Makefile.in |
33cf356a | 859 | @echo 'Expect 4 shift/reduce conflicts.' |
3717e95b | 860 | ${YACC} ${YFLAGS} $(srcdir)/c-exp.y |
9aa44833 SG |
861 | -sed -e '/extern.*malloc/d' \ |
862 | -e '/extern.*realloc/d' \ | |
863 | -e '/extern.*free/d' \ | |
e58de8a2 | 864 | -e '/include.*malloc.h/d' \ |
e35843d4 FF |
865 | -e 's/malloc/xmalloc/g' \ |
866 | -e 's/realloc/xrealloc/g' \ | |
39d4639b | 867 | < y.tab.c > c-exp.new |
9aa44833 | 868 | -rm y.tab.c |
39d4639b | 869 | mv c-exp.new ././c-exp.tab.c |
d941d8c3 | 870 | |
e58de8a2 FF |
871 | # ch-exp.tab.c is generated in target dir from ch-exp.y if it doesn't exist |
872 | # in srcdir, then compiled in target dir to ch-exp.tab.o. | |
873 | # Remove bogus decls for malloc/realloc/free which conflict with everything | |
874 | # else. | |
875 | ch-exp.tab.o: ch-exp.tab.c | |
f4ed8840 | 876 | ch-exp.tab.c: $(srcdir)/ch-exp.y $(srcdir)/Makefile.in |
3717e95b | 877 | ${YACC} ${YFLAGS} $(srcdir)/ch-exp.y |
e58de8a2 FF |
878 | -sed -e '/extern.*malloc/d' \ |
879 | -e '/extern.*realloc/d' \ | |
880 | -e '/extern.*free/d' \ | |
881 | -e '/include.*malloc.h/d' \ | |
882 | -e 's/malloc/xmalloc/g' \ | |
883 | -e 's/realloc/xrealloc/g' \ | |
39d4639b | 884 | < y.tab.c > ch-exp.new |
e58de8a2 | 885 | -rm y.tab.c |
39d4639b | 886 | mv ch-exp.new ././ch-exp.tab.c |
e58de8a2 | 887 | |
33cf356a SG |
888 | # m2-exp.tab.c is generated in target dir from m2-exp.y if it doesn't exist |
889 | # in srcdir, then compiled in target dir to m2-exp.tab.o. | |
e58de8a2 FF |
890 | # Remove bogus decls for malloc/realloc/free which conflict with everything |
891 | # else. | |
33cf356a | 892 | m2-exp.tab.o: m2-exp.tab.c |
f4ed8840 | 893 | m2-exp.tab.c: $(srcdir)/m2-exp.y $(srcdir)/Makefile.in |
3717e95b | 894 | ${YACC} ${YFLAGS} $(srcdir)/m2-exp.y |
9aa44833 SG |
895 | -sed -e '/extern.*malloc/d' \ |
896 | -e '/extern.*realloc/d' \ | |
897 | -e '/extern.*free/d' \ | |
e58de8a2 | 898 | -e '/include.*malloc.h/d' \ |
e35843d4 FF |
899 | -e 's/malloc/xmalloc/g' \ |
900 | -e 's/realloc/xrealloc/g' \ | |
39d4639b | 901 | < y.tab.c > m2-exp.new |
9aa44833 | 902 | -rm y.tab.c |
39d4639b JK |
903 | mv m2-exp.new ././m2-exp.tab.c |
904 | ||
905 | # These files are updated atomically, so make never has to remove them | |
906 | .PRECIOUS: m2-exp.tab.c ch-exp.tab.c c-exp.tab.c | |
d941d8c3 | 907 | |
33cf356a SG |
908 | lint: $(LINTFILES) |
909 | $(LINT) $(INCLUDE_CFLAGS) $(LINTFLAGS) $(LINTFILES) \ | |
910 | `echo ${DEPFILES} | sed 's/\.o /\.c /g' | |
d941d8c3 | 911 | |
33cf356a SG |
912 | gdb.cxref: $(SFILES) |
913 | cxref -I. $(SFILES) >gdb.cxref | |
d941d8c3 | 914 | |
33cf356a | 915 | force_update: |
d941d8c3 | 916 | |
33cf356a SG |
917 | # GNU Make has an annoying habit of putting *all* the Makefile variables |
918 | # into the environment, unless you include this target as a circumvention. | |
919 | # Rumor is that this will be fixed (and this target can be removed) | |
920 | # in GNU Make 4.0. | |
921 | .NOEXPORT: | |
d941d8c3 | 922 | |
aecc5459 ILT |
923 | # GNU Make 3.63 has a different problem: it keeps tacking command line |
924 | # overrides onto the definition of $(MAKE). This variable setting | |
925 | # will remove them. | |
926 | MAKEOVERRIDES= | |
927 | ||
58bb1e76 ILT |
928 | ## This is ugly, but I don't want GNU make to put these variables in |
929 | ## the environment. Older makes will see this as a set of targets | |
930 | ## with no dependencies and no actions. | |
931 | unexport CHILLFLAGS CHILL_LIB CHILL_FOR_TARGET : | |
58bb1e76 | 932 | |
33cf356a SG |
933 | # This is the end of "Makefile.in". When built into "Makefile" |
934 | # by the configure script, two things are added below this point: | |
97e72c06 | 935 | # alldeps.mak -- definitions of all files that are used in |
33cf356a SG |
936 | # host- or target-dependent configurations |
937 | # depend -- what .o files depend on what .c and .h files, | |
938 | # for all configurations. |