xref: /freebsd/lib/libdwarf/Makefile (revision 783d3ff6d7fae619db8a7990b8a6387de0c677b5)
1.include <bsd.own.mk>
2
3PACKAGE=lib${LIB}
4ELFTCDIR=${SRCTOP}/contrib/elftoolchain
5SRCDIR=	${ELFTCDIR}/libdwarf
6
7.PATH:	${SRCDIR}
8
9LIB=	dwarf
10
11SRCS=	\
12	dwarf_abbrev.c		\
13	dwarf_arange.c		\
14	dwarf_attr.c		\
15	dwarf_attrval.c		\
16	dwarf_cu.c		\
17	dwarf_dealloc.c		\
18	dwarf_die.c		\
19	dwarf_dump.c		\
20	dwarf_errmsg.c		\
21	dwarf_finish.c		\
22	dwarf_form.c		\
23	dwarf_frame.c		\
24	dwarf_funcs.c		\
25	dwarf_init.c		\
26	dwarf_lineno.c		\
27	dwarf_loclist.c		\
28	dwarf_macinfo.c		\
29	dwarf_pro_arange.c	\
30	dwarf_pro_attr.c	\
31	dwarf_pro_die.c		\
32	dwarf_pro_expr.c	\
33	dwarf_pro_finish.c	\
34	dwarf_pro_frame.c	\
35	dwarf_pro_funcs.c	\
36	dwarf_pro_init.c	\
37	dwarf_pro_lineno.c	\
38	dwarf_pro_macinfo.c	\
39	dwarf_pro_pubnames.c	\
40	dwarf_pro_reloc.c	\
41	dwarf_pro_sections.c	\
42	dwarf_pro_types.c	\
43	dwarf_pro_vars.c	\
44	dwarf_pro_weaks.c	\
45	dwarf_pubnames.c	\
46	dwarf_pubtypes.c	\
47	dwarf_ranges.c		\
48	dwarf_reloc.c		\
49	dwarf_sections.c	\
50	dwarf_seterror.c	\
51	dwarf_str.c		\
52	dwarf_types.c		\
53	dwarf_vars.c		\
54	dwarf_weaks.c		\
55	libdwarf.c		\
56	libdwarf_abbrev.c	\
57	libdwarf_arange.c	\
58	libdwarf_attr.c		\
59	libdwarf_die.c		\
60	libdwarf_error.c	\
61	libdwarf_elf_access.c	\
62	libdwarf_elf_init.c	\
63	libdwarf_frame.c	\
64	libdwarf_info.c		\
65	libdwarf_init.c		\
66	libdwarf_lineno.c	\
67	libdwarf_loc.c		\
68	libdwarf_loclist.c	\
69	libdwarf_macinfo.c	\
70	libdwarf_nametbl.c	\
71	libdwarf_ranges.c	\
72	libdwarf_reloc.c	\
73	libdwarf_rw.c		\
74	libdwarf_sections.c	\
75	libdwarf_str.c		\
76	zlib_stub.c
77
78INCS=		dwarf.h libdwarf.h
79
80# This same hack is in lib/libelf/Makefile and usr.bin/readelf/Makefile
81# We need to link against the correct version of these files. One
82# solution is to include ../../sys in the include path. This causes
83# problems when a header file in sys depends on a file in another
84# part of the tree, e.g. a machine dependent header.
85#
86SRCS+=	sys/elf32.h sys/elf64.h sys/elf_common.h
87
88GENSRCS=	dwarf_pubnames.c dwarf_pubtypes.c dwarf_weaks.c \
89		dwarf_funcs.c dwarf_vars.c dwarf_types.c	\
90		dwarf_pro_pubnames.c dwarf_pro_weaks.c		\
91		dwarf_pro_funcs.c dwarf_pro_types.c		\
92		dwarf_pro_vars.c
93CLEANFILES=	${GENSRCS}
94CLEANDIRS=	sys
95CFLAGS+=	-I. -I${SRCDIR} -I${ELFTCDIR}/common -I${ELFTCDIR}/libelf
96
97sys/elf32.h sys/elf64.h sys/elf_common.h: ${SRCTOP}/sys/${.TARGET} .NOMETA
98	mkdir -p ${.OBJDIR}/sys
99	ln -sf ${.ALLSRC} ${.TARGET}
100
101LIBADD+=	elf z
102
103SHLIB_MAJOR=	4
104
105MAN=	dwarf.3                                         \
106	dwarf_add_arange.3				\
107	dwarf_add_AT_comp_dir.3				\
108	dwarf_add_AT_const_value_string.3		\
109	dwarf_add_AT_dataref.3				\
110	dwarf_add_AT_flag.3				\
111	dwarf_add_AT_location_expr.3			\
112	dwarf_add_AT_name.3				\
113	dwarf_add_AT_producer.3				\
114	dwarf_add_AT_ref_address.3			\
115	dwarf_add_AT_reference.3			\
116	dwarf_add_AT_signed_const.3			\
117	dwarf_add_AT_string.3				\
118	dwarf_add_AT_targ_address.3			\
119	dwarf_add_die_to_debug.3			\
120	dwarf_add_directory_decl.3			\
121	dwarf_add_expr_addr.3				\
122	dwarf_add_expr_gen.3				\
123	dwarf_add_fde_inst.3				\
124	dwarf_add_file_decl.3				\
125	dwarf_add_frame_cie.3				\
126	dwarf_add_frame_fde.3				\
127	dwarf_add_funcname.3				\
128	dwarf_add_line_entry.3				\
129	dwarf_add_pubname.3				\
130	dwarf_add_typename.3				\
131	dwarf_add_varname.3				\
132	dwarf_add_weakname.3				\
133	dwarf_attr.3					\
134	dwarf_attrlist.3				\
135	dwarf_attroffset.3				\
136	dwarf_attrval_signed.3				\
137	dwarf_child.3					\
138	dwarf_dealloc.3					\
139	dwarf_def_macro.3				\
140	dwarf_die_abbrev_code.3				\
141	dwarf_die_link.3				\
142	dwarf_diename.3					\
143	dwarf_dieoffset.3				\
144	dwarf_end_macro_file.3				\
145	dwarf_errmsg.3					\
146	dwarf_errno.3					\
147	dwarf_expand_frame_instructions.3		\
148	dwarf_expr_current_offset.3			\
149	dwarf_expr_into_block.3				\
150	dwarf_fde_cfa_offset.3				\
151	dwarf_find_macro_value_start.3			\
152	dwarf_finish.3					\
153	dwarf_formaddr.3				\
154	dwarf_formblock.3				\
155	dwarf_formexprloc.3				\
156	dwarf_formflag.3				\
157	dwarf_formref.3					\
158	dwarf_formsig8.3				\
159	dwarf_formstring.3				\
160	dwarf_formudata.3				\
161	dwarf_get_abbrev.3				\
162	dwarf_get_abbrev_children_flag.3		\
163	dwarf_get_abbrev_code.3				\
164	dwarf_get_abbrev_entry.3			\
165	dwarf_get_abbrev_tag.3				\
166	dwarf_get_address_size.3			\
167	dwarf_get_arange.3				\
168	dwarf_get_arange_info.3				\
169	dwarf_get_aranges.3				\
170	dwarf_get_AT_name.3				\
171	dwarf_get_cie_index.3				\
172	dwarf_get_cie_info.3				\
173	dwarf_get_cie_of_fde.3				\
174	dwarf_get_cu_die_offset.3			\
175	dwarf_get_die_infotypes_flag.3			\
176	dwarf_get_elf.3					\
177	dwarf_get_fde_at_pc.3				\
178	dwarf_get_fde_info_for_all_regs.3		\
179	dwarf_get_fde_info_for_all_regs3.3		\
180	dwarf_get_fde_info_for_cfa_reg3.3		\
181	dwarf_get_fde_info_for_reg.3			\
182	dwarf_get_fde_info_for_reg3.3			\
183	dwarf_get_fde_instr_bytes.3			\
184	dwarf_get_fde_list.3				\
185	dwarf_get_fde_n.3				\
186	dwarf_get_fde_range.3				\
187	dwarf_get_form_class.3				\
188	dwarf_get_funcs.3				\
189	dwarf_get_globals.3				\
190	dwarf_get_loclist_entry.3			\
191	dwarf_get_macro_details.3			\
192	dwarf_get_pubtypes.3				\
193	dwarf_get_ranges.3				\
194	dwarf_get_relocation_info.3			\
195	dwarf_get_relocation_info_count.3		\
196	dwarf_get_section_bytes.3			\
197	dwarf_get_section_max_offsets.3			\
198	dwarf_get_str.3					\
199	dwarf_get_types.3				\
200	dwarf_get_vars.3				\
201	dwarf_get_weaks.3				\
202	dwarf_hasattr.3					\
203	dwarf_hasform.3					\
204	dwarf_highpc.3					\
205	dwarf_init.3					\
206	dwarf_lineno.3					\
207	dwarf_lne_end_sequence.3			\
208	dwarf_lne_set_address.3				\
209	dwarf_loclist.3					\
210	dwarf_loclist_from_expr.3			\
211	dwarf_new_die.3					\
212	dwarf_new_expr.3				\
213	dwarf_new_fde.3					\
214	dwarf_next_cu_header.3				\
215	dwarf_next_types_section.3			\
216	dwarf_object_init.3				\
217	dwarf_producer_init.3				\
218	dwarf_producer_set_isa.3			\
219	dwarf_reset_section_bytes.3			\
220	dwarf_seterrarg.3				\
221	dwarf_set_frame_cfa_value.3			\
222	dwarf_set_reloc_application.3			\
223	dwarf_srcfiles.3				\
224	dwarf_srclines.3				\
225	dwarf_start_macro_file.3			\
226	dwarf_tag.3					\
227	dwarf_transform_to_disk_form.3			\
228	dwarf_undef_macro.3				\
229	dwarf_vendor_ext.3				\
230	dwarf_whatattr.3
231
232MLINKS+= \
233	dwarf_add_AT_const_value_string.3 dwarf_add_AT_const_value_signedint.3 \
234	dwarf_add_AT_const_value_string.3 dwarf_add_AT_const_value_unsignedint.3 \
235	dwarf_add_AT_signed_const.3 dwarf_add_AT_unsigned_const.3 \
236	dwarf_add_AT_targ_address.3 dwarf_add_AT_targ_address_b.3 \
237	dwarf_add_arange.3	dwarf_add_arange_b.3	\
238	dwarf_add_expr_addr.3	dwarf_add_expr_addr_b.3	\
239	dwarf_add_frame_fde.3	dwarf_add_frame_fde_b.3	\
240	dwarf_attrval_signed.3	dwarf_attrval_flag.3	\
241	dwarf_attrval_signed.3	dwarf_attrval_string.3	\
242	dwarf_attrval_signed.3	dwarf_attrval_unsigned.3 \
243	dwarf_child.3	dwarf_offdie.3			\
244	dwarf_child.3	dwarf_offdie_b.3		\
245	dwarf_child.3	dwarf_siblingof.3		\
246	dwarf_child.3	dwarf_siblingof_b.3		\
247	dwarf_dealloc.3	dwarf_fde_cie_list_dealloc.3	\
248	dwarf_dealloc.3	dwarf_funcs_dealloc.3		\
249	dwarf_dealloc.3	dwarf_globals_dealloc.3		\
250	dwarf_dealloc.3	dwarf_pubtypes_dealloc.3	\
251	dwarf_dealloc.3	dwarf_types_dealloc.3		\
252	dwarf_dealloc.3	dwarf_vars_dealloc.3		\
253	dwarf_dealloc.3	dwarf_weaks_dealloc.3		\
254	dwarf_dealloc.3	dwarf_ranges_dealloc.3		\
255	dwarf_dealloc.3	dwarf_srclines_dealloc.3	\
256	dwarf_init.3	dwarf_elf_init.3		\
257	dwarf_dieoffset.3	dwarf_die_CU_offset.3	\
258	dwarf_dieoffset.3	dwarf_die_CU_offset_range.3 \
259	dwarf_dieoffset.3	dwarf_get_cu_die_offset_given_cu_header_offset.3 \
260	dwarf_dieoffset.3	dwarf_get_cu_die_offset_given_cu_header_offset_b.3 \
261	dwarf_finish.3		dwarf_object_finish.3	\
262	dwarf_formref.3	dwarf_global_formref.3		\
263	dwarf_formudata.3	dwarf_formsdata.3	\
264	dwarf_get_AT_name.3	dwarf_get_ACCESS_name.3	\
265	dwarf_get_AT_name.3	dwarf_get_ATE_name.3	\
266	dwarf_get_AT_name.3	dwarf_get_CC_name.3	\
267	dwarf_get_AT_name.3	dwarf_get_CFA_name.3	\
268	dwarf_get_AT_name.3	dwarf_get_CHILDREN_name.3 \
269	dwarf_get_AT_name.3	dwarf_get_DS_name.3	\
270	dwarf_get_AT_name.3	dwarf_get_DSC_name.3	\
271	dwarf_get_AT_name.3	dwarf_get_EH_name.3	\
272	dwarf_get_AT_name.3	dwarf_get_END_name.3	\
273	dwarf_get_AT_name.3	dwarf_get_FORM_name.3	\
274	dwarf_get_AT_name.3	dwarf_get_ID_name.3	\
275	dwarf_get_AT_name.3	dwarf_get_INL_name.3	\
276	dwarf_get_AT_name.3	dwarf_get_LANG_name.3	\
277	dwarf_get_AT_name.3	dwarf_get_LNE_name.3	\
278	dwarf_get_AT_name.3	dwarf_get_LNS_name.3	\
279	dwarf_get_AT_name.3	dwarf_get_MACINFO_name.3 \
280	dwarf_get_AT_name.3	dwarf_get_OP_name.3	\
281	dwarf_get_AT_name.3	dwarf_get_ORD_name.3	\
282	dwarf_get_AT_name.3	dwarf_get_TAG_name.3	\
283	dwarf_get_AT_name.3	dwarf_get_UT_name.3	\
284	dwarf_get_AT_name.3	dwarf_get_VIRTUALITY_name.3 \
285	dwarf_get_AT_name.3	dwarf_get_VIS_name.3	\
286	dwarf_get_cu_die_offset.3 dwarf_get_arange_cu_header_offset.3 \
287	dwarf_get_fde_list.3	dwarf_get_fde_list_eh.3	\
288	dwarf_get_funcs.3	dwarf_func_die_offset.3	\
289	dwarf_get_funcs.3	dwarf_func_cu_offset.3	\
290	dwarf_get_funcs.3	dwarf_func_name_offsets.3 \
291	dwarf_get_funcs.3	dwarf_funcname.3	\
292	dwarf_get_globals.3	dwarf_global_die_offset.3 \
293	dwarf_get_globals.3	dwarf_global_cu_offset.3 \
294	dwarf_get_globals.3	dwarf_global_name_offsets.3 \
295	dwarf_get_globals.3	dwarf_globname.3	\
296	dwarf_get_pubtypes.3	dwarf_pubtype_die_offset.3 \
297	dwarf_get_pubtypes.3	dwarf_pubtype_cu_offset.3 \
298	dwarf_get_pubtypes.3	dwarf_pubtype_name_offsets.3 \
299	dwarf_get_pubtypes.3	dwarf_pubtypename.3	\
300	dwarf_get_ranges.3	dwarf_get_ranges_a.3	\
301	dwarf_get_section_max_offsets.3 dwarf_get_section_max_offsets_b.3 \
302	dwarf_get_types.3	dwarf_type_die_offset.3	\
303	dwarf_get_types.3	dwarf_type_cu_offset.3	\
304	dwarf_get_types.3	dwarf_type_name_offsets.3 \
305	dwarf_get_types.3	dwarf_typename.3	\
306	dwarf_get_vars.3	dwarf_var_die_offset.3	\
307	dwarf_get_vars.3	dwarf_var_cu_offset.3	\
308	dwarf_get_vars.3	dwarf_var_name_offsets.3 \
309	dwarf_get_vars.3	dwarf_varname.3		\
310	dwarf_get_weaks.3	dwarf_weak_die_offset.3	\
311	dwarf_get_weaks.3	dwarf_weak_cu_offset.3	\
312	dwarf_get_weaks.3	dwarf_weak_name_offsets.3 \
313	dwarf_get_weaks.3	dwarf_weakname.3	\
314	dwarf_hasform.3	dwarf_whatform.3		\
315	dwarf_hasform.3	dwarf_whatform_direct.3		\
316	dwarf_highpc.3	dwarf_arrayorder.3		\
317	dwarf_highpc.3	dwarf_bitoffset.3		\
318	dwarf_highpc.3	dwarf_bitsize.3			\
319	dwarf_highpc.3	dwarf_bytesize.3		\
320	dwarf_highpc.3	dwarf_highpc_b.3		\
321	dwarf_highpc.3	dwarf_lowpc.3			\
322	dwarf_highpc.3	dwarf_srclang.3			\
323	dwarf_lineno.3	dwarf_lineaddr.3		\
324	dwarf_lineno.3	dwarf_linebeginstatement.3	\
325	dwarf_lineno.3	dwarf_lineblock.3		\
326	dwarf_lineno.3	dwarf_lineendsequence.3		\
327	dwarf_lineno.3	dwarf_lineoff.3			\
328	dwarf_lineno.3	dwarf_linesrc.3			\
329	dwarf_lineno.3	dwarf_line_srcfileno.3		\
330	dwarf_loclist.3	dwarf_loclist_n.3		\
331	dwarf_loclist_from_expr.3 dwarf_loclist_from_expr_a.3 \
332	dwarf_loclist_from_expr.3 dwarf_loclist_from_expr_b.3 \
333	dwarf_next_cu_header.3 dwarf_next_cu_header_b.3 \
334	dwarf_next_cu_header.3 dwarf_next_cu_header_c.3 \
335	dwarf_producer_init.3 dwarf_producer_init_b.3	\
336	dwarf_seterrarg.3	dwarf_seterrhand.3	\
337	dwarf_set_frame_cfa_value.3 dwarf_set_frame_rule_initial_value.3 \
338	dwarf_set_frame_cfa_value.3 dwarf_set_frame_rule_table_size.3 \
339	dwarf_set_frame_cfa_value.3 dwarf_set_frame_same_value.3 \
340	dwarf_set_frame_cfa_value.3 dwarf_set_frame_undefined_value.3
341
342dwarf_pubnames.c:	dwarf_nametbl.m4 dwarf_pubnames.m4
343dwarf_pubtypes.c:	dwarf_nametbl.m4 dwarf_pubtypes.m4
344dwarf_weaks.c:		dwarf_nametbl.m4 dwarf_weaks.m4
345dwarf_funcs.c:		dwarf_nametbl.m4 dwarf_funcs.m4
346dwarf_vars.c:		dwarf_nametbl.m4 dwarf_vars.m4
347dwarf_types.c:		dwarf_nametbl.m4 dwarf_types.m4
348dwarf_pro_pubnames.c:	dwarf_pro_nametbl.m4 dwarf_pro_pubnames.m4
349dwarf_pro_weaks.c:	dwarf_pro_nametbl.m4 dwarf_pro_weaks.m4
350dwarf_pro_funcs.c:	dwarf_pro_nametbl.m4 dwarf_pro_funcs.m4
351dwarf_pro_types.c:	dwarf_pro_nametbl.m4 dwarf_pro_types.m4
352dwarf_pro_vars.c:	dwarf_pro_nametbl.m4 dwarf_pro_vars.m4
353
354.include <bsd.lib.mk>
355
356# Keep the .SUFFIXES line after the include of bsd.lib.mk
357.SUFFIXES:	.m4 .c
358.m4.c:
359	m4 -D SRCDIR=${SRCDIR} ${M4FLAGS} ${.IMPSRC} > ${.TARGET}
360
361