1 # Copyright 1999-2011 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
4 # @ECLASS: bsdmk.eclass
7 # @BLURB: Some functions for BSDmake
9 inherit toolchain-funcs portability flag-o-matic
11 EXPORT_FUNCTIONS src_compile src_install
14 # this should actually be BDEPEND, but this works.
15 DEPEND="virtual/pmake"
19 # @ECLASS-VARIABLE: mymakeopts
21 # Options for bsd-make
23 # @FUNCTION: append-opt
26 # append options to enable or disable features
28 mymakeopts="${mymakeopts} $@"
34 # calls bsd-make command with the given options, passing ${mymakeopts} to
35 # enable ports to useflags bridge.
37 [[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
39 tc-export CC CXX LD RANLIB
41 ${BMAKE} ${MAKEOPTS} ${EXTRA_EMAKE} ${mymakeopts} NO_WERROR= STRIP= "$@"
44 # @FUNCTION: mkinstall
47 # Calls "bsd-make install" with the given options, passing ${mamakeopts} to
48 # enable ports to useflags bridge
50 [[ -z ${BMAKE} ]] && BMAKE="$(get_bmake)"
52 # STRIP= will replace the default value of -s, leaving to portage the
53 # task of stripping executables.
54 ${BMAKE} ${mymakeopts} NO_WERROR= STRIP= MANSUBDIR= DESTDIR="${D}" "$@" install
58 # @USAGE: < dirnames >
60 # removes the specified subdirectories and creates a dummy makefile in them
61 # useful to remove the need for "minimal" patches
64 [ -d ${dir} ] || ewarn "dummy_mk called on a non-existing directory: $dir"
65 [ -f ${dir}/Makefile ] || ewarn "dummy_mk called on a directory without Makefile: $dir"
66 echo ".include <bsd.lib.mk>" > ${dir}/Makefile
70 # @FUNCTION: bsdmk_src_compile
72 # The bsdmk src_compile function, which is exported
74 mkmake "$@" || die "make failed"
77 # @FUNCTION: bsdmk_src_install
79 # The bsdmk src_install function, which is exported
81 mkinstall "$@" || die "install failed"