Makefile revision 1.1
11.1Sjkoshy#	$NetBSD: Makefile,v 1.1 2022/04/18 14:11:44 jkoshy Exp $
21.1Sjkoshy
31.1SjkoshyHOSTLIB=	elf
41.1Sjkoshy
51.1Sjkoshy.include <bsd.hostinit.mk>
61.1Sjkoshy
71.1SjkoshySRCS=		elf_begin.c						\
81.1Sjkoshy		elf_cntl.c						\
91.1Sjkoshy		elf_end.c elf_errmsg.c elf_errno.c			\
101.1Sjkoshy		elf_data.c						\
111.1Sjkoshy		elf_fill.c elf_flag.c					\
121.1Sjkoshy		elf_getarhdr.c elf_getarsym.c elf_getbase.c		\
131.1Sjkoshy		    elf_getident.c					\
141.1Sjkoshy		elf_hash.c						\
151.1Sjkoshy		elf_kind.c						\
161.1Sjkoshy		elf_memory.c						\
171.1Sjkoshy		elf_next.c						\
181.1Sjkoshy		elf_rand.c elf_rawfile.c				\
191.1Sjkoshy		elf_phnum.c						\
201.1Sjkoshy		elf_shnum.c elf_shstrndx.c elf_scn.c elf_strptr.c	\
211.1Sjkoshy		elf_update.c						\
221.1Sjkoshy		elf_version.c						\
231.1Sjkoshy		gelf_cap.c						\
241.1Sjkoshy		gelf_checksum.c						\
251.1Sjkoshy		gelf_dyn.c						\
261.1Sjkoshy		gelf_ehdr.c						\
271.1Sjkoshy		gelf_getclass.c						\
281.1Sjkoshy		gelf_fsize.c						\
291.1Sjkoshy		gelf_move.c						\
301.1Sjkoshy		gelf_phdr.c						\
311.1Sjkoshy		gelf_rel.c gelf_rela.c					\
321.1Sjkoshy		gelf_shdr.c gelf_sym.c gelf_syminfo.c gelf_symshndx.c	\
331.1Sjkoshy		gelf_xlate.c						\
341.1Sjkoshy		elf.c							\
351.1Sjkoshy		libelf_align.c libelf_allocate.c libelf_ar.c		\
361.1Sjkoshy		libelf_ar_util.c					\
371.1Sjkoshy		libelf_checksum.c					\
381.1Sjkoshy		libelf_data.c						\
391.1Sjkoshy		libelf_ehdr.c libelf_extended.c				\
401.1Sjkoshy		libelf_memory.c						\
411.1Sjkoshy		libelf_open.c						\
421.1Sjkoshy		libelf_phdr.c						\
431.1Sjkoshy		libelf_shdr.c						\
441.1Sjkoshy		libelf_xlate.c						\
451.1Sjkoshy		${LIBELF_GENSRCS}
461.1Sjkoshy
471.1SjkoshyLIBELF_GENSRCS=	libelf_fsize.c libelf_msize.c libelf_convert.c
481.1Sjkoshy
491.1SjkoshyLIBELF_DIR=	${.CURDIR}/../../../external/bsd/elftoolchain/dist/libelf
501.1SjkoshyLIBELF_OBJDIR!=	cd ${.CURDIR} && ${PRINTOBJDIR}
511.1Sjkoshy
521.1SjkoshyCLEANFILES+=	${LIBELF_GENSRCS}
531.1SjkoshyCPPFLAGS+=	-I${.CURDIR}/../../compat
541.1SjkoshyCPPFLAGS+=	-I${LIBELF_DIR} -I${LIBELF_DIR}/../common
551.1SjkoshyCPPFLAGS+=	-I${LIBELF_OBJDIR}/../common
561.1SjkoshyCPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
571.1Sjkoshy
581.1SjkoshyCPPFLAGS+=	-DLIBELF_TEST_HOOKS
591.1Sjkoshy
601.1Sjkoshylibelf_convert.c:	elf_types.m4 libelf_convert.m4
611.1Sjkoshylibelf_fsize.c:		elf_types.m4 libelf_fsize.m4
621.1Sjkoshylibelf_msize.c:		elf_types.m4 libelf_msize.m4
631.1Sjkoshy
641.1SjkoshyBUILD_OSTYPE!=  uname -s
651.1Sjkoshy
661.1Sjkoshy# Disable use of pre-compiled headers on Darwin.
671.1Sjkoshy.if ${BUILD_OSTYPE} == "Darwin"
681.1SjkoshyCPPFLAGS+=	-no-cpp-precomp
691.1Sjkoshy.endif
701.1Sjkoshy
711.1Sjkoshy# -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
721.1Sjkoshy# other file ops, on many systems, without changing function names.
731.1Sjkoshy
741.1SjkoshyCPPFLAGS+=	-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
751.1Sjkoshy.ifndef NOCOMPATLIB
761.1SjkoshyCOMPATLIB_NO_LIB= yes # only the include files, not the library
771.1Sjkoshy.-include	"${TOOLDIR}/share/compat/defs.mk"
781.1Sjkoshy.endif
791.1Sjkoshy
801.1Sjkoshy.PATH:		${LIBELF_DIR}
811.1Sjkoshy
821.1SjkoshyHOST_CPPFLAGS:=	${CPPFLAGS} ${HOST_CPPFLAGS}
831.1SjkoshyCPPFLAGS:=	# empty
841.1Sjkoshy
851.1Sjkoshy.include <bsd.hostlib.mk>
861.1Sjkoshy
871.1Sjkoshy# Keep the .SUFFIXES line after the include of bsd.hostlib.mk
881.1SjkoshyM4OBJDIR!=	cd ${.CURDIR}/../../m4 && ${PRINTOBJDIR}
891.1Sjkoshy.SUFFIXES:	.m4 .c
901.1Sjkoshy.m4.c:
911.1Sjkoshy	${M4OBJDIR}/m4 -D SRCDIR=${LIBELF_DIR} ${.IMPSRC} > ${.TARGET}
92