1 1.7 riastrad # $NetBSD: Makefile,v 1.7 2024/04/01 18:33:23 riastradh Exp $ 2 1.1 jkoshy 3 1.1 jkoshy HOSTLIB=dwarf 4 1.1 jkoshy 5 1.1 jkoshy .include <bsd.hostinit.mk> 6 1.1 jkoshy 7 1.1 jkoshy SRCS= \ 8 1.1 jkoshy dwarf_abbrev.c \ 9 1.1 jkoshy dwarf_arange.c \ 10 1.1 jkoshy dwarf_attr.c \ 11 1.1 jkoshy dwarf_attrval.c \ 12 1.1 jkoshy dwarf_cu.c \ 13 1.1 jkoshy dwarf_dealloc.c \ 14 1.1 jkoshy dwarf_die.c \ 15 1.1 jkoshy dwarf_dump.c \ 16 1.1 jkoshy dwarf_errmsg.c \ 17 1.1 jkoshy dwarf_finish.c \ 18 1.1 jkoshy dwarf_form.c \ 19 1.1 jkoshy dwarf_frame.c \ 20 1.1 jkoshy dwarf_init.c \ 21 1.1 jkoshy dwarf_lineno.c \ 22 1.1 jkoshy dwarf_loclist.c \ 23 1.1 jkoshy dwarf_macinfo.c \ 24 1.1 jkoshy dwarf_pro_arange.c \ 25 1.1 jkoshy dwarf_pro_attr.c \ 26 1.1 jkoshy dwarf_pro_die.c \ 27 1.1 jkoshy dwarf_pro_expr.c \ 28 1.1 jkoshy dwarf_pro_finish.c \ 29 1.1 jkoshy dwarf_pro_frame.c \ 30 1.1 jkoshy dwarf_pro_init.c \ 31 1.1 jkoshy dwarf_pro_lineno.c \ 32 1.1 jkoshy dwarf_pro_macinfo.c \ 33 1.1 jkoshy dwarf_pro_reloc.c \ 34 1.1 jkoshy dwarf_pro_sections.c \ 35 1.1 jkoshy dwarf_ranges.c \ 36 1.1 jkoshy dwarf_reloc.c \ 37 1.1 jkoshy dwarf_seterror.c \ 38 1.1 jkoshy dwarf_str.c \ 39 1.1 jkoshy libdwarf.c \ 40 1.1 jkoshy libdwarf_abbrev.c \ 41 1.1 jkoshy libdwarf_arange.c \ 42 1.1 jkoshy libdwarf_attr.c \ 43 1.1 jkoshy libdwarf_die.c \ 44 1.1 jkoshy libdwarf_elf_access.c \ 45 1.1 jkoshy libdwarf_elf_init.c \ 46 1.1 jkoshy libdwarf_error.c \ 47 1.1 jkoshy libdwarf_frame.c \ 48 1.1 jkoshy libdwarf_info.c \ 49 1.1 jkoshy libdwarf_init.c \ 50 1.1 jkoshy libdwarf_lineno.c \ 51 1.1 jkoshy libdwarf_loc.c \ 52 1.1 jkoshy libdwarf_loclist.c \ 53 1.1 jkoshy libdwarf_macinfo.c \ 54 1.1 jkoshy libdwarf_nametbl.c \ 55 1.1 jkoshy libdwarf_ranges.c \ 56 1.1 jkoshy libdwarf_reloc.c \ 57 1.1 jkoshy libdwarf_rw.c \ 58 1.1 jkoshy libdwarf_sections.c \ 59 1.1 jkoshy libdwarf_str.c 60 1.1 jkoshy 61 1.1 jkoshy ELFTOOLCHAIN_DIR=${.CURDIR}/../../../external/bsd/elftoolchain/dist 62 1.1 jkoshy LIBDWARF_DIR= ${ELFTOOLCHAIN_DIR}/libdwarf 63 1.1 jkoshy LIBELF_DIR= ${ELFTOOLCHAIN_DIR}/libelf 64 1.1 jkoshy COMMON_DIR= ${ELFTOOLCHAIN_DIR}/common 65 1.1 jkoshy 66 1.1 jkoshy INCS= dwarf.h libdwarf.h 67 1.1 jkoshy INCSDIR= /usr/include 68 1.1 jkoshy 69 1.1 jkoshy .ifndef NOCOMPATLIB 70 1.1 jkoshy COMPATLIB_NO_LIB= yes # only the include files, not the library 71 1.1 jkoshy .-include "${TOOLDIR}/share/compat/defs.mk" 72 1.1 jkoshy .endif 73 1.1 jkoshy 74 1.2 jkoshy LIBDWARF_OBJDIR!= cd ${.CURDIR} && ${PRINTOBJDIR} 75 1.2 jkoshy 76 1.1 jkoshy CPPFLAGS+= -I${.CURDIR}/../../compat 77 1.1 jkoshy CPPFLAGS+= -I${.CURDIR}/../../common 78 1.2 jkoshy CPPFLAGS+= -I${LIBDWARF_OBJDIR}/../common 79 1.1 jkoshy CPPFLAGS+= -I${LIBDWARF_DIR} -I${LIBELF_DIR} -I${COMMON_DIR} 80 1.7 riastrad CPPFLAGS+= -I${TOOLDIR}/include 81 1.1 jkoshy 82 1.1 jkoshy BUILD_OSTYPE!= uname -s 83 1.1 jkoshy 84 1.1 jkoshy # Disable use of pre-compiled headers on Darwin. 85 1.1 jkoshy .if ${BUILD_OSTYPE} == "Darwin" 86 1.1 jkoshy CPPFLAGS+= -no-cpp-precomp 87 1.1 jkoshy .endif 88 1.1 jkoshy 89 1.1 jkoshy # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and 90 1.1 jkoshy # other file ops, on many systems, without changing function names. 91 1.1 jkoshy 92 1.1 jkoshy CPPFLAGS+= -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 93 1.1 jkoshy 94 1.1 jkoshy .PATH: ${LIBDWARF_DIR} 95 1.1 jkoshy 96 1.1 jkoshy HOST_CPPFLAGS:= ${CPPFLAGS} ${HOST_CPPFLAGS} 97 1.1 jkoshy CPPFLAGS:= # empty 98 1.1 jkoshy 99 1.1 jkoshy .include <bsd.hostlib.mk> 100