5b83da0d7c9638f401ae4f240fe6a5d682ca5932
[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
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 psymtab.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         filesystem.c \
48         inf-child.c \
49         interps.c \
50         main.c \
51         macrotab.c macrocmd.c macroexp.c macroscope.c \
52         mi-common.c \
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 \
56         findcmd.c \
57         std-regs.c \
58         signals.c \
59         exec.c reverse.c \
60         bcache.c objfiles.c observer.c minsyms.c maint.c demangle.c \
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 \
64         ada-lang.c c-lang.c d-lang.c f-lang.c objc-lang.c \
65         ada-tasks.c \
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 \
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 xml-support.c xml-syscall.c \
89         target-descriptions.c target-memory.c xml-tdesc.c xml-builtin.c \
90         inferior.c osdata.c gdb_usleep.c record.c gcore.c \
91         jit.c progspace.c
92
93 # TSOBS
94 SRCS+=  inflow.c
95
96 # SER_HARDWIRE
97 SRCS+=  ser-base.c ser-unix.c ser-pipe.c ser-tcp.c
98
99 # REMOTE_OBS
100 SRCS+=  remote.c dcache.c tracepoint.c ax-general.c ax-gdb.c remote-fileio.c
101
102 # SUBDIR_CLI_OBS
103 SRCS+=  cli-dump.c \
104         cli-decode.c cli-script.c cli-cmds.c cli-setshow.c \
105         cli-logging.c \
106         cli-interp.c
107
108 # SUBDIR_MI_OBS
109 SRCS+=  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 \
111         mi-cmd-file.c mi-cmd-disas.c mi-symbol-cmds.c mi-cmd-target.c \
112         mi-interp.c \
113         mi-main.c mi-parse.c mi-getopt.c mi-common.c
114
115 # PYTHON OBJS
116 SRCS+=  python.c \
117         py-auto-load.c \
118         py-value.c \
119         py-prettyprint.c 
120
121 # CONFIG_OBS
122 SRCS+=  elfread.c posix-hdep.c
123
124 # SUBDIR_TUI_OBS
125 SRCS+=  tui-command.c \
126         tui-data.c \
127         tui-disasm.c \
128         tui-file.c \
129         tui.c \
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
144 SRCS+=  c-exp.y \
145         cp-name-parser.y \
146         objc-exp.y \
147         ada-exp.y \
148         jv-exp.y \
149         f-exp.y \
150         m2-exp.y \
151         p-exp.y
152
153 SRCS+=  init.c
154
155 XMLFILES= gdb-target.dtd xinclude.dtd library-list.dtd osdata.dtd
156
157 # kernel-debugger
158 #SRCS+= freebsd-uthread.c
159 #SRCS+= kthr.c trgt.c trgt_${MACHINE_ARCH}.c
160
161 DPADD=  ${LIBEDIT} ${LIBKVM} ${LIBTERMCAP} ${LIBM}
162 DPADD+= ../libbfd/libbfd.a ../libopcodes/libopcodes.a ../libiberty/libiberty.a
163 LDADD=  -ledit -ltermcap -lm
164 LDADD+= -L../libbfd -lbfd -L../libopcodes -lopcodes -L../libiberty -liberty
165
166 .include "Makefile.${TARGET_ARCH}"
167
168 init.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
178 CLEANFILES+=    init.c
179
180 xml-builtin.c: feature_to_c.sh ${XMLFILES}
181         sh ${CONTRIBDIR}/features/feature_to_c.sh ${.TARGET} ${.ALLSRC:M*.dtd}
182
183 CLEANFILES+=    xml-builtin.c
184
185 # observer.inc can't be included in SRCS, it would duplicate the entry in OBJS
186 observer.h: observer.sh observer.inc doc/observer.texi
187         sh ${CONTRIBDIR}/observer.sh h ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
188 observer.inc: observer.sh doc/observer.texi
189         sh ${CONTRIBDIR}/observer.sh inc ${CONTRIBDIR}/doc/observer.texi ${.TARGET}
190
191 gdb_stdint.h:
192         touch ${.TARGET}
193
194 CLEANFILES+=    observer.h observer.inc gdb_stdint.h
195
196
197 .include <bsd.lib.mk>