xref: /dflybsd-src/gnu/usr.bin/gdb/libgdb/Makefile (revision 386330185812efaa34d42c2d6da187a203ed23b7)
18b6a428fSSimon Schubert.include "../Makefile.inc"
28b6a428fSSimon Schubert
3643b986cSSimon SchubertTARGET_ARCH?=	${MACHINE_ARCH}
4643b986cSSimon Schubert
58b6a428fSSimon SchubertLIB=		gdb
6a938cc15SJohn MarinoINTERNALLIB=	yes
78b6a428fSSimon Schubert
88b6a428fSSimon SchubertCONTRIBDIR=	${BASEDIR}/gdb
9f17ea84bSSimon Schubert.PATH:	${CONTRIBDIR} ${CONTRIBDIR}/cli ${CONTRIBDIR}/mi
10f17ea84bSSimon Schubert.PATH:	${CONTRIBDIR}/common ${CONTRIBDIR}/python ${CONTRIBDIR}/features
118b6a428fSSimon Schubert.PATH:	${CONTRIBDIR}/tui
128b6a428fSSimon Schubert
13f17ea84bSSimon SchubertVERSION!= cat ${CONTRIBDIR}/version.in
14f17ea84bSSimon Schubert
15a413fe45SJohn MarinoCFLAGS+= -I${.OBJDIR} -I${.CURDIR} -I${.CURDIR}/..
16a413fe45SJohn MarinoCFLAGS+= -I${BASEDIR}/include -I${BASEDIR}/bfd
1715b18792SSascha WildnerCFLAGS+= -I${CONTRIBDIR} -I${CONTRIBDIR}/common
18f17ea84bSSimon SchubertCFLAGS+= -I${BASEDIR}/libdecnumber
19f17ea84bSSimon SchubertCFLAGS+= -I${.CURDIR}/../libbfd -I${.OBJDIR}/../libbfd
208b6a428fSSimon SchubertCFLAGS+= -I${BASEDIR}
210c3d4888SSimon SchubertCFLAGS+= -DMACHINE_ARCH='"${MACHINE_ARCH}"'
22643b986cSSimon SchubertCFLAGS+= -DTARGET_ARCH='"${TARGET_ARCH}"'
23f17ea84bSSimon SchubertCFLAGS+= -DVERSION_STRING='"${VERSION}"'
24e9e05faaSJohn MarinoCFLAGS+= -DTUI				# enable "gdb -tui" (TUI MODE)
258b6a428fSSimon Schubert
26a938cc15SJohn MarinoSRCS+=	observer.h gdb_stdint.h
278b6a428fSSimon Schubert
280c3d4888SSimon Schubert# The order of these sources is important,
290c3d4888SSimon Schubert# because init.c below needs to obey a certain ordering
300c3d4888SSimon Schubert# of function calls.
318b6a428fSSimon Schubert
320c3d4888SSimon Schubert# COMMON_OBS
33f17ea84bSSimon SchubertSRCS+=	\
34f17ea84bSSimon Schubert	version.c \
350c3d4888SSimon Schubert	annotate.c \
36f17ea84bSSimon Schubert	addrmap.c \
37c33252afSJohn Marino	auto-load.c auxv.c \
38c33252afSJohn Marino	agent.c \
390c3d4888SSimon Schubert	bfd-target.c \
40c33252afSJohn Marino	blockframe.c breakpoint.c break-catch-sig.c \
41c33252afSJohn Marino	findvar.c regcache.c cleanups.c \
42c33252afSJohn Marino	charset.c continuations.c corelow.c disasm.c dummy-frame.c dfp.c \
430c3d4888SSimon Schubert	source.c value.c eval.c valops.c valarith.c valprint.c printcmd.c \
44a938cc15SJohn Marino	block.c symtab.c psymtab.c symfile.c symmisc.c linespec.c dictionary.c \
450c3d4888SSimon Schubert	infcall.c \
460c3d4888SSimon Schubert	infcmd.c infrun.c \
470c3d4888SSimon Schubert	expprint.c environ.c stack.c thread.c \
480c3d4888SSimon Schubert	exceptions.c \
49a938cc15SJohn Marino	filesystem.c \
500c3d4888SSimon Schubert	inf-child.c \
510c3d4888SSimon Schubert	interps.c \
52c33252afSJohn Marino	minidebug.c \
530c3d4888SSimon Schubert	main.c \
540c3d4888SSimon Schubert	macrotab.c macrocmd.c macroexp.c macroscope.c \
55a938cc15SJohn Marino	mi-common.c \
560c3d4888SSimon Schubert	event-loop.c event-top.c inf-loop.c completer.c \
57c33252afSJohn Marino	gdbarch.c arch-utils.c gdbtypes.c gdb_bfd.c gdb_obstack.c \
58c33252afSJohn Marino	osabi.c copying.c \
590c3d4888SSimon Schubert	memattr.c mem-break.c target.c parse.c language.c buildsym.c \
60f17ea84bSSimon Schubert	findcmd.c \
610c3d4888SSimon Schubert	std-regs.c \
620c3d4888SSimon Schubert	signals.c \
63f17ea84bSSimon Schubert	exec.c reverse.c \
64f17ea84bSSimon Schubert	bcache.c objfiles.c observer.c minsyms.c maint.c demangle.c \
650c3d4888SSimon Schubert	dbxread.c coffread.c coff-pe-read.c \
660c3d4888SSimon Schubert	dwarf2read.c mipsread.c stabsread.c corefile.c \
67e9e05faaSJohn Marino	dwarf2expr.c dwarf2loc.c dwarf2-frame.c dwarf2-frame-tailcall.c \
68a938cc15SJohn Marino	ada-lang.c c-lang.c d-lang.c f-lang.c objc-lang.c \
69c33252afSJohn Marino	ada-tasks.c ada-varobj.c \
700c3d4888SSimon Schubert	ui-out.c cli-out.c \
71c33252afSJohn Marino	varobj.c vec.c \
72c33252afSJohn Marino	go-lang.c go-valprint.c go-typeprint.c \
730c3d4888SSimon Schubert	jv-lang.c jv-valprint.c jv-typeprint.c \
740c3d3a6fSJohn Marino	m2-lang.c opencl-lang.c p-lang.c p-typeprint.c p-valprint.c \
750c3d4888SSimon Schubert	sentinel-frame.c \
760c3d4888SSimon Schubert	complaints.c typeprint.c \
770c3d4888SSimon Schubert	ada-typeprint.c c-typeprint.c f-typeprint.c m2-typeprint.c \
78a938cc15SJohn Marino	ada-valprint.c c-valprint.c cp-valprint.c d-valprint.c f-valprint.c \
79a938cc15SJohn Marino	m2-valprint.c \
800c3d4888SSimon Schubert	serial.c mdebugread.c top.c utils.c \
810c3d4888SSimon Schubert	ui-file.c \
820c3d4888SSimon Schubert	user-regs.c \
830c3d4888SSimon Schubert	frame.c frame-unwind.c doublest.c \
840c3d4888SSimon Schubert	frame-base.c \
85f17ea84bSSimon Schubert	inline-frame.c \
860c3d4888SSimon Schubert	gnu-v2-abi.c gnu-v3-abi.c cp-abi.c cp-support.c \
870c3d4888SSimon Schubert	cp-namespace.c \
880c3d4888SSimon Schubert	reggroups.c regset.c \
890c3d4888SSimon Schubert	trad-frame.c \
900c3d4888SSimon Schubert	tramp-frame.c \
91a938cc15SJohn Marino	solib.c solib-target.c \
92e9e05faaSJohn Marino	prologue-value.c memory-map.c memrange.c \
93e9e05faaSJohn Marino	xml-support.c xml-syscall.c xml-utils.c \
94f17ea84bSSimon Schubert	target-descriptions.c target-memory.c xml-tdesc.c xml-builtin.c \
95c33252afSJohn Marino	inferior.c osdata.c gdb_usleep.c record.c record-full.c gcore.c \
96c33252afSJohn Marino	gdb_vecs.c jit.c progspace.c skip.c probe.c \
97c33252afSJohn Marino	common-utils.c buffer.c ptid.c gdb-dlfcn.c common-agent.c \
98c33252afSJohn Marino	format.c registry.c btrace.c record-btrace.c
990c3d4888SSimon Schubert
1000c3d4888SSimon Schubert# TSOBS
101bc8873f3SSimon SchubertSRCS+=	inflow.c
1020c3d4888SSimon Schubert
1030c3d4888SSimon Schubert# SER_HARDWIRE
1040c3d4888SSimon SchubertSRCS+=	ser-base.c ser-unix.c ser-pipe.c ser-tcp.c
1050c3d4888SSimon Schubert
1060c3d4888SSimon Schubert# REMOTE_OBS
107c33252afSJohn MarinoSRCS+=	remote.c dcache.c tracepoint.c ax-general.c ax-gdb.c \
108c33252afSJohn Marino	remote-fileio.c remote-notif.c
1090c3d4888SSimon Schubert
1100c3d4888SSimon Schubert# SUBDIR_CLI_OBS
1110c3d4888SSimon SchubertSRCS+=  cli-dump.c \
112f17ea84bSSimon Schubert	cli-decode.c cli-script.c cli-cmds.c cli-setshow.c \
1130c3d4888SSimon Schubert	cli-logging.c \
1140c3d3a6fSJohn Marino	cli-interp.c cli-utils.c
1150c3d4888SSimon Schubert
1160c3d4888SSimon Schubert# SUBDIR_MI_OBS
1170c3d4888SSimon SchubertSRCS+=	mi-out.c mi-console.c \
118c33252afSJohn Marino	mi-cmds.c mi-cmd-catch.c mi-cmd-env.c \
119c33252afSJohn Marino	mi-cmd-var.c mi-cmd-break.c mi-cmd-stack.c \
120c33252afSJohn Marino	mi-cmd-file.c mi-cmd-disas.c mi-symbol-cmds.c \
121c33252afSJohn Marino	mi-cmd-target.c mi-cmd-info.c mi-interp.c \
122e9e05faaSJohn Marino	mi-main.c mi-parse.c mi-getopt.c
1230c3d4888SSimon Schubert
124a938cc15SJohn Marino# PYTHON OBJS
125a938cc15SJohn MarinoSRCS+=	python.c \
126a938cc15SJohn Marino	py-auto-load.c \
127a938cc15SJohn Marino	py-value.c \
128a938cc15SJohn Marino	py-prettyprint.c
129a938cc15SJohn Marino
1300c3d4888SSimon Schubert# CONFIG_OBS
131c33252afSJohn MarinoSRCS+=	elfread.c posix-hdep.c stap-probe.c
1320c3d4888SSimon Schubert
1330c3d4888SSimon Schubert# SUBDIR_TUI_OBS
1340c3d4888SSimon SchubertSRCS+=	tui-command.c \
1350c3d4888SSimon Schubert	tui-data.c \
1360c3d4888SSimon Schubert	tui-disasm.c \
137a938cc15SJohn Marino	tui-file.c \
1380c3d4888SSimon Schubert	tui-hooks.c \
1390c3d4888SSimon Schubert	tui-interp.c \
1400c3d4888SSimon Schubert	tui-io.c \
1410c3d4888SSimon Schubert	tui-layout.c \
1420c3d4888SSimon Schubert	tui-out.c \
1430c3d4888SSimon Schubert	tui-regs.c \
1440c3d4888SSimon Schubert	tui-source.c \
1450c3d4888SSimon Schubert	tui-stack.c \
1460c3d4888SSimon Schubert	tui-win.c \
1470c3d4888SSimon Schubert	tui-windata.c \
1480c3d4888SSimon Schubert	tui-wingeneral.c \
149c33252afSJohn Marino	tui-winsource.c \
150c33252afSJohn Marino	tui.c
1510c3d4888SSimon Schubert
1520c3d4888SSimon Schubert# YYOBJ
1530c3d4888SSimon SchubertSRCS+=	c-exp.y \
1540c3d4888SSimon Schubert	cp-name-parser.y \
1550c3d4888SSimon Schubert	ada-exp.y \
1560c3d4888SSimon Schubert	jv-exp.y \
157a938cc15SJohn Marino	f-exp.y \
158c33252afSJohn Marino	go-exp.y \
159a938cc15SJohn Marino	m2-exp.y \
160a938cc15SJohn Marino	p-exp.y
1610c3d4888SSimon Schubert
1620c3d4888SSimon SchubertSRCS+=	init.c
1630c3d4888SSimon Schubert
164e9e05faaSJohn MarinoXMLFILES= \
165e9e05faaSJohn Marino	gdb-target.dtd \
166e9e05faaSJohn Marino	xinclude.dtd \
167e9e05faaSJohn Marino	library-list.dtd \
168e9e05faaSJohn Marino	library-list-svr4.dtd \
169e9e05faaSJohn Marino	osdata.dtd \
170e9e05faaSJohn Marino	threads.dtd \
171c33252afSJohn Marino	traceframe-info.dtd \
172c33252afSJohn Marino	btrace.dtd
1738b6a428fSSimon Schubert
1745cef369fSJohn MarinoDPADD=	${LIBKVM} ${LIBNCURSES} ${LIBM}
1758b6a428fSSimon SchubertDPADD+=	../libbfd/libbfd.a ../libopcodes/libopcodes.a ../libiberty/libiberty.a
1765cef369fSJohn MarinoLDADD=	-lprivate_ncurses -lm
1778b6a428fSSimon SchubertLDADD+=	-L../libbfd -lbfd -L../libopcodes -lopcodes -L../libiberty -liberty
178cfe0a42bSJohn Marino
179cfe0a42bSJohn MarinoCFLAGS+=	-I${_SHLIBDIRPREFIX}/usr/include/priv/ncurses
18038b720cdSzrjLDFLAGS+=	${PRIVATELIB_LDFLAGS}
1818b6a428fSSimon Schubert
182643b986cSSimon Schubert.include "Makefile.${TARGET_ARCH}"
1838b6a428fSSimon Schubert
1848b6a428fSSimon Schubertinit.c: ${SRCS:Ninit.c} Makefile
185c33252afSJohn Marino	echo '/* Do not modify this file.  */' > ${.TARGET}
186c33252afSJohn Marino	echo '/* It is created automatically by the Makefile.  */' >> ${.TARGET}
187c33252afSJohn Marino	echo '#include "defs.h"      /* For initialize_file_ftype.  */' >> ${.TARGET}
188c33252afSJohn Marino	echo 'extern void initialize_all_files(void);' >> ${.TARGET}
1898b6a428fSSimon Schubert	sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/extern initialize_file_ftype _initialize_\1;/p' ${.ALLSRC:M*.c} >> ${.TARGET}
1908b6a428fSSimon Schubert	echo 'void' >> ${.TARGET}
1918b6a428fSSimon Schubert	echo 'initialize_all_files (void)' >> ${.TARGET}
1928b6a428fSSimon Schubert	echo '{' >> ${.TARGET}
1938b6a428fSSimon Schubert	sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/  _initialize_\1 ();/p' ${.ALLSRC:M*.c} >> ${.TARGET}
1948b6a428fSSimon Schubert	echo '}' >> ${.TARGET}
1958b6a428fSSimon Schubert
196f17ea84bSSimon Schubertxml-builtin.c: feature_to_c.sh ${XMLFILES}
197b2c75cc8SSascha Wildner	rm -f ${.TARGET}
198f17ea84bSSimon Schubert	sh ${CONTRIBDIR}/features/feature_to_c.sh ${.TARGET} ${.ALLSRC:M*.dtd}
199f17ea84bSSimon Schubert
200a413fe45SJohn Marinocommon-agent.c:	${CONTRIBDIR}/common/agent.c
201a413fe45SJohn Marino	cp ${.ALLSRC} ${.TARGET}
202f17ea84bSSimon Schubert
2038b6a428fSSimon Schubert# observer.inc can't be included in SRCS, it would duplicate the entry in OBJS
2048b6a428fSSimon Schubertobserver.h: observer.sh observer.inc doc/observer.texi
2058b6a428fSSimon Schubert	sh ${CONTRIBDIR}/observer.sh h ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
206a413fe45SJohn Marino
2078b6a428fSSimon Schubertobserver.inc: observer.sh doc/observer.texi
2088b6a428fSSimon Schubert	sh ${CONTRIBDIR}/observer.sh inc ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
2098b6a428fSSimon Schubert
2100c3d4888SSimon Schubertgdb_stdint.h:
211*38633018Szrj	echo "#include <stdint.h>" > ${.TARGET}
2120c3d4888SSimon Schubert
213a413fe45SJohn MarinoCLEANFILES+=	observer.h observer.inc gdb_stdint.h \
214a413fe45SJohn Marino		init.c xml-builtin.c common-agent.c
215f17ea84bSSimon Schubert
2168b6a428fSSimon Schubert.include <bsd.lib.mk>
217