freebsd-ports/Mk
Kris Kennaway 54e565eedc Major optimizations for 'make index' and other recursive traversal
targets.

* Use /rescue/sh for index builds instead of /bin/sh, when it exists.
  The former is statically linked and faster to execute, which becomes
  significant when executing it tens of thousands of times.  This
  trick can be used with other recursive targets by passing in
  __MAKE_SHELL.

* Get rid of make variable assignments that use != command invocations
  in the critical path, using several methods:

  - rewriting logic to use shell or make builtins instead of external command executions
  - macroizing commands and executing them in the targets where they
    are needed instead of with every invocation of make
  - precomputing the results of invariant commands in
    bsd.port.subdir.mk and passing them in explicitly to child makes,
    and using this to avoid recalculation in all the children. NB: the
    commands are still run one per top-level subdirectory but this
    does not currently seem to be a major issue.  They could be moved
    further up into the top-level Makefile at the cost of some
    cleanliness.
  - Committers are strongly discouraged from adding further "bare" !=
    assignments to the ports tree, even in their own ports.  One of
    the above strategies should be used to avoid future bloat.

* Rewrite the core 'describe' target to work entirely within a single
  shell process using only builtin commands.  The old version is
  retained as a backup for use on systems older than 603104, which
  does not have the make :u modifier.  This cuts down the number of
  processes executed during the course of a 'make index' by an order
  of magnitude, and we are essentially now amortized to the minimum of
  a single make + sh instance per port, plus whatever commands the
  port makefile itself executes (which are usually unnecessary and
  bogus).

* Less validation of the WWW: target is performed; this can become
  policed at a port level by portlint.  Specifically we look at the
  second word of the first line beginning with "WWW:" in pkg-descr,
  and append "http://" to it unless it already begins with "http://",
  "https://" or "ftp://".  Thanks to dougb for the idea of how to
  extract WWW: using shell builtins.

* Use the "true" shell builtin instead of echo > /dev/null for a
  measurable decrease in CPU use.

* Add a note about dubious escaping strategy in bsd.port.subdir.mk

* Minor change in output of 'make describe': it no longer strips
  trailing CR characters from pkg-descr files with MSDOS CR/LF
  termination.  Instead the makeindex perl script that post-processes
  make describe into the INDEX is tweaked to strip on input.

The bottom line is that on my test hardware INDEX builds are now
faster by more than a factor of 2 and with a reduction in system time
by a factor of 4-8 depending on configuration.
2008-07-19 17:59:41 +00:00
..
bsd.apache.mk - Avoid "OPTIONS blackhole" during 'make make-options-list' 2007-09-19 21:03:59 +00:00
bsd.autotools.mk Update to the autotools new world order. 2007-07-28 06:33:59 +00:00
bsd.cmake.mk - Add common code to support for cmake based ports. 2008-05-27 22:12:09 +00:00
bsd.commands.mk Support @rmtry in pkg-plist, analogous to @dirrmtry but for single file rm. 2008-04-14 16:46:41 +00:00
bsd.database.mk Add db47 to bsd.databases.mk. 2008-06-09 06:01:41 +00:00
bsd.destdir.mk - Pass PATH variable to chrooted command, so BUILD/RUN_DEPENDS have a chance of 2008-03-11 23:37:32 +00:00
bsd.drupal.mk - Add support for drupal6* 2008-05-27 07:38:59 +00:00
bsd.efl.mk - Remove unneeded dependency from gtk12/gtk20 [1] 2008-04-19 17:56:05 +00:00
bsd.emacs.mk - Update editors/emacs to 22.2. 2008-06-03 14:36:50 +00:00
bsd.fpc.mk - Add support for freepascal based ports 2008-06-24 14:56:06 +00:00
bsd.gcc.mk Provide the test-gcc target and at least key information there even if 2008-06-28 16:52:40 +00:00
bsd.gecko.mk Add a quick-reference comment block at the beginning directing end-users 2008-07-04 08:14:21 +00:00
bsd.gnome.mk First all, ahze did most of work. Thanks ahze! Last week or so, I am just 2008-06-30 20:16:22 +00:00
bsd.gnustep.mk - update gnustep-back to 0.14.x 2008-06-20 15:13:50 +00:00
bsd.gstreamer.mk The FreeBSD GNOME team is proud to annunce the release of GNOME 2.22.0 for 2008-03-24 03:52:36 +00:00
bsd.java.mk Major optimizations for 'make index' and other recursive traversal 2008-07-19 17:59:41 +00:00
bsd.kde4.mk - Remove unneeded dependency from gtk12/gtk20 [1] 2008-04-19 17:56:05 +00:00
bsd.kde.mk - Remove unneeded dependency from gtk12/gtk20 [1] 2008-04-19 17:56:05 +00:00
bsd.linux-rpm.mk Add valid values fc6, f7 and f8: 2008-04-29 19:20:52 +00:00
bsd.local.mk
bsd.lua.mk - Fix defining Lua include/library directories under PREFIX (last commit) [1]. 2008-02-18 18:41:26 +00:00
bsd.mail.mk - Extract command variable definitions from bsd.port.mk, they are now stored in 2007-08-04 11:37:24 +00:00
bsd.ocaml.mk - Add a knob to generate pkg-plist for ocaml findlib 2008-05-19 07:05:35 +00:00
bsd.openssl.mk - bugfix, commited wrong patch 2008-03-30 11:38:02 +00:00
bsd.perl.mk Doc change: PERL_ARCH is *always* mach. 2008-05-28 12:38:27 +00:00
bsd.php.mk Add pecl-APC module support. 2008-07-11 10:57:15 +00:00
bsd.port.mk Major optimizations for 'make index' and other recursive traversal 2008-07-19 17:59:41 +00:00
bsd.port.options.mk - Fix comments to match reality 2007-05-24 22:13:55 +00:00
bsd.port.post.mk
bsd.port.pre.mk
bsd.port.subdir.mk Major optimizations for 'make index' and other recursive traversal 2008-07-19 17:59:41 +00:00
bsd.python.mk Major optimizations for 'make index' and other recursive traversal 2008-07-19 17:59:41 +00:00
bsd.qt.mk Update to Qt 4.3.4 2008-03-13 17:57:19 +00:00
bsd.ruby.mk - Add a couple of other patches from ruby SVN repo: 2008-06-25 23:00:28 +00:00
bsd.scons.mk - Remove unneeded dependency from gtk12/gtk20 [1] 2008-04-19 17:56:05 +00:00
bsd.sdl.mk Add support for SDL_console 2008-04-28 23:20:54 +00:00
bsd.sites.mk mirror.ac.uk closed down during 2007: 2008-06-23 12:18:35 +00:00
bsd.tcl.mk - Overhaul bsd.tcl.mk: most importantly, change the semantics to match 2007-04-02 22:55:29 +00:00
bsd.wx.mk - Remove unneeded dependency from gtk12/gtk20 [1] 2008-04-19 17:56:05 +00:00
bsd.xfce.mk update xfce4 to 4.4.2 2008-02-12 18:11:07 +00:00
bsd.xorg.mk - Remove unneeded dependency from gtk12/gtk20 [1] 2008-04-19 17:56:05 +00:00