# $OpenBSD: Makefile.bsd-wrapper,v 1.15 2018/07/26 13:20:53 kettenis Exp $ .include TARGET_ARCH?= ${MACHINE_ARCH} SUBDIRS= opcodes bfd CONF_SUBDIRS= opcodes bfd CFLAGS+= ${PIE_DEFAULT} # This allows moving the whole binutils installation around for # testing purposes PREFIX=/usr .if ${PREFIX} != "/usr" MANDIR=${PREFIX}/share/man/man .endif MAN= binutils/doc/addr2line.1 binutils/doc/objcopy.1 \ binutils/doc/objdump.1 binutils/doc/readelf.1 \ c++filt.1 #### gdb comes from older binutils at the moment ###CONF_SUBDIRS+= gdb ###SUBDIRS+= gdb ###INST_SUBDIRS+= gdb ###MAN+= gdb/gdb.1 SUBDIRS+= binutils CONF_SUBDIRS+= binutils INST_SUBDIRS+= binutils MAN+= binutils/doc/ar.1 binutils/doc/ranlib.1 \ binutils/doc/strings.1 binutils/doc/strip.1 .if ${TARGET_ARCH} != "aarch64" SUBDIRS+= ld gas CONF_SUBDIRS+= ld gas INST_SUBDIRS+= ld gas MAN+= gas/doc/as.1 ld/ld.bfd.1 .if ${LINKER_VERSION:L} == "bfd" MLINKS+= ld.bfd.1 ld.1 .endif .endif # Used by the GNU Makefile ALL_MODULES=${SUBDIRS:S/^/all-/g} CONFIGURE_MODULES=${CONF_SUBDIRS:S/^/configure-/g} CONFIGURE_HOST_MODULES=${CONF_SUBDIRS:S/^/configure-/g} ALL_HOST_MODULES=${SUBDIRS:S/^/all-/g} INSTALL_MODULES=${INST_SUBDIRS:S/^/install-/g} INFO_HOST_MODULES=${SUBDIRS:S/^/info-/g} INSTALL_INFO_HOST_MODULES=${INST_SUBDIRS:S/^/install-info-/g} .if defined(CROSSDIR) CONFIGTARGET=--target=${TARGET_ARCH}-unknown-openbsd${OSREV} .else CONFIGTARGET= .endif .if ${TARGET_ARCH} == "aarch64" CONFIGTARGET+=--without-gnu-ld CONFIGTARGET+=--without-gnu-as .endif all: config.status SUBDIRS='${SUBDIRS}' \ CONFIGURE_HOST_MODULES='${CONFIGURE_HOST_MODULES}' \ ${MAKE} CC="${CC}" \ CFLAGS="${CFLAGS} ${COPTS}" LDFLAGS=${LDSTATIC} \ scriptdir=${PREFIX}/libdata \ tooldir=${PREFIX} \ MAKEINFO='makeinfo --no-split' \ MAKEINFOFLAGS='' \ BSDSRCDIR=${BSDSRCDIR} \ ALL_MODULES="${ALL_MODULES}" \ ALL_HOST_MODULES='${ALL_HOST_MODULES}' \ INFO_HOST_MODULES='${INFO_HOST_MODULES}' all info .include .ifdef GLOBAL_AUTOCONF_CACHE CF= --cache-file=${GLOBAL_AUTOCONF_CACHE} .else CF= .endif do-config: .USE PATH="/bin:/usr/bin:/sbin:/usr/sbin" \ MAKEINFO='makeinfo --no-split' \ sh ${.CURDIR}/configure --prefix=${PREFIX} \ --infodir='$${prefix}/share/info' \ --disable-nls --disable-gdbtk --disable-install-libbfd ${CF} \ ${CONFIGTARGET} cd ${.OBJDIR} && \ sed -e 's,SUBDIRS *=,SUBDIRS ?=,' Makefile.tmp && \ mv -f Makefile.tmp Makefile cd ${.OBJDIR} && \ ${MAKE} ${CONFIGURE_MODULES} gas/doc/as.1: config.status cd ${.OBJDIR}/gas/doc && ${MAKE} as.1 ld/ld.bfd.1: config.status cd ${.OBJDIR}/ld && ${MAKE} ld.1 mv ld/ld.1 ld/ld.bfd.1 config: do-config .ifndef GLOBAL_AUTOCONF_CACHE -rm -f config.cache .endif config.status: do-config # Need to pass SUBDIRS because of install-info install: maninstall ${INSTALL} -d -o ${BINOWN} -g ${BINGRP} \ ${DESTDIR}${PREFIX}/libdata/ldscripts SUBDIRS='${INST_SUBDIRS}' ${MAKE} DESTDIR='${DESTDIR}' \ INSTALL_MAN= \ scriptdir=${PREFIX}/libdata \ tooldir=${PREFIX} \ BSDSRCDIR=${BSDSRCDIR} \ INSTALL_MODULES='${INSTALL_MODULES}' \ INSTALL_PROGRAM='${INSTALL} -c -S ${INSTALL_STRIP} -o ${BINOWN} -g ${BINGRP} -m ${BINMODE}' \ INSTALL_DATA='${INSTALL} -c -o ${DOCOWN} -g ${DOCGRP} -m ${NONBINMODE}' \ INSTALL_INFO_HOST_MODULES='${INSTALL_INFO_HOST_MODULES}' \ install install-info .if ${LINKER_VERSION:L} == "bfd" rm -f ${DESTDIR}${PREFIX}/bin/ld ln ${DESTDIR}${PREFIX}/bin/ld.bfd ${DESTDIR}${PREFIX}/bin/ld .endif clean cleandir: -@if [ -e Makefile ]; then ${MAKE} distclean; fi c++filt.1: binutils/doc/cxxfilt.man sed -e 's,@PROGRAM@,c++filt,' <${.CURDIR}/binutils/doc/cxxfilt.man >$@ depend: # Nothing here so far... tags: # Nothing here so far... BEFOREMAN=config.status .PHONY: config .include .include .ifdef NOMAN maninstall: @echo NOMAN is set .else .include .endif