gdb: Update makefile framework for version 7.4.1 upgrade
[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 CFLAGS+= -DTUI                          # enable "gdb -tui" (TUI MODE)
26
27 SRCS+=  observer.h gdb_stdint.h
28
29 # The order of these sources is important,
30 # because init.c below needs to obey a certain ordering
31 # of function calls.
32
33 # COMMON_OBS
34 SRCS+=  \
35         version.c \
36         annotate.c \
37         addrmap.c \
38         auxv.c \
39         bfd-target.c \
40         blockframe.c breakpoint.c findvar.c regcache.c \
41         charset.c continuations.c disasm.c dummy-frame.c dfp.c \
42         source.c value.c eval.c valops.c valarith.c valprint.c printcmd.c \
43         block.c symtab.c psymtab.c symfile.c symmisc.c linespec.c dictionary.c \
44         infcall.c \
45         infcmd.c infrun.c \
46         expprint.c environ.c stack.c thread.c \
47         exceptions.c \
48         filesystem.c \
49         inf-child.c \
50         interps.c \
51         main.c \
52         macrotab.c macrocmd.c macroexp.c macroscope.c \
53         mi-common.c \
54         event-loop.c event-top.c inf-loop.c completer.c \
55         gdbarch.c arch-utils.c gdbtypes.c osabi.c copying.c \
56         memattr.c mem-break.c target.c parse.c language.c buildsym.c \
57         findcmd.c \
58         std-regs.c \
59         signals.c \
60         exec.c reverse.c \
61         bcache.c objfiles.c observer.c minsyms.c maint.c demangle.c \
62         dbxread.c coffread.c coff-pe-read.c \
63         dwarf2read.c mipsread.c stabsread.c corefile.c \
64         dwarf2expr.c dwarf2loc.c dwarf2-frame.c dwarf2-frame-tailcall.c \
65         ada-lang.c c-lang.c d-lang.c f-lang.c objc-lang.c \
66         ada-tasks.c \
67         ui-out.c cli-out.c \
68         varobj.c vec.c wrapper.c \
69         jv-lang.c jv-valprint.c jv-typeprint.c \
70         m2-lang.c opencl-lang.c p-lang.c p-typeprint.c p-valprint.c \
71         sentinel-frame.c \
72         complaints.c typeprint.c \
73         ada-typeprint.c c-typeprint.c f-typeprint.c m2-typeprint.c \
74         ada-valprint.c c-valprint.c cp-valprint.c d-valprint.c f-valprint.c \
75         m2-valprint.c \
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 \
81         inline-frame.c \
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 \
87         solib.c solib-target.c \
88         prologue-value.c memory-map.c memrange.c \
89         xml-support.c xml-syscall.c xml-utils.c \
90         target-descriptions.c target-memory.c xml-tdesc.c xml-builtin.c \
91         inferior.c osdata.c gdb_usleep.c record.c gcore.c \
92         jit.c progspace.c skip.c \
93         common-utils.c buffer.c ptid.c gdb-dlfcn.c
94
95 # TSOBS
96 SRCS+=  inflow.c
97
98 # SER_HARDWIRE
99 SRCS+=  ser-base.c ser-unix.c ser-pipe.c ser-tcp.c
100
101 # REMOTE_OBS
102 SRCS+=  remote.c dcache.c tracepoint.c ax-general.c ax-gdb.c remote-fileio.c
103
104 # SUBDIR_CLI_OBS
105 SRCS+=  cli-dump.c \
106         cli-decode.c cli-script.c cli-cmds.c cli-setshow.c \
107         cli-logging.c \
108         cli-interp.c cli-utils.c
109
110 # SUBDIR_MI_OBS
111 SRCS+=  mi-out.c mi-console.c \
112         mi-cmds.c mi-cmd-env.c mi-cmd-var.c mi-cmd-break.c mi-cmd-stack.c \
113         mi-cmd-file.c mi-cmd-disas.c mi-symbol-cmds.c mi-cmd-target.c \
114         mi-interp.c \
115         mi-main.c mi-parse.c mi-getopt.c
116
117 # PYTHON OBJS
118 SRCS+=  python.c \
119         py-auto-load.c \
120         py-value.c \
121         py-prettyprint.c 
122
123 # CONFIG_OBS
124 SRCS+=  elfread.c posix-hdep.c
125
126 # SUBDIR_TUI_OBS
127 SRCS+=  tui-command.c \
128         tui-data.c \
129         tui-disasm.c \
130         tui-file.c \
131         tui.c \
132         tui-hooks.c \
133         tui-interp.c \
134         tui-io.c \
135         tui-layout.c \
136         tui-out.c \
137         tui-regs.c \
138         tui-source.c \
139         tui-stack.c \
140         tui-win.c \
141         tui-windata.c \
142         tui-wingeneral.c \
143         tui-winsource.c
144
145 # YYOBJ
146 SRCS+=  c-exp.y \
147         cp-name-parser.y \
148         objc-exp.y \
149         ada-exp.y \
150         jv-exp.y \
151         f-exp.y \
152         m2-exp.y \
153         p-exp.y
154
155 SRCS+=  init.c
156
157 XMLFILES= \
158         gdb-target.dtd \
159         xinclude.dtd \
160         library-list.dtd \
161         library-list-svr4.dtd \
162         osdata.dtd \
163         threads.dtd \
164         traceframe-info.dtd
165
166 # kernel-debugger
167 #SRCS+= freebsd-uthread.c
168 #SRCS+= kthr.c trgt.c trgt_${MACHINE_ARCH}.c
169
170 DPADD=  ${LIBEDIT} ${LIBKVM} ${LIBTERMCAP} ${LIBM}
171 DPADD+= ../libbfd/libbfd.a ../libopcodes/libopcodes.a ../libiberty/libiberty.a
172 LDADD=  -ledit -ltermcap -lm
173 LDADD+= -L../libbfd -lbfd -L../libopcodes -lopcodes -L../libiberty -liberty
174
175 .include "Makefile.${TARGET_ARCH}"
176
177 init.c: ${SRCS:Ninit.c} Makefile
178         echo '#include "defs.h"' > ${.TARGET}
179         echo '#include "call-cmds.h"' >> ${.TARGET}
180         sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/extern initialize_file_ftype _initialize_\1;/p' ${.ALLSRC:M*.c} >> ${.TARGET}
181         echo 'void' >> ${.TARGET}
182         echo 'initialize_all_files(void)' >> ${.TARGET}
183         echo '{' >> ${.TARGET}
184         sed -n -e 's/^_initialize_\([a-z_0-9A-Z]*\).*/  _initialize_\1 ();/p' ${.ALLSRC:M*.c} >> ${.TARGET}
185         echo '}' >> ${.TARGET}
186
187 CLEANFILES+=    init.c
188
189 xml-builtin.c: feature_to_c.sh ${XMLFILES}
190         rm -f ${.TARGET}
191         sh ${CONTRIBDIR}/features/feature_to_c.sh ${.TARGET} ${.ALLSRC:M*.dtd}
192
193 CLEANFILES+=    xml-builtin.c
194
195 # observer.inc can't be included in SRCS, it would duplicate the entry in OBJS
196 observer.h: observer.sh observer.inc doc/observer.texi
197         sh ${CONTRIBDIR}/observer.sh h ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
198 observer.inc: observer.sh doc/observer.texi
199         sh ${CONTRIBDIR}/observer.sh inc ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
200
201 gdb_stdint.h:
202         touch ${.TARGET}
203
204 CLEANFILES+=    observer.h observer.inc gdb_stdint.h
205
206
207 .include <bsd.lib.mk>