gdb(1): Fix the dreaded "xml-builtin.c already exists" quickworld error.
[dragonfly.git] / gnu / usr.bin / gdb / libgdb / Makefile
CommitLineData
8b6a428f
SS
1.include "../Makefile.inc"
2
643b986c
SS
3TARGET_ARCH?= ${MACHINE_ARCH}
4
a938cc15
JM
5LIB= gdb
6INTERNALLIB= yes
8b6a428f 7
8b6a428f 8CONTRIBDIR= ${BASEDIR}/gdb
f17ea84b
SS
9.PATH: ${CONTRIBDIR} ${CONTRIBDIR}/cli ${CONTRIBDIR}/mi
10.PATH: ${CONTRIBDIR}/common ${CONTRIBDIR}/python ${CONTRIBDIR}/features
8b6a428f
SS
11.PATH: ${CONTRIBDIR}/tui
12
f17ea84b
SS
13VERSION!= cat ${CONTRIBDIR}/version.in
14
8b6a428f 15CFLAGS+= -I${.OBJDIR} -I${.CURDIR} -I${BASEDIR}/include -I${BASEDIR}/bfd
f17ea84b
SS
16CFLAGS+= -I${CONTRIBDIR} -I${CONTRIBDIR}/config -I${CONTRIBDIR}/common
17CFLAGS+= -I${BASEDIR}/libdecnumber
18CFLAGS+= -I${.CURDIR}/../libbfd -I${.OBJDIR}/../libbfd
8b6a428f 19CFLAGS+= -I${BASEDIR}
f17ea84b
SS
20CFLAGS+= -DTARGET_SYSTEM_ROOT='"/"' -DTARGET_SYSTEM_ROOT_RELOCATABLE=0
21CFLAGS+= -DBINDIR='"/usr/bin"'
0c3d4888 22CFLAGS+= -DMACHINE_ARCH='"${MACHINE_ARCH}"'
643b986c 23CFLAGS+= -DTARGET_ARCH='"${TARGET_ARCH}"'
f17ea84b 24CFLAGS+= -DVERSION_STRING='"${VERSION}"'
0c3d4888 25
a938cc15 26SRCS+= observer.h gdb_stdint.h
0c3d4888
SS
27
28# The order of these sources is important,
29# because init.c below needs to obey a certain ordering
30# of function calls.
31
32# COMMON_OBS
f17ea84b
SS
33SRCS+= \
34 version.c \
0c3d4888 35 annotate.c \
f17ea84b 36 addrmap.c \
0c3d4888
SS
37 auxv.c \
38 bfd-target.c \
39 blockframe.c breakpoint.c findvar.c regcache.c \
f17ea84b 40 charset.c disasm.c dummy-frame.c dfp.c \
0c3d4888 41 source.c value.c eval.c valops.c valarith.c valprint.c printcmd.c \
a938cc15 42 block.c symtab.c psymtab.c symfile.c symmisc.c linespec.c dictionary.c \
0c3d4888
SS
43 infcall.c \
44 infcmd.c infrun.c \
45 expprint.c environ.c stack.c thread.c \
46 exceptions.c \
a938cc15 47 filesystem.c \
0c3d4888
SS
48 inf-child.c \
49 interps.c \
50 main.c \
51 macrotab.c macrocmd.c macroexp.c macroscope.c \
a938cc15 52 mi-common.c \
0c3d4888
SS
53 event-loop.c event-top.c inf-loop.c completer.c \
54 gdbarch.c arch-utils.c gdbtypes.c osabi.c copying.c \
55 memattr.c mem-break.c target.c parse.c language.c buildsym.c \
f17ea84b 56 findcmd.c \
0c3d4888
SS
57 std-regs.c \
58 signals.c \
f17ea84b
SS
59 exec.c reverse.c \
60 bcache.c objfiles.c observer.c minsyms.c maint.c demangle.c \
0c3d4888
SS
61 dbxread.c coffread.c coff-pe-read.c \
62 dwarf2read.c mipsread.c stabsread.c corefile.c \
63 dwarf2expr.c dwarf2loc.c dwarf2-frame.c \
a938cc15 64 ada-lang.c c-lang.c d-lang.c f-lang.c objc-lang.c \
f17ea84b 65 ada-tasks.c \
0c3d4888
SS
66 ui-out.c cli-out.c \
67 varobj.c vec.c wrapper.c \
68 jv-lang.c jv-valprint.c jv-typeprint.c \
69 m2-lang.c p-lang.c p-typeprint.c p-valprint.c \
70 scm-exp.c scm-lang.c scm-valprint.c \
71 sentinel-frame.c \
72 complaints.c typeprint.c \
73 ada-typeprint.c c-typeprint.c f-typeprint.c m2-typeprint.c \
a938cc15
JM
74 ada-valprint.c c-valprint.c cp-valprint.c d-valprint.c f-valprint.c \
75 m2-valprint.c \
0c3d4888
SS
76 serial.c mdebugread.c top.c utils.c \
77 ui-file.c \
78 user-regs.c \
79 frame.c frame-unwind.c doublest.c \
80 frame-base.c \
f17ea84b 81 inline-frame.c \
0c3d4888
SS
82 gnu-v2-abi.c gnu-v3-abi.c cp-abi.c cp-support.c \
83 cp-namespace.c \
84 reggroups.c regset.c \
85 trad-frame.c \
86 tramp-frame.c \
a938cc15 87 solib.c solib-target.c \
f17ea84b
SS
88 prologue-value.c memory-map.c xml-support.c xml-syscall.c \
89 target-descriptions.c target-memory.c xml-tdesc.c xml-builtin.c \
a938cc15
JM
90 inferior.c osdata.c gdb_usleep.c record.c gcore.c \
91 jit.c progspace.c
0c3d4888
SS
92
93# TSOBS
bc8873f3 94SRCS+= inflow.c
0c3d4888
SS
95
96# SER_HARDWIRE
97SRCS+= ser-base.c ser-unix.c ser-pipe.c ser-tcp.c
98
0c3d4888
SS
99# REMOTE_OBS
100SRCS+= remote.c dcache.c tracepoint.c ax-general.c ax-gdb.c remote-fileio.c
101
102# SUBDIR_CLI_OBS
103SRCS+= cli-dump.c \
f17ea84b 104 cli-decode.c cli-script.c cli-cmds.c cli-setshow.c \
0c3d4888
SS
105 cli-logging.c \
106 cli-interp.c
107
108# SUBDIR_MI_OBS
109SRCS+= mi-out.c mi-console.c \
110 mi-cmds.c mi-cmd-env.c mi-cmd-var.c mi-cmd-break.c mi-cmd-stack.c \
f17ea84b 111 mi-cmd-file.c mi-cmd-disas.c mi-symbol-cmds.c mi-cmd-target.c \
0c3d4888
SS
112 mi-interp.c \
113 mi-main.c mi-parse.c mi-getopt.c mi-common.c
114
a938cc15
JM
115# PYTHON OBJS
116SRCS+= python.c \
117 py-auto-load.c \
118 py-value.c \
119 py-prettyprint.c
120
0c3d4888 121# CONFIG_OBS
a938cc15 122SRCS+= elfread.c posix-hdep.c
0c3d4888
SS
123
124# SUBDIR_TUI_OBS
125SRCS+= tui-command.c \
126 tui-data.c \
127 tui-disasm.c \
a938cc15
JM
128 tui-file.c \
129 tui.c \
0c3d4888
SS
130 tui-hooks.c \
131 tui-interp.c \
132 tui-io.c \
133 tui-layout.c \
134 tui-out.c \
135 tui-regs.c \
136 tui-source.c \
137 tui-stack.c \
138 tui-win.c \
139 tui-windata.c \
140 tui-wingeneral.c \
141 tui-winsource.c
142
143# YYOBJ
144SRCS+= c-exp.y \
145 cp-name-parser.y \
146 objc-exp.y \
147 ada-exp.y \
148 jv-exp.y \
a938cc15
JM
149 f-exp.y \
150 m2-exp.y \
151 p-exp.y
0c3d4888
SS
152
153SRCS+= init.c
8b6a428f 154
f17ea84b
SS
155XMLFILES= gdb-target.dtd xinclude.dtd library-list.dtd osdata.dtd
156
8b6a428f 157# kernel-debugger
0c3d4888 158#SRCS+= freebsd-uthread.c
8b6a428f
SS
159#SRCS+= kthr.c trgt.c trgt_${MACHINE_ARCH}.c
160
7629c1f8 161DPADD= ${LIBEDIT} ${LIBKVM} ${LIBTERMCAP} ${LIBM}
8b6a428f 162DPADD+= ../libbfd/libbfd.a ../libopcodes/libopcodes.a ../libiberty/libiberty.a
f17ea84b 163LDADD= -ledit -ltermcap -lm
8b6a428f
SS
164LDADD+= -L../libbfd -lbfd -L../libopcodes -lopcodes -L../libiberty -liberty
165
643b986c 166.include "Makefile.${TARGET_ARCH}"
8b6a428f
SS
167
168init.c: ${SRCS:Ninit.c} Makefile
169 echo '#include "defs.h"' > ${.TARGET}
170 echo '#include "call-cmds.h"' >> ${.TARGET}
171 sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/extern initialize_file_ftype _initialize_\1;/p' ${.ALLSRC:M*.c} >> ${.TARGET}
172 echo 'void' >> ${.TARGET}
173 echo 'initialize_all_files(void)' >> ${.TARGET}
174 echo '{' >> ${.TARGET}
175 sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/ _initialize_\1 ();/p' ${.ALLSRC:M*.c} >> ${.TARGET}
176 echo '}' >> ${.TARGET}
177
178CLEANFILES+= init.c
179
f17ea84b 180xml-builtin.c: feature_to_c.sh ${XMLFILES}
d0b8e0d3 181 rm -f ${.TARGET}
f17ea84b
SS
182 sh ${CONTRIBDIR}/features/feature_to_c.sh ${.TARGET} ${.ALLSRC:M*.dtd}
183
184CLEANFILES+= xml-builtin.c
185
8b6a428f
SS
186# observer.inc can't be included in SRCS, it would duplicate the entry in OBJS
187observer.h: observer.sh observer.inc doc/observer.texi
188 sh ${CONTRIBDIR}/observer.sh h ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
189observer.inc: observer.sh doc/observer.texi
190 sh ${CONTRIBDIR}/observer.sh inc ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
191
0c3d4888
SS
192gdb_stdint.h:
193 touch ${.TARGET}
194
a938cc15 195CLEANFILES+= observer.h observer.inc gdb_stdint.h
f17ea84b
SS
196
197
8b6a428f 198.include <bsd.lib.mk>