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