# $OpenBSD: Makefile.bsd-wrapper,v 1.58 2004/06/01 23:01:44 drahn Exp $ NEW_BINUTILS=alpha arm hppa i386 mips powerpc sparc sparc64 amd64 .for _arch in ${MACHINE_ARCH} . if !empty(NEW_BINUTILS:M${_arch}) USING_NEW_BINUTILS=yes .else USING_NEW_BINUTILS=no . endif .endfor SUBDIRS= CONF_SUBDIRS= ALL_X11_MODULES= INSTALL_X11_MODULES= .if ${USING_NEW_BINUTILS} == "yes" CONF_SUBDIRS+= opcodes bfd SUBDIRS+= opcodes bfd INST_SUBDIRS+= opcodes bfd .else CONF_SUBDIRS+= opcodes bfd SUBDIRS+= opcodes bfd .endif ALL_X11_MODULES= INSTALL_X11_MODULES= # This allows moving the whole binutils installation around for # testing purposes PREFIX=/usr .if ${PREFIX} != "/usr" MANDIR=${PREFIX}/share/man/cat .endif MAN= binutils/objdump.1 c++filt.1 .if (${MACHINE_ARCH} != "unknown") CONF_SUBDIRS+= gdb SUBDIRS+= gdb INST_SUBDIRS+= gdb MAN+= gdb/gdb.1 ALL_X11_MODULES+=all-gdb INSTALL_X11_MODULES+=install-gdb .endif .if ${USING_NEW_BINUTILS} == "yes" SUBDIRS+= binutils ld gas CONF_SUBDIRS+= binutils ld gas INST_SUBDIRS+= binutils ld gas MAN+= binutils/ar.1 binutils/ranlib.1 \ binutils/objcopy.1 \ binutils/strings.1 binutils/strip.1 \ gas/doc/as.1 ld/ld.1 . else CONF_SUBDIRS=${SUBDIRS} CONF_SUBDIRS+= binutils .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} all: config.status SUBDIRS='${SUBDIRS}' \ CONFIGURE_HOST_MODULES='${CONFIGURE_HOST_MODULES}' \ ${MAKE} CC="${CC}" \ CFLAGS="${CFLAGS} ${COPTS}" LDFLAGS=${LDSTATIC} \ scriptdir=${PREFIX}/libdata \ tooldir=${PREFIX} \ BSDSRCDIR=${BSDSRCDIR} \ ALL_MODULES="${ALL_MODULES}" \ ALL_HOST_MODULES='${ALL_HOST_MODULES}' \ ALL_X11_MODULES="${ALL_X11_MODULES}" all info .if ${USING_NEW_BINUTILS} != "yes" cd ${.OBJDIR}/binutils && \ ${MAKE} CC="${CC}" CFLAGS="${CFLAGS} ${COPTS}" \ LDFLAGS=${LDSTATIC} objdump .endif .include .ifdef GLOBAL_AUTOCONF_CACHE CF= --cache-file=${GLOBAL_AUTOCONF_CACHE} .else CF= .endif do-config: .USE PATH="/bin:/usr/bin:/sbin:/usr/sbin" \ sh ${.CURDIR}/configure --prefix=${PREFIX} \ --infodir='$${prefix}/share/info' \ --disable-nls --disable-gdbtk --disable-commonbfdlib ${CF} cd ${.OBJDIR} && \ sed -e 's,SUBDIRS *=,SUBDIRS ?=,' Makefile.tmp && \ mv -f Makefile.tmp Makefile cd ${.OBJDIR} && \ ${MAKE} ${CONFIGURE_MODULES} 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 SUBDIRS='${INST_SUBDIRS}' ${MAKE} DESTDIR='${DESTDIR}' \ INSTALL_X11_MODULES="${INSTALL_X11_MODULES}" \ INSTALL_MAN= \ scriptdir=${PREFIX}/libdata \ tooldir=${PREFIX} \ BSDSRCDIR=${BSDSRCDIR} \ INSTALL_MODULES='${INSTALL_MODULES}' install install-info .if ${USING_NEW_BINUTILS} != "yes" cd ${.OBJDIR}/binutils && \ ${INSTALL} ${INSTALL_COPY} ${INSTALL_STRIP} -o ${BINOWN} \ -g ${BINGRP} -m ${BINMODE} objdump ${DESTDIR}${PREFIX}/bin .endif clean cleandir: -@if [ -e Makefile ]; then ${MAKE} distclean; fi prereq: config.status cd ${.OBJDIR}/bfd && ${MAKE} bfd.h # we don't install ansidecl.h, we merge it into the file that # needs it instead. sed -e '/^#include "ansidecl.h"/r${.CURDIR}/include/ansidecl.h' -e '//d' \ bfd/bfd.h >bfd/mybfd.h c++filt.1: binutils/cxxfilt.man sed -e 's,@PROGRAM@,c++filt,' <${.CURDIR}/binutils/cxxfilt.man >$@ includes: .if ${USING_NEW_BINUTILS} == "yes" install -C -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \ ${.CURDIR}/include/bfdlink.h ${DESTDIR}/usr/include install -C -o ${BINOWN} -g ${BINGRP} -m ${NONBINMODE} \ bfd/mybfd.h ${DESTDIR}/usr/include/bfd.h .endif depend: # Nothing here so far... lint: # Nothing here so far... tags: # Nothing here so far... .PHONY: config .include .include .ifdef NOMAN maninstall: @echo NOMAN is set .else .include .endif