1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
5 # All consumers are gone. Removal in 14 days
7 # @ECLASS: bsdmk.eclass
9 # maintainer-needed@gentoo.org
10 # @BLURB: Some functions for BSDmake
12 inherit toolchain-funcs portability flag-o-matic
14 EXPORT_FUNCTIONS src_compile src_install
17 # this should actually be BDEPEND, but this works.
18 DEPEND="virtual/pmake"
22 # @ECLASS-VARIABLE: mymakeopts
24 # Options for bsd-make
26 # @FUNCTION: append-opt
29 # append options to enable or disable features
31 mymakeopts="${mymakeopts} $@"
37 # calls bsd-make command with the given options, passing ${mymakeopts} to
38 # enable ports to useflags bridge.
40 [[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
42 tc-export CC CXX LD RANLIB
44 set -- ${BMAKE} ${MAKEOPTS} ${EXTRA_EMAKE} ${mymakeopts} NO_WERROR= STRIP= "$@"
49 # @FUNCTION: mkinstall
52 # Calls "bsd-make install" with the given options, passing ${mamakeopts} to
53 # enable ports to useflags bridge
55 [[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
57 # STRIP= will replace the default value of -s, leaving to portage the
58 # task of stripping executables.
59 set -- ${BMAKE} ${mymakeopts} NO_WERROR= STRIP= MANSUBDIR= DESTDIR="${D}" "$@" install
65 # @USAGE: < dirnames >
67 # removes the specified subdirectories and creates a dummy makefile in them
68 # useful to remove the need for "minimal" patches
71 [ -d ${dir} ] || ewarn "dummy_mk called on a non-existing directory: $dir"
72 [ -f ${dir}/Makefile ] || ewarn "dummy_mk called on a directory without Makefile: $dir"
73 echo ".include <bsd.lib.mk>" > ${dir}/Makefile
77 # @FUNCTION: bsdmk_src_compile
79 # The bsdmk src_compile function, which is exported
81 mkmake "$@" || die "make failed"
84 # @FUNCTION: bsdmk_src_install
86 # The bsdmk src_install function, which is exported
88 mkinstall "$@" || die "install failed"