diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-31 12:52:20 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2015-07-31 12:52:20 +0200 |
commit | bbd0f3bb21442a2833916110cbe8e9a07e9f4c1f (patch) | |
tree | d25de6f2bcfa4b6cabe1fd55a1b8f508005de4c1 /build/target | |
parent | 729b56300c441a0d63c7d2013eb5a881211d352b (diff) |
Essential install module functionality
Diffstat (limited to 'build/target')
-rw-r--r-- | build/target | 68 |
1 files changed, 68 insertions, 0 deletions
diff --git a/build/target b/build/target index f777268..dbfe9a8 100644 --- a/build/target +++ b/build/target @@ -952,6 +952,74 @@ namespace build static const target_type static_type; }; + // Common documentation file targets. + // + // @@ Maybe these should be in the built-in doc module? + // + class doc: public file + { + public: + using file::file; + + public: + virtual const target_type& type () const {return static_type;} + static const target_type static_type; + }; + + // The problem with man pages is this: different platforms have + // different sets of sections. What seems to be the "sane" set + // is 1-9 (Linux and BSDs). SysV (e.g., Solaris) instead maps + // 8 to 1M (system administration). The section determines two + // things: the directory where the page is installed (e.g., + // /usr/share/man/man1) as well as the extension of the file + // (e.g., test.1). Note also that there could be sub-sections, + // e.g., 1p (for POSIX). Such a page would still go into man1 + // but will have the .1p extension (at least that's what happens + // on Linux). The challenge is to somehow handle this in a + // portable manner. So here is the plan: + // + // First of all, we have the man{} target type which can be used + // for a custom man page. That is, you can have any extension and + // install it anywhere you please: + // + // man{foo.X}: install = man/manX + // + // Then we have man1..9{} target types which model the "sane" + // section set and that would be automatically installed into + // correct locations on other platforms. In other words, the + // idea is that you should be able to have the foo.8 file, + // write man8{foo} and have it installed as man1m/foo.1m on + // some SysV host. + // + // Re-mapping the installation directory is easy: to help with + // that we have assigned install.man1..9 directory names. The + // messy part is to change the extension. It seems the only + // way to do that would be to have special logic for man pages + // in the generic install rule. @@ This is still a TODO. + // + // Note that handling subsections with man1..9{} is easy, we + // simply specify the extension explicitly, e.g., man{foo.1p}. + // + class man: public doc + { + public: + using doc::doc; + + public: + virtual const target_type& type () const {return static_type;} + static const target_type static_type; + }; + + class man1: public man + { + public: + using man::man; + + public: + virtual const target_type& type () const {return static_type;} + static const target_type static_type; + }; + // Common implementation of the target factory, extension, and // search functions. // |