1 # Copyright (C) 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998,
2 # 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
3 # Free Software Foundation, Inc.
5 # This file is part of GDB.
7 # This program is free software; you can redistribute it and/or modify
8 # it under the terms of the GNU General Public License as published by
9 # the Free Software Foundation; either version 2 of the License, or
10 # (at your option) any later version.
12 # This program is distributed in the hope that it will be useful,
13 # but WITHOUT ANY WARRANTY; without even the implied warranty of
14 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 # GNU General Public License for more details.
17 # You should have received a copy of the GNU General Public License
18 # along with this program; if not, write to the Free Software
19 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22 exec_prefix = @
exec_prefix@
24 host_alias
= @host_alias@
25 target_alias
= @target_alias@
26 program_transform_name
= @program_transform_name@
29 tooldir
= $(libdir)/$(target_alias
)
33 man1dir = $(mandir)/man1
34 man2dir = $(mandir)/man2
35 man3dir = $(mandir)/man3
36 man4dir = $(mandir)/man4
37 man5dir = $(mandir)/man5
38 man6dir = $(mandir)/man6
39 man7dir = $(mandir)/man7
40 man8dir = $(mandir)/man8
41 man9dir = $(mandir)/man9
43 htmldir
= $(prefix)/html
44 includedir = @
includedir@
50 INSTALL_PROGRAM
= @INSTALL_PROGRAM@
51 INSTALL_DATA
= @INSTALL_DATA@
55 # Directory containing source files. Don't clean up the spacing,
56 # this exact string is matched for by the "configure" script.
60 # It is also possible that you will need to add -I/usr/include/sys to the
61 # CFLAGS section if your system doesn't have fcntl.h in /usr/include (which
62 # is where it should be according to Posix).
64 # Set this up with gcc if you have gnu ld and the loader will print out
65 # line numbers for undefinded refs.
69 # Where is the "include" directory? Traditionally ../include or ./include
70 INCLUDE_DIR
= ${srcdir}/..
/..
/include
71 INCLUDE_DEP
= $$(INCLUDE_DIR
)
73 # All the includes used for CFLAGS and for lint.
74 # -I. for config files.
75 # -I${srcdir} for our headers.
76 # -I$(srcdir)/../regformats for regdef.h.
77 INCLUDE_CFLAGS
= -I.
-I
${srcdir} -I
$(srcdir)/..
/regformats
-I
$(INCLUDE_DIR
)
79 # M{H,T}_CFLAGS, if defined, has host- and target-dependent CFLAGS
80 # from the config/ directory.
81 GLOBAL_CFLAGS
= ${MT_CFLAGS} ${MH_CFLAGS}
86 # CFLAGS is specifically reserved for setting from the command line
87 # when running make. I.E. "make CFLAGS=-Wmissing-prototypes".
90 # INTERNAL_CFLAGS is the aggregate of all other *CFLAGS macros.
91 INTERNAL_CFLAGS
= $(WARN_CFLAGS
) ${CFLAGS} ${GLOBAL_CFLAGS} \
92 ${PROFILE_CFLAGS} ${INCLUDE_CFLAGS}
94 # LDFLAGS is specifically reserved for setting from the command line
97 INTERNAL_LDFLAGS
= $(LDFLAGS
) @RDYNAMIC@
99 # Perhaps should come from parent Makefile
100 VERSION
= gdbserver-4.12
.3
106 # All source files that go into linking GDB remote server.
108 SFILES
= $(srcdir)/gdbreplay.c
$(srcdir)/inferiors.c \
109 $(srcdir)/mem-break.c
$(srcdir)/proc-service.c
$(srcdir)/regcache.c \
110 $(srcdir)/remote-utils.c
$(srcdir)/server.c
$(srcdir)/target.c \
111 $(srcdir)/thread-db.c
$(srcdir)/utils.c \
112 $(srcdir)/linux-arm-low.c
$(srcdir)/linux-cris-low.c \
113 $(srcdir)/linux-crisv32-low.c
$(srcdir)/linux-i386-low.c \
114 $(srcdir)/i387-fp.c \
115 $(srcdir)/linux-ia64-low.c
$(srcdir)/linux-low.c \
116 $(srcdir)/linux-m32r-low.c \
117 $(srcdir)/linux-m68k-low.c
$(srcdir)/linux-mips-low.c \
118 $(srcdir)/linux-ppc-low.c \
119 $(srcdir)/linux-s390-low.c \
120 $(srcdir)/linux-sh-low.c
$(srcdir)/linux-x86-64-low.c \
121 $(srcdir)/linux-xtensa-low.c \
122 $(srcdir)/win32-arm-low.c
$(srcdir)/win32-i386-low.c \
123 $(srcdir)/win32-low.c
$(srcdir)/wincecompat.c \
124 $(srcdir)/hostio.c
$(srcdir)/hostio-errno.c
126 DEPFILES
= @GDBSERVER_DEPFILES@
131 TAGFILES
= $(SOURCES
) ${HFILES} ${ALLPARAM} ${POSSLIBS}
133 OBS
= inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
135 mem-break.o hostio.o \
137 $(DEPFILES
) $(LIBOBJS
)
138 GDBREPLAY_OBS
= gdbreplay.o version.o
139 GDBSERVER_LIBS
= @GDBSERVER_LIBS@
142 # XML files to compile in to gdbserver, if any.
143 XML_DIR
= $(srcdir)/..
/features
144 XML_FILES
= @srv_xmlfiles@
145 XML_BUILTIN
= @srv_xmlbuiltin@
147 # Prevent Sun make from putting in the machine type. Setting
148 # TARGET_ARCH to nothing works for SunOS 3, 4.0, but not for 4.1.
150 ${CC} -c
${INTERNAL_CFLAGS} $<
152 all: gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
)
154 # Traditionally "install" depends on "all". But it may be useful
155 # not to; for example, if the user has made some trivial change to a
156 # source file and doesn't care about rebuilding or just wants to save the
157 # time it takes for make to check that all is up to date.
158 # install-only is intended to address that need.
159 install: all install-only
161 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
162 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
163 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(DESTDIR
)$(bindir); \
164 $(INSTALL_PROGRAM
) gdbserver
$(EXEEXT
) $(DESTDIR
)$(bindir)/$$n$(EXEEXT
); \
165 $(SHELL
) $(srcdir)/..
/..
/mkinstalldirs
$(DESTDIR
)$(man1dir); \
166 $(INSTALL_DATA
) $(srcdir)/gdbserver
.1 $(DESTDIR
)$(man1dir)/$$n.1
169 n
=`echo gdbserver | sed '$(program_transform_name)'`; \
170 if
[ x
$$n = x
]; then n
=gdbserver
; else true
; fi
; \
171 rm -f
$(bindir)/$$n$(EXEEXT
) $(DESTDIR
)$(man1dir)/$$n.1
182 gdbserver
$(EXEEXT
): $(OBS
) ${ADD_DEPS} ${CDEPS}
183 rm -f gdbserver
$(EXEEXT
)
184 ${CC-LD
} $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) -o gdbserver
$(EXEEXT
) $(OBS
) \
185 $(GDBSERVER_LIBS
) $(XM_CLIBS
)
187 gdbreplay
$(EXEEXT
): $(GDBREPLAY_OBS
)
188 rm -f gdbreplay
$(EXEEXT
)
189 ${CC-LD
} $(INTERNAL_CFLAGS
) $(INTERNAL_LDFLAGS
) -o gdbreplay
$(EXEEXT
) $(GDBREPLAY_OBS
) \
192 # Put the proper machine-specific files first, so M-. on a machine
193 # specific routine gets the one for the correct machine.
194 # The xyzzy stuff below deals with empty DEPFILES
196 etags
`find ${srcdir}/../config -name $(DEPRECATED_TM_FILE) -print` \
197 `find ${srcdir}/../config -name ${XM_FILE} -print` \
198 `find ${srcdir}/../config -name ${NAT_FILE} -print` \
199 `for i in yzzy ${DEPFILES}; do \
200 if [ x$$i != xyzzy ]; then \
201 echo ${srcdir}/$$i | sed -e 's/\.o$$/\.c/' ; \
208 rm -f
*.o
${ADD_FILES} *~
210 rm -f gdbserver
$(EXEEXT
) gdbreplay
$(EXEEXT
) core make.log
211 rm -f reg-arm.c reg-i386.c reg-ia64.c reg-m32r.c reg-m68k.c
212 rm -f reg-sh.c reg-spu.c reg-x86-64.c reg-i386-linux.c
213 rm -f reg-cris.c reg-crisv32.c reg-x86-64-linux.c reg-xtensa.c
214 rm -f arm-with-iwmmxt.c mips-linux.c mips64-linux.c
215 rm -f powerpc-32l.c powerpc-64l.c powerpc-e500l.c
216 rm -f powerpc-altivec32l.c powerpc-vsx32l.c powerpc-altivec64l.c
217 rm -f powerpc-vsx64l.c xml-builtin.c stamp-xml
219 maintainer-clean
realclean distclean: clean
220 rm -f nm.h tm.h xm.h config.status config.h stamp-h config.log
223 config.h
: stamp-h
; @true
224 stamp-h
: config.in config.status
225 CONFIG_FILES
="" CONFIG_HEADERS
=config.h
:config.in
$(SHELL
) .
/config.status
227 Makefile
: Makefile.in config.status
228 CONFIG_HEADERS
="" $(SHELL
) .
/config.status
230 config.status
: configure configure.srv
231 $(SHELL
) .
/config.status
--recheck
235 version.c
: Makefile
$(srcdir)/..
/version.in
236 rm -f version.c-tmp version.c
237 echo
'#include "server.h"' >> version.c-tmp
238 echo
'const char version[] = "'"`sed q ${srcdir}/../version.in`"'";' >> version.c-tmp
239 echo
'const char host_name[] = "$(host_alias)";' >> version.c-tmp
240 mv version.c-tmp version.c
241 version.o
: version.c
$(server_h
)
243 xml-builtin.c
: stamp-xml
; @true
244 stamp-xml
: $(XML_DIR
)/feature_to_c.sh Makefile
$(XML_FILES
)
245 rm -f xml-builtin.tmp
246 $(SHELL
) $(XML_DIR
)/feature_to_c.sh xml-builtin.tmp
$(XML_FILES
)
247 $(SHELL
) $(srcdir)/..
/..
/move-if-change xml-builtin.tmp xml-builtin.c
248 echo stamp
> stamp-xml
250 .PRECIOUS
: xml-builtin.c
252 # GNU Make has an annoying habit of putting *all* the Makefile variables
253 # into the environment, unless you include this target as a circumvention.
254 # Rumor is that this will be fixed (and this target can be removed)
258 # GNU Make 3.63 has a different problem: it keeps tacking command line
259 # overrides onto the definition of $(MAKE). This variable setting
263 gdb_proc_service_h
= $(srcdir)/gdb_proc_service.h
264 regdat_sh
= $(srcdir)/..
/regformats
/regdat.sh
265 regdef_h
= $(srcdir)/..
/regformats
/regdef.h
266 regcache_h
= $(srcdir)/regcache.h
267 server_h
= $(srcdir)/server.h
$(regcache_h
) config.h
$(srcdir)/target.h \
268 $(srcdir)/mem-break.h
270 hostio.o
: hostio.c
$(server_h
)
271 hostio-errno.o
: hostio-errno.c
$(server_h
)
272 inferiors.o
: inferiors.c
$(server_h
)
273 mem-break.o
: mem-break.c
$(server_h
)
274 proc-service.o
: proc-service.c
$(server_h
) $(gdb_proc_service_h
)
275 regcache.o
: regcache.c
$(server_h
) $(regdef_h
)
276 remote-utils.o
: remote-utils.c terminal.h
$(server_h
)
277 server.o
: server.c
$(server_h
)
278 target.o
: target.c
$(server_h
)
279 thread-db.o
: thread-db.c
$(server_h
) $(gdb_proc_service_h
)
280 utils.o
: utils.c
$(server_h
)
281 gdbreplay.o
: gdbreplay.c config.h
283 signals.o
: ..
/signals
/signals.c
$(server_h
)
284 $(CC
) -c
$(CPPFLAGS
) $(INTERNAL_CFLAGS
) $< -DGDBSERVER
286 memmem.o
: ..
/gnulib
/memmem.c
287 $(CC
) -o memmem.o
-c
$(CPPFLAGS
) $(INTERNAL_CFLAGS
) $<
289 i387-fp.o
: i387-fp.c
$(server_h
)
291 linux_low_h
= $(srcdir)/linux-low.h
293 linux-low.o
: linux-low.c
$(linux_low_h
) $(server_h
)
294 $(CC
) -c
$(CPPFLAGS
) $(INTERNAL_CFLAGS
) $< @USE_THREAD_DB@
296 linux-arm-low.o
: linux-arm-low.c
$(linux_low_h
) $(server_h
) \
297 $(gdb_proc_service_h
)
298 linux-cris-low.o
: linux-cris-low.c
$(linux_low_h
) $(server_h
)
299 linux-crisv32-low.o
: linux-crisv32-low.c
$(linux_low_h
) $(server_h
)
300 linux-i386-low.o
: linux-i386-low.c
$(linux_low_h
) $(server_h
) \
301 $(gdb_proc_service_h
)
302 linux-ia64-low.o
: linux-ia64-low.c
$(linux_low_h
) $(server_h
)
303 linux-m32r-low.o
: linux-m32r-low.c
$(linux_low_h
) $(server_h
)
304 linux-mips-low.o
: linux-mips-low.c
$(linux_low_h
) $(server_h
) \
305 $(gdb_proc_service_h
)
306 linux-ppc-low.o
: linux-ppc-low.c
$(linux_low_h
) $(server_h
)
307 linux-s390-low.o
: linux-s390-low.c
$(linux_low_h
) $(server_h
)
308 linux-sh-low.o
: linux-sh-low.c
$(linux_low_h
) $(server_h
)
309 linux-x86-64-low.o
: linux-x86-64-low.c
$(linux_low_h
) $(server_h
) \
310 $(gdb_proc_service_h
)
311 linux-xtensa-low.o
: linux-xtensa-low.c xtensa-xtregs.c
$(linux_low_h
) $(server_h
)
313 win32_low_h
= $(srcdir)/win32-low.h
315 win32-low.o
: win32-low.c
$(win32_low_h
) $(server_h
) $(regdef_h
) $(regcache_h
)
317 win32-arm-low.o
: win32-arm-low.c
$(win32_low_h
) $(server_h
)
318 win32-i386-low.o
: win32-i386-low.c
$(win32_low_h
) $(server_h
)
320 spu-low.o
: spu-low.c
$(server_h
)
322 reg-arm.o
: reg-arm.c
$(regdef_h
)
323 reg-arm.c
: $(srcdir)/..
/regformats
/reg-arm.dat
$(regdat_sh
)
324 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-arm.dat reg-arm.c
325 arm-with-iwmmxt.o
: arm-with-iwmmxt.c
$(regdef_h
)
326 arm-with-iwmmxt.c
: $(srcdir)/..
/regformats
/arm-with-iwmmxt.dat
$(regdat_sh
)
327 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/arm-with-iwmmxt.dat arm-with-iwmmxt.c
328 reg-cris.o
: reg-cris.c
$(regdef_h
)
329 reg-cris.c
: $(srcdir)/..
/regformats
/reg-cris.dat
$(regdat_sh
)
330 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-cris.dat reg-cris.c
331 reg-crisv32.o
: reg-crisv32.c
$(regdef_h
)
332 reg-crisv32.c
: $(srcdir)/..
/regformats
/reg-crisv32.dat
$(regdat_sh
)
333 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-crisv32.dat reg-crisv32.c
334 reg-i386.o
: reg-i386.c
$(regdef_h
)
335 reg-i386.c
: $(srcdir)/..
/regformats
/reg-i386.dat
$(regdat_sh
)
336 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-i386.dat reg-i386.c
337 reg-i386-linux.o
: reg-i386-linux.c
$(regdef_h
)
338 reg-i386-linux.c
: $(srcdir)/..
/regformats
/reg-i386-linux.dat
$(regdat_sh
)
339 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-i386-linux.dat reg-i386-linux.c
340 reg-ia64.o
: reg-ia64.c
$(regdef_h
)
341 reg-ia64.c
: $(srcdir)/..
/regformats
/reg-ia64.dat
$(regdat_sh
)
342 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-ia64.dat reg-ia64.c
343 reg-m32r.o
: reg-m32r.c
$(regdef_h
)
344 reg-m32r.c
: $(srcdir)/..
/regformats
/reg-m32r.dat
$(regdat_sh
)
345 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-m32r.dat reg-m32r.c
346 reg-m68k.o
: reg-m68k.c
$(regdef_h
)
347 reg-m68k.c
: $(srcdir)/..
/regformats
/reg-m68k.dat
$(regdat_sh
)
348 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-m68k.dat reg-m68k.c
349 mips-linux.o
: mips-linux.c
$(regdef_h
)
350 mips-linux.c
: $(srcdir)/..
/regformats
/mips-linux.dat
$(regdat_sh
)
351 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/mips-linux.dat mips-linux.c
352 mips64-linux.o
: mips64-linux.c
$(regdef_h
)
353 mips64-linux.c
: $(srcdir)/..
/regformats
/mips64-linux.dat
$(regdat_sh
)
354 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/mips64-linux.dat mips64-linux.c
355 powerpc-32l.o
: powerpc-32l.c
$(regdef_h
)
356 powerpc-32l.c
: $(srcdir)/..
/regformats
/rs6000
/powerpc-32l.dat
$(regdat_sh
)
357 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/rs6000
/powerpc-32l.dat powerpc-32l.c
358 powerpc-altivec32l.o
: powerpc-altivec32l.c
$(regdef_h
)
359 powerpc-altivec32l.c
: $(srcdir)/..
/regformats
/rs6000
/powerpc-altivec32l.dat
$(regdat_sh
)
360 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/rs6000
/powerpc-altivec32l.dat powerpc-altivec32l.c
361 powerpc-vsx32l.o
: powerpc-vsx32l.c
$(regdef_h
)
362 powerpc-vsx32l.c
: $(srcdir)/..
/regformats
/rs6000
/powerpc-vsx32l.dat
$(regdat_sh
)
363 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/rs6000
/powerpc-vsx32l.dat powerpc-vsx32l.c
364 powerpc-e500l.o
: powerpc-e500l.c
$(regdef_h
)
365 powerpc-e500l.c
: $(srcdir)/..
/regformats
/rs6000
/powerpc-e500l.dat
$(regdat_sh
)
366 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/rs6000
/powerpc-e500l.dat powerpc-e500l.c
367 powerpc-64l.o
: powerpc-64l.c
$(regdef_h
)
368 powerpc-64l.c
: $(srcdir)/..
/regformats
/rs6000
/powerpc-64l.dat
$(regdat_sh
)
369 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/rs6000
/powerpc-64l.dat powerpc-64l.c
370 powerpc-altivec64l.o
: powerpc-altivec64l.c
$(regdef_h
)
371 powerpc-altivec64l.c
: $(srcdir)/..
/regformats
/rs6000
/powerpc-altivec64l.dat
$(regdat_sh
)
372 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/rs6000
/powerpc-altivec64l.dat powerpc-altivec64l.c
373 powerpc-vsx64l.o
: powerpc-vsx64l.c
$(regdef_h
)
374 powerpc-vsx64l.c
: $(srcdir)/..
/regformats
/rs6000
/powerpc-vsx64l.dat
$(regdat_sh
)
375 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/rs6000
/powerpc-vsx64l.dat powerpc-vsx64l.c
376 reg-s390.o
: reg-s390.c
$(regdef_h
)
377 reg-s390.c
: $(srcdir)/..
/regformats
/reg-s390.dat
$(regdat_sh
)
378 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-s390.dat reg-s390.c
379 reg-s390x.o
: reg-s390x.c
$(regdef_h
)
380 reg-s390x.c
: $(srcdir)/..
/regformats
/reg-s390x.dat
$(regdat_sh
)
381 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-s390x.dat reg-s390x.c
382 reg-sh.o
: reg-sh.c
$(regdef_h
)
383 reg-sh.c
: $(srcdir)/..
/regformats
/reg-sh.dat
$(regdat_sh
)
384 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-sh.dat reg-sh.c
385 reg-spu.o
: reg-spu.c
$(regdef_h
)
386 reg-spu.c
: $(srcdir)/..
/regformats
/reg-spu.dat
$(regdat_sh
)
387 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-spu.dat reg-spu.c
388 reg-x86-64.o
: reg-x86-64.c
$(regdef_h
)
389 reg-x86-64.c
: $(srcdir)/..
/regformats
/reg-x86-64.dat
$(regdat_sh
)
390 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-x86-64.dat reg-x86-64.c
391 reg-x86-64-linux.o
: reg-x86-64-linux.c
$(regdef_h
)
392 reg-x86-64-linux.c
: $(srcdir)/..
/regformats
/reg-x86-64-linux.dat
$(regdat_sh
)
393 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-x86-64-linux.dat reg-x86-64-linux.c
394 reg-xtensa.o
: reg-xtensa.c
$(regdef_h
)
395 reg-xtensa.c
: $(srcdir)/..
/regformats
/reg-xtensa.dat
$(regdat_sh
)
396 $(SHELL
) $(regdat_sh
) $(srcdir)/..
/regformats
/reg-xtensa.dat reg-xtensa.c
397 # This is the end of "Makefile.in".