1# $NetBSD: Makefile,v 1.13 2015/03/28 07:03:23 matt Exp $ 2 3NOLINKLIB= # defined 4NOLINT= # defined 5NOMAN= # defined 6NOPROFILE= # defined 7NOCLANGERROR= # defined 8 9.include <bsd.own.mk> 10 11# If the platform does not support shared libraries, we need to supply 12# *something* for BFD-using programs to link against. Also provide an 13# empty libinstall target so that libbfd.a does not get installed. 14.if ${MKPIC} == "no" 15MKLINKLIB= yes 16libinstall: # do nothing 17.endif 18 19LIB= bfd 20 21BFD_MACHINE_ARCH?= ${MACHINE_ARCH:C/armv[4-7]/arm/} 22 23DEFS_MK=${.CURDIR}/arch/${BFD_MACHINE_ARCH}/defs.mk 24 25.if exists(${DEFS_MK}) 26.include "${DEFS_MK}" 27 28DIST= ${NETBSDSRCDIR}/external/gpl3/binutils/dist 29 30SHLIB_MAJOR= 13 31SHLIB_MINOR= 0 32 33LIBDPLIBS+= z ${.CURDIR}/../../../../../lib/libz 34 35GCPPFLAGS= ${G_archdefs} ${G_DEFS} ${G_INCLUDES} ${G_TDEFAULTS} 36CPPFLAGS+= -I${.CURDIR}/arch/${BFD_MACHINE_ARCH} -I${DIST}/include -I. \ 37 -I${DIST}/bfd ${GCPPFLAGS:M-D*} ${GCPPFLAGS:M-I*:N-I.*} \ 38 -DDEBUGDIR=\"${DEBUGDIR}\" 39 40.if (${BFD_MACHINE_ARCH} == "vax") 41CPPFLAGS.elf.c += -O0 42.endif 43 44GSRCS= ${G_libbfd_la_OBJECTS:libbfd.lo=lib_bfd.lo} \ 45 ${G_libbfd_la_DEPENDENCIES:M*.lo} 46SRCS= ${GSRCS:.lo=.c} 47 48DPSRCS+= elf32-target.h elf64-target.h targmatch.h \ 49 elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \ 50 pex64igen.c 51CLEANFILES+= elf32-target.h elf64-target.h targmatch.h \ 52 elf32-ia64.c elf64-ia64.c peigen.c pepigen.c \ 53 pex64igen.c 54 55TEXINFO= bfd.texinfo 56INFOFLAGS= -I${DIST}/bfd/doc 57 58.PATH: ${DIST}/bfd ${DIST}/bfd/doc 59 60.include <bsd.lib.mk> 61.include <bsd.info.mk> 62 63${OBJS} ${SOBJS}: elf32-target.h elf64-target.h 64targets.o targets.pico: targmatch.h Makefile 65.else 66.include <bsd.prog.mk> # do nothing 67.endif 68 69targmatch.h: config.bfd targmatch.sed 70 ${_MKTARGET_CREATE} 71 ${TOOL_SED} -f ${.ALLSRC:M*.sed} ${.ALLSRC:M*.bfd} >$@ 72 73elf32-target.h: elfxx-target.h 74 ${_MKTARGET_CREATE} 75 ${TOOL_SED} -e s/NN/32/g < $> > $@ 76 77elf64-target.h: elfxx-target.h 78 ${_MKTARGET_CREATE} 79 ${TOOL_SED} -e s/NN/64/g < $> > $@ 80 81elf32-ia64.c: elfnn-ia64.c 82 ${_MKTARGET_CREATE} 83 ${TOOL_SED} -e s/NN/32/g < $> > $@ 84 85elf64-ia64.c: elfnn-ia64.c 86 ${_MKTARGET_CREATE} 87 ${TOOL_SED} -e s/NN/64/g < $> > $@ 88 89elf32-riscv.c: elfnn-riscv.c 90 ${_MKTARGET_CREATE} 91 ${TOOL_SED} -e s/NN/32/g < $> > $@ 92 93elf64-riscv.c: elfnn-riscv.c 94 ${_MKTARGET_CREATE} 95 ${TOOL_SED} -e s/NN/64/g < $> > $@ 96 97peigen.c: peXXigen.c 98 ${_MKTARGET_CREATE} 99 ${TOOL_SED} -e s/XX/pe/g < $> > $@ 100 101pepigen.c: peXXigen.c 102 ${_MKTARGET_CREATE} 103 ${TOOL_SED} -e s/XX/pep/g < $> > $@ 104 105pex64igen.c: peXXigen.c 106 ${_MKTARGET_CREATE} 107 ${TOOL_SED} -e s/XX/pex64/g < $> > $@ 108