Commit Graph

15 Commits

Author SHA1 Message Date
Alejandro Colomar 336ae0d258 Makefile, README: Break installation into a target for each mandir
Instead of having a monolithic 'make install', break it into
multiple targets such as 'make install-man3'.  This simplifies
packaging, for example in Debian, where they break this project
into several packages: 'manpages' and 'manpages-dev', each
containing different mandirs.

The above allows for multithread installation: 'make -j'

Also, don't overwrite files that don't need to be overwritten, by
having a target for files, which makes use of make's timestamp
comparison.

This allows for much faster installation times.

For comparison, on my laptop (i7-8850H; 6C/12T):

Old Makefile:
	~/src/linux/man-pages$ time sudo make >/dev/null

	real	0m7.509s
	user	0m5.269s
	sys	0m2.614s

	The times with the old makefile, varied a lot, between
	5 and 10 seconds.  The times after applying this patch
	are much more consistent.  BTW, I compared these times to
	the very old Makefile of man-pages-5-09, and those were
	around 3.5 s, so it was a bit of my fault to have such a
	slow Makefile, when I changed the Makefile some weeks ago.

New Makefile (full clean install):
	~/src/linux/man-pages$ time sudo make >/dev/null

	real	0m5.160s
	user	0m4.326s
	sys	0m1.137s
	~/src/linux/man-pages$ time sudo make -j2 >/dev/null

	real	0m1.602s
	user	0m2.529s
	sys	0m0.289s
	~/src/linux/man-pages$ time sudo make -j >/dev/null

	real	0m1.398s
	user	0m2.502s
	sys	0m0.281s

	Here we can see that 'make -j' drops times drastically,
	compared to the old monolithic Makefile.  Not only that,
	but since when we are working with the man pages there
	aren't many pages involved, times will be even better.

	Here are some times with a single page changed (touched):

New Makefile (one page touched):
	~/src/linux/man-pages$ touch man2/membarrier.2
	~/src/linux/man-pages$ time sudo make install
	-	INSTALL	/usr/local/share/man/man2/membarrier.2

	real	0m0.988s
	user	0m0.966s
	sys	0m0.025s
	~/src/linux/man-pages$ touch man2/membarrier.2
	~/src/linux/man-pages$ time sudo make install -j
	-	INSTALL	/usr/local/share/man/man2/membarrier.2

	real	0m0.989s
	user	0m0.943s
	sys	0m0.049s

Also, modify the output of the make install and uninstall commands
so that a line is output for each file or directory that is
installed, similarly to the kernel's Makefile.  This doesn't apply
to html targets, which haven't been changed in this commit.

Also, make sure that for each invocation of $(INSTALL_DIR), no
parents are created, (i.e., avoid `mkdir -p` behavior).  The GNU
make manual states that it can create race conditions.  Instead,
declare as a prerequisite for each directory its parent directory,
and let make resolve the order of creation.

Also, use ':=' instead of '=' to improve performance, by
evaluating each assignment only once.

Ensure than the shell is not called when not needed, by removing
all ";" and quotes in the commands.

See also: <https://stackoverflow.com/q/67862417/6872717>

Specify conventions and rationales used in the Makefile in a comment.

Add copyright.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-06-10 10:32:59 +12:00
Alejandro Colomar d25b924662 README: Update installation path
The installation path was changed recently (See 'prefix' in the
Makefile).  I forgot to update the README with those changes.
Fix it.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2021-05-12 04:53:57 +12:00
Michael Kerrisk e7722772c3 README: Remove "Man page overlap and duplication" section
The info here is mostly ancient, certainly incomplete,
and is not consistently maintained. Best to remove it, I think.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 09:06:45 +02:00
Michael Kerrisk 70d9d96aeb README: wfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-13 07:16:56 +02:00
Michael Kerrisk 1718760f88 README: Add section on "Bug reports and contributing"
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 23:09:25 +02:00
Michael Kerrisk dfc0dcf6e0 README: Move the "Home page" section to the top of the file
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2020-04-12 22:50:08 +02:00
Michael Kerrisk 3cd6e49403 README: tfix
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-05-13 20:14:15 +02:00
G. Branden Robinson 836a436804 README: Update generally
* Reflect fact that project ships pages in sections 1-8.

    * Resync documentation of the basic Makefile targets with what they
      actually do at present.  Slighly simplify discussion.

    * Put the man page overlaps into a table.
      + Drop references to overlaps with the old a.out ld.so, long dead.

    * Update reference to Announce file to use current naming convention.
      + Send people looking for copyright information there rather than
        duplicating some of it here.

    * Direct reader to the top-level homepage instead of more deeply to the
      "Contributing" page.

    * Reflow paragraphs to 72 columns.

Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2017-05-13 20:14:09 +02:00
Heinrich Schuchardt 780b72d47b README: Explain usage of prefix when installing
Installing the man pages to /usr may not be the preferred option
when working on a system with a packaging system like apt or yum,
where /usr is reserved for packages and /usr/local or /opt is used
for user addons.

README should explain how to install to a path different to /usr.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
2014-05-26 10:16:11 +02:00
Michael Kerrisk ca0d872f8d README: Point directly at contributing.html
Reported-by: Alexander Shishkin <virtuoso@slind.org>
Signed-off-by: Michael Kerrisk <mtk@konstanz.(none)>
2010-08-29 07:40:29 +02:00
Michael Kerrisk 3a8d4ffa18 Update descriptions of pages. 2008-06-05 11:27:44 +00:00
Michael Kerrisk 0e9f746458 Start of 3.00 2008-06-05 09:42:52 +00:00
Michael Kerrisk f6e7dd087f Brought up to date 2007-10-05 17:40:41 +00:00
Michael Kerrisk c11b1abf2e Change mtk's email address 2007-09-20 06:52:22 +00:00
Michael Kerrisk fea681dafb Import of man-pages 1.70 2004-11-03 13:51:07 +00:00