1 # showcasing several default install directories
2 install a1 : a : <location>(bindir) ;
3 install a2 : a : <location>(libdir)/a2 ;
4 install (sbindir)/a3 : a ;
6 # using a custom prefix; the file will be installed into foo/bar/bin/a4
7 install (bindir)/a4 : a : <install-prefix>foo/bar ;
9 # this one deduces installed package name to be the basename of the project
10 # directory, so e.g. on Linux the file will be installed installed into
11 # /usr/local/share/doc/<name of project's directory>/a5
12 install (docdir)/a5 : a : <install-prefix>bar/baz ;
14 # use a custom named directory; its default on Linux is /usr/local/share/xyz/
16 stage.add-install-dir foodir : xyz : datadir ;
17 install (foodir)/a6 : a ;
20 # another custom named directory, this one appends package name like docdir;
21 # so, e.g. on Linux it defaults to /usr/local/lib/named-install-dirs
22 stage.add-install-dir privatedir : "" : libdir : package-suffix ;
23 install (privatedir)/a7 : a ;
25 # using stage.get-package-name
26 make a8 : a : @write-dirs : <staging-prefix>p/q/r <install-bindir>/bin ;
28 rule write-dirs ( target : sources * : properties * )
32 local ps = [ property-set.create $(properties) ] ;
33 local pn = [ stage.get-package-name $(ps) ] ;
34 print.output $(target) ;
36 [ stage.get-dir docdir : $(ps) : $(pn) ]
37 [ stage.get-dir docdir : $(ps) : $(pn) : staged ]
38 [ stage.get-dir docdir : $(ps) : $(pn) : relative ]
39 [ stage.get-dir docdir : $(ps) : $(pn) : relative staged ]
40 [ stage.get-dir bindir : $(ps) : $(pn) : relative ]
45 # using staging prefix; on Linux installs into q/r/s/share/a9
46 install (datarootdir)/a9 : a : <staging-prefix>q/r/s ;
51 # Copyright 2020 Dmitry Arkhipov
52 # Distributed under the Boost Software License, Version 1.0.
53 # (See accompanying file LICENSE.txt or copy at
54 # https://www.bfgroup.xyz/b2/LICENSE.txt)