Home | History | Annotate | Line # | Download | only in libelf
Makefile revision 1.1
      1  1.1  jkoshy #	$NetBSD: Makefile,v 1.1 2022/04/18 14:11:44 jkoshy Exp $
      2  1.1  jkoshy 
      3  1.1  jkoshy HOSTLIB=	elf
      4  1.1  jkoshy 
      5  1.1  jkoshy .include <bsd.hostinit.mk>
      6  1.1  jkoshy 
      7  1.1  jkoshy SRCS=		elf_begin.c						\
      8  1.1  jkoshy 		elf_cntl.c						\
      9  1.1  jkoshy 		elf_end.c elf_errmsg.c elf_errno.c			\
     10  1.1  jkoshy 		elf_data.c						\
     11  1.1  jkoshy 		elf_fill.c elf_flag.c					\
     12  1.1  jkoshy 		elf_getarhdr.c elf_getarsym.c elf_getbase.c		\
     13  1.1  jkoshy 		    elf_getident.c					\
     14  1.1  jkoshy 		elf_hash.c						\
     15  1.1  jkoshy 		elf_kind.c						\
     16  1.1  jkoshy 		elf_memory.c						\
     17  1.1  jkoshy 		elf_next.c						\
     18  1.1  jkoshy 		elf_rand.c elf_rawfile.c				\
     19  1.1  jkoshy 		elf_phnum.c						\
     20  1.1  jkoshy 		elf_shnum.c elf_shstrndx.c elf_scn.c elf_strptr.c	\
     21  1.1  jkoshy 		elf_update.c						\
     22  1.1  jkoshy 		elf_version.c						\
     23  1.1  jkoshy 		gelf_cap.c						\
     24  1.1  jkoshy 		gelf_checksum.c						\
     25  1.1  jkoshy 		gelf_dyn.c						\
     26  1.1  jkoshy 		gelf_ehdr.c						\
     27  1.1  jkoshy 		gelf_getclass.c						\
     28  1.1  jkoshy 		gelf_fsize.c						\
     29  1.1  jkoshy 		gelf_move.c						\
     30  1.1  jkoshy 		gelf_phdr.c						\
     31  1.1  jkoshy 		gelf_rel.c gelf_rela.c					\
     32  1.1  jkoshy 		gelf_shdr.c gelf_sym.c gelf_syminfo.c gelf_symshndx.c	\
     33  1.1  jkoshy 		gelf_xlate.c						\
     34  1.1  jkoshy 		elf.c							\
     35  1.1  jkoshy 		libelf_align.c libelf_allocate.c libelf_ar.c		\
     36  1.1  jkoshy 		libelf_ar_util.c					\
     37  1.1  jkoshy 		libelf_checksum.c					\
     38  1.1  jkoshy 		libelf_data.c						\
     39  1.1  jkoshy 		libelf_ehdr.c libelf_extended.c				\
     40  1.1  jkoshy 		libelf_memory.c						\
     41  1.1  jkoshy 		libelf_open.c						\
     42  1.1  jkoshy 		libelf_phdr.c						\
     43  1.1  jkoshy 		libelf_shdr.c						\
     44  1.1  jkoshy 		libelf_xlate.c						\
     45  1.1  jkoshy 		${LIBELF_GENSRCS}
     46  1.1  jkoshy 
     47  1.1  jkoshy LIBELF_GENSRCS=	libelf_fsize.c libelf_msize.c libelf_convert.c
     48  1.1  jkoshy 
     49  1.1  jkoshy LIBELF_DIR=	${.CURDIR}/../../../external/bsd/elftoolchain/dist/libelf
     50  1.1  jkoshy LIBELF_OBJDIR!=	cd ${.CURDIR} && ${PRINTOBJDIR}
     51  1.1  jkoshy 
     52  1.1  jkoshy CLEANFILES+=	${LIBELF_GENSRCS}
     53  1.1  jkoshy CPPFLAGS+=	-I${.CURDIR}/../../compat
     54  1.1  jkoshy CPPFLAGS+=	-I${LIBELF_DIR} -I${LIBELF_DIR}/../common
     55  1.1  jkoshy CPPFLAGS+=	-I${LIBELF_OBJDIR}/../common
     56  1.1  jkoshy CPPFLAGS+=	-I${TOOLDIR}/include -I${TOOLDIR}/include/nbinclude
     57  1.1  jkoshy 
     58  1.1  jkoshy CPPFLAGS+=	-DLIBELF_TEST_HOOKS
     59  1.1  jkoshy 
     60  1.1  jkoshy libelf_convert.c:	elf_types.m4 libelf_convert.m4
     61  1.1  jkoshy libelf_fsize.c:		elf_types.m4 libelf_fsize.m4
     62  1.1  jkoshy libelf_msize.c:		elf_types.m4 libelf_msize.m4
     63  1.1  jkoshy 
     64  1.1  jkoshy BUILD_OSTYPE!=  uname -s
     65  1.1  jkoshy 
     66  1.1  jkoshy # Disable use of pre-compiled headers on Darwin.
     67  1.1  jkoshy .if ${BUILD_OSTYPE} == "Darwin"
     68  1.1  jkoshy CPPFLAGS+=	-no-cpp-precomp
     69  1.1  jkoshy .endif
     70  1.1  jkoshy 
     71  1.1  jkoshy # -D_FILE_OFFSET_BITS=64 produces a much more amenable `struct stat', and
     72  1.1  jkoshy # other file ops, on many systems, without changing function names.
     73  1.1  jkoshy 
     74  1.1  jkoshy CPPFLAGS+=	-DHAVE_NBTOOL_CONFIG_H=1 -D_FILE_OFFSET_BITS=64
     75  1.1  jkoshy .ifndef NOCOMPATLIB
     76  1.1  jkoshy COMPATLIB_NO_LIB= yes # only the include files, not the library
     77  1.1  jkoshy .-include	"${TOOLDIR}/share/compat/defs.mk"
     78  1.1  jkoshy .endif
     79  1.1  jkoshy 
     80  1.1  jkoshy .PATH:		${LIBELF_DIR}
     81  1.1  jkoshy 
     82  1.1  jkoshy HOST_CPPFLAGS:=	${CPPFLAGS} ${HOST_CPPFLAGS}
     83  1.1  jkoshy CPPFLAGS:=	# empty
     84  1.1  jkoshy 
     85  1.1  jkoshy .include <bsd.hostlib.mk>
     86  1.1  jkoshy 
     87  1.1  jkoshy # Keep the .SUFFIXES line after the include of bsd.hostlib.mk
     88  1.1  jkoshy M4OBJDIR!=	cd ${.CURDIR}/../../m4 && ${PRINTOBJDIR}
     89  1.1  jkoshy .SUFFIXES:	.m4 .c
     90  1.1  jkoshy .m4.c:
     91  1.1  jkoshy 	${M4OBJDIR}/m4 -D SRCDIR=${LIBELF_DIR} ${.IMPSRC} > ${.TARGET}
     92