VirtualBox

Changeset 2099 in kBuild


Ignore:
Timestamp:
Nov 22, 2008 10:31:46 PM (16 years ago)
Author:
bird
Message:

kmk: Jokes.

Location:
trunk/src/kmk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/kmk/main.c

    r2009 r2099  
    538538/* List of goal targets.  */
    539539
    540 static struct dep *goals, *lastgoal;
     540#ifndef KMK
     541static
     542#endif
     543struct dep *goals, *lastgoal;
    541544
    542545/* List of variables which were defined on the command line
  • trunk/src/kmk/remake.c

    r2028 r2099  
    364364  const char *msg_parent
    365365    = _("%sNo rule to make target `%s', needed by `%s'%s");
     366
     367#ifdef KMK
     368  /* jokes */
     369  if (!keep_going_flag && file->parent == 0)
     370    {
     371      const char *msg_joke = 0;
     372      extern struct dep *goals;
     373
     374      /* classics */
     375      if (!strcmp (file->name, "fire")
     376       || !strcmp (file->name, "Fire"))
     377        msg_joke = "No matches.\n";
     378      else if (!strcmp (file->name, "love")
     379            || !strcmp (file->name, "Love")
     380            || !strcmp (file->name, "peace")
     381            || !strcmp (file->name, "Peace"))
     382        msg_joke = "Not war.\n";
     383      else if (!strcmp (file->name, "war"))
     384        msg_joke = "Don't know how to make war.\n";
     385
     386      /* http://xkcd.com/149/ - GNU Make bug #23273. */
     387      else if ((   !strcmp (file->name, "me")
     388                && goals != 0
     389                && !strcmp (dep_name(goals), "me")
     390                && goals->next != 0
     391                && !strcmp (dep_name(goals->next), "a")
     392                && goals->next->next != 0)
     393            || !strncmp (file->name, "me a ", 5))
     394        msg_joke =
     395# ifdef HAVE_UNISTD_H
     396                   getuid () == 0 ? "Okay.\n" :
     397#endif
     398                   "What? Make it yourself!\n";
     399      if (msg_joke)
     400        {
     401          fputs (msg_joke, stderr);
     402          die (2);
     403        }
     404    }
     405#endif /* KMK */
    366406
    367407  if (!keep_going_flag)
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette