1 # $NetBSD: Makefile,v 1.10 2024/04/01 18:33:24 riastradh Exp $ 2 3 HOSTLIB= ctf 4 5 .include <bsd.hostinit.mk> 6 7 SRCS= ctf_create.c \ 8 ctf_decl.c \ 9 ctf_error.c \ 10 ctf_hash.c \ 11 ctf_labels.c \ 12 ctf_lib.c \ 13 ctf_lookup.c \ 14 ctf_open.c \ 15 ctf_subr.c \ 16 ctf_types.c \ 17 ctf_util.c 18 19 OSNETDIR= ${.CURDIR}/../../external/cddl/osnet 20 OPENSOLARIS_DISTDIR= ${OSNETDIR}/dist 21 LIBELF_DIR= ${.CURDIR}/../../external/bsd/elftoolchain/dist/libelf 22 23 CPPFLAGS+= -DCTF_OLD_VERSIONS 24 25 .ifndef NOCOMPATLIB 26 COMPATLIB_NO_LIB= yes # only the include files, not the library 27 .-include "${TOOLDIR}/share/compat/defs.mk" 28 .endif 29 30 CPPFLAGS+= -I${.CURDIR}/../compat \ 31 -I${OSNETDIR}/sys \ 32 -I${OSNETDIR}/include \ 33 -I${OPENSOLARIS_DISTDIR}/head \ 34 -I${OPENSOLARIS_DISTDIR}/common/ctf \ 35 -I${OPENSOLARIS_DISTDIR}/lib/libctf/common \ 36 -I${OPENSOLARIS_DISTDIR}/uts/common \ 37 -I${LIBELF_DIR} \ 38 -I${TOOLDIR}/include 39 40 BUILD_OSTYPE!= uname -s 41 42 # Disable use of pre-compiled headers on Darwin. 43 .if ${BUILD_OSTYPE} == "Darwin" 44 CPPFLAGS+= -no-cpp-precomp 45 .endif 46 47 # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and 48 # other file ops, on many systems, without changing function names. 49 50 CPPFLAGS+= -DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64 51 52 .PATH: ${OPENSOLARIS_DISTDIR}/common/ctf 53 .PATH: ${OPENSOLARIS_DISTDIR}/lib/libctf/common 54 55 HOST_CPPFLAGS:= ${CPPFLAGS} ${HOST_CPPFLAGS} 56 CPPFLAGS:= # empty 57 58 realinstall: install.host 59 install.host: ${TOOLDIR}/lib/libctf.a 60 ${TOOLDIR}/lib/libctf.a:: libctf.a 61 ${_MKTARGET_INSTALL} 62 mkdir -p ${TOOLDIR}/lib 63 ${HOST_INSTALL_FILE} -m ${BINMODE} libctf.a ${.TARGET} 64 65 .include <bsd.hostlib.mk> 66