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