xref: /netbsd-src/tools/elftoolchain/libdwarf/Makefile (revision ad49149131b7552cf1c4fc41370cc055d9b4a80e)
1*ad491491Sriastradh#	$NetBSD: Makefile,v 1.7 2024/04/01 18:33:23 riastradh Exp $
22718af68Sjkoshy
32718af68SjkoshyHOSTLIB=dwarf
42718af68Sjkoshy
52718af68Sjkoshy.include <bsd.hostinit.mk>
62718af68Sjkoshy
72718af68SjkoshySRCS= \
82718af68Sjkoshy	dwarf_abbrev.c	\
92718af68Sjkoshy	dwarf_arange.c	\
102718af68Sjkoshy	dwarf_attr.c	\
112718af68Sjkoshy	dwarf_attrval.c	\
122718af68Sjkoshy	dwarf_cu.c	\
132718af68Sjkoshy	dwarf_dealloc.c	\
142718af68Sjkoshy	dwarf_die.c	\
152718af68Sjkoshy	dwarf_dump.c	\
162718af68Sjkoshy	dwarf_errmsg.c	\
172718af68Sjkoshy	dwarf_finish.c	\
182718af68Sjkoshy	dwarf_form.c	\
192718af68Sjkoshy	dwarf_frame.c	\
202718af68Sjkoshy	dwarf_init.c	\
212718af68Sjkoshy	dwarf_lineno.c	\
222718af68Sjkoshy	dwarf_loclist.c	\
232718af68Sjkoshy	dwarf_macinfo.c	\
242718af68Sjkoshy	dwarf_pro_arange.c	\
252718af68Sjkoshy	dwarf_pro_attr.c	\
262718af68Sjkoshy	dwarf_pro_die.c	\
272718af68Sjkoshy	dwarf_pro_expr.c	\
282718af68Sjkoshy	dwarf_pro_finish.c	\
292718af68Sjkoshy	dwarf_pro_frame.c	\
302718af68Sjkoshy	dwarf_pro_init.c	\
312718af68Sjkoshy	dwarf_pro_lineno.c	\
322718af68Sjkoshy	dwarf_pro_macinfo.c	\
332718af68Sjkoshy	dwarf_pro_reloc.c	\
342718af68Sjkoshy	dwarf_pro_sections.c	\
352718af68Sjkoshy	dwarf_ranges.c	\
362718af68Sjkoshy	dwarf_reloc.c	\
372718af68Sjkoshy	dwarf_seterror.c	\
382718af68Sjkoshy	dwarf_str.c	\
392718af68Sjkoshy	libdwarf.c	\
402718af68Sjkoshy	libdwarf_abbrev.c	\
412718af68Sjkoshy	libdwarf_arange.c	\
422718af68Sjkoshy	libdwarf_attr.c	\
432718af68Sjkoshy	libdwarf_die.c	\
442718af68Sjkoshy	libdwarf_elf_access.c	\
452718af68Sjkoshy	libdwarf_elf_init.c	\
462718af68Sjkoshy	libdwarf_error.c	\
472718af68Sjkoshy	libdwarf_frame.c	\
482718af68Sjkoshy	libdwarf_info.c	\
492718af68Sjkoshy	libdwarf_init.c	\
502718af68Sjkoshy	libdwarf_lineno.c	\
512718af68Sjkoshy	libdwarf_loc.c	\
522718af68Sjkoshy	libdwarf_loclist.c	\
532718af68Sjkoshy	libdwarf_macinfo.c	\
542718af68Sjkoshy	libdwarf_nametbl.c	\
552718af68Sjkoshy	libdwarf_ranges.c	\
562718af68Sjkoshy	libdwarf_reloc.c	\
572718af68Sjkoshy	libdwarf_rw.c	\
582718af68Sjkoshy	libdwarf_sections.c	\
592718af68Sjkoshy	libdwarf_str.c
602718af68Sjkoshy
612718af68SjkoshyELFTOOLCHAIN_DIR=${.CURDIR}/../../../external/bsd/elftoolchain/dist
622718af68SjkoshyLIBDWARF_DIR=	${ELFTOOLCHAIN_DIR}/libdwarf
632718af68SjkoshyLIBELF_DIR=	${ELFTOOLCHAIN_DIR}/libelf
642718af68SjkoshyCOMMON_DIR=	${ELFTOOLCHAIN_DIR}/common
652718af68Sjkoshy
662718af68SjkoshyINCS=		dwarf.h libdwarf.h
672718af68SjkoshyINCSDIR=	/usr/include
682718af68Sjkoshy
692718af68Sjkoshy.ifndef NOCOMPATLIB
702718af68SjkoshyCOMPATLIB_NO_LIB= yes # only the include files, not the library
712718af68Sjkoshy.-include	"${TOOLDIR}/share/compat/defs.mk"
722718af68Sjkoshy.endif
732718af68Sjkoshy
74f56b29a7SjkoshyLIBDWARF_OBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR}
75f56b29a7Sjkoshy
762718af68SjkoshyCPPFLAGS+=	-I${.CURDIR}/../../compat
772718af68SjkoshyCPPFLAGS+=	-I${.CURDIR}/../../common
78f56b29a7SjkoshyCPPFLAGS+=	-I${LIBDWARF_OBJDIR}/../common
792718af68SjkoshyCPPFLAGS+=	-I${LIBDWARF_DIR} -I${LIBELF_DIR} -I${COMMON_DIR}
80*ad491491SriastradhCPPFLAGS+=	-I${TOOLDIR}/include
812718af68Sjkoshy
822718af68SjkoshyBUILD_OSTYPE!=  uname -s
832718af68Sjkoshy
842718af68Sjkoshy# Disable use of pre-compiled headers on Darwin.
852718af68Sjkoshy.if ${BUILD_OSTYPE} == "Darwin"
862718af68SjkoshyCPPFLAGS+=	-no-cpp-precomp
872718af68Sjkoshy.endif
882718af68Sjkoshy
892718af68Sjkoshy# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
902718af68Sjkoshy# other file ops, on many systems, without changing function names.
912718af68Sjkoshy
922718af68SjkoshyCPPFLAGS+=	-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
932718af68Sjkoshy
942718af68Sjkoshy.PATH:		${LIBDWARF_DIR}
952718af68Sjkoshy
962718af68SjkoshyHOST_CPPFLAGS:=	${CPPFLAGS} ${HOST_CPPFLAGS}
972718af68SjkoshyCPPFLAGS:=	# empty
982718af68Sjkoshy
992718af68Sjkoshy.include <bsd.hostlib.mk>
100