Changeset 1503 for trunk/src/kmk/main.c


Ignore:
Timestamp:
Apr 9, 2008, 1:16:53 AM (17 years ago)
Author:
bird
Message:

Environment / globals cleanup. The new policy is to use KBUILD_ and KMK_ prefixes for things that is put into or/and picked from the environment. This will take a good while to complete.

Renamed (old still valid for some versions):
PATH_KBUILD -> KBUILD_PATH
PATH_KBUILD_BIN -> KBUILD_BIN_PATH
BUILD_PLATFORM -> KBUILD_HOST
BUILD_PLATFORM_ARCH -> KBUILD_HOST_ARCH
BUILD_PLATFORM_CPU -> KBUILD_HOST_CPU

Renamed - old not checked:
MAKELEVEL -> KMK_LEVEL
KMKFLAGS -> KMK_FLAGS
MAKEFLAGS -> KMK_FLAGS
MAKEOVERRIDES -> KMK_OVERRIDES

Removed:
MAKE_VERSION
MFLAGS

File:
1 edited

Legend:

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

    r1461 r1503  
    12941294    argv[0] = "";
    12951295  if (argv[0][0] == '\0')
     1296#ifdef KMK
     1297    program = "kmk";
     1298#else
    12961299    program = "make";
     1300#endif
    12971301  else
    12981302    {
     
    14991503
    15001504#ifdef KMK
    1501   decode_env_switches (STRING_SIZE_TUPLE ("KMKFLAGS"));
    1502 #endif
     1505  decode_env_switches (STRING_SIZE_TUPLE ("KMK_FLAGS"));
     1506#else /* !KMK */
    15031507  decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
    15041508#if 0
     
    15081512  decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
    15091513#endif
     1514#endif /* !KMK */
    15101515  decode_switches (argc, argv, 0);
    15111516#ifdef WINDOWS32
     
    16431648         allow the user's setting of MAKEOVERRIDES to affect MAKEFLAGS, so
    16441649         a reference to this hidden variable is written instead. */
     1650#ifdef KMK
     1651      (void) define_variable ("KMK_OVERRIDES", 13,
     1652#else
    16451653      (void) define_variable ("MAKEOVERRIDES", 13,
     1654#endif
    16461655                              "${-*-command-variables-*-}", o_env, 1);
    16471656    }
     
    17531762  {
    17541763    extern char *default_shell;
    1755     const char *bin = get_path_kbuild_bin();
     1764    const char *bin = get_kbuild_bin_path();
    17561765    size_t len = strlen (bin);
    17571766    default_shell = xmalloc (len + sizeof("/kmk_ash.exe"));
     
    19942003  /* Decode switches again, in case the variables were set by the makefile.  */
    19952004#ifdef KMK
    1996   decode_env_switches (STRING_SIZE_TUPLE ("KMKFLAGS"));
    1997 #endif
     2005  decode_env_switches (STRING_SIZE_TUPLE ("KMK_FLAGS"));
     2006#else /* !KMK */
    19982007  decode_env_switches (STRING_SIZE_TUPLE ("MAKEFLAGS"));
    19992008#if 0
    20002009  decode_env_switches (STRING_SIZE_TUPLE ("MFLAGS"));
    20012010#endif
     2011#endif /* !KMK */
    20022012
    20032013#if defined (__MSDOS__) || defined (__EMX__)
     
    27662776  if (!remote_description || *remote_description == '\0')
    27672777    printf (_("\nThis program is built for %s/%s/%s [" __DATE__ " " __TIME__ "]\n"),
    2768             BUILD_PLATFORM, BUILD_PLATFORM_ARCH, BUILD_PLATFORM_CPU, remote_description);
     2778            KBUILD_HOST, KBUILD_HOST_ARCH, KBUILD_HOST_CPU, remote_description);
    27692779  else
    27702780    printf (_("\nThis program is built for %s/%s/%s (%s) [" __DATE__ " " __TIME__ "]\n"),
    2771             BUILD_PLATFORM, BUILD_PLATFORM_ARCH, BUILD_PLATFORM_CPU, remote_description);
     2781            KBUILD_HOST, KBUILD_HOST_ARCH, KBUILD_HOST_CPU, remote_description);
    27722782#else  /* !KMK */
    27732783  if (!remote_description || *remote_description == '\0')
     
    30513061define_makeflags (int all, int makefile)
    30523062{
     3063#ifdef KMK
     3064  static const char ref[] = "$(KMK_OVERRIDES)";
     3065#else
    30533066  static const char ref[] = "$(MAKEOVERRIDES)";
     3067#endif
    30543068  static const char posixref[] = "$(-*-command-variables-*-)";
    30553069  register const struct command_switch *cs;
     
    32413255    *p = '\0';
    32423256
     3257#ifdef KMK
    32433258  /* Since MFLAGS is not parsed for flags, there is no reason to
    32443259     override any makefile redefinition.  */
    32453260  (void) define_variable ("MFLAGS", 6, flagstring, o_env, 1);
     3261#endif /* !KMK */
    32463262
    32473263  if (all && command_variables != 0)
     
    32903306  *p = '\0';
    32913307
     3308#ifdef KMK
     3309  v = define_variable ("KMK_FLAGS", 9,
     3310#else
    32923311  v = define_variable ("MAKEFLAGS", 9,
     3312#endif
    32933313                       /* If there are switches, omit the leading dash
    32943314                          unless it is a single long option with two
     
    33813401
    33823402#ifdef KMK
    3383 # ifdef PATH_KBUILD
     3403# ifdef KBUILD_PATH
    33843404  printf (_("%s\n\
    3385 %sPATH_KBUILD:     '%s' (default '%s')\n\
    3386 %sPATH_KBUILD_BIN: '%s' (default '%s')\n"),
     3405%sKBUILD_PATH:     '%s' (default '%s')\n\
     3406%sKBUILD_BIN_PATH: '%s' (default '%s')\n"),
    33873407          precede,
    3388           precede, get_path_kbuild(), PATH_KBUILD,
    3389           precede, get_path_kbuild_bin(), PATH_KBUILD_BIN);
    3390 # else  /* !PATH_KBUILD */
     3408          precede, get_kbuild_path(), KBUILD_PATH,
     3409          precede, get_kbuild_bin_path(), KBUILD_BIN_PATH);
     3410# else  /* !KBUILD_PATH */
    33913411  printf (_("%s\n\
    3392 %sPATH_KBUILD:     '%s'\n\
    3393 %sPATH_KBUILD_BIN: '%s'\n"),
     3412%sKBUILD_PATH:     '%s'\n\
     3413%sKBUILD_BIN_PATH: '%s'\n"),
    33943414          precede,
    3395           precede, get_path_kbuild(),
    3396           precede, get_path_kbuild_bin());
    3397 # endif /* !PATH_KBUILD */
     3415          precede, get_kbuild_path(),
     3416          precede, get_kbuild_bin_path());
     3417# endif /* !KBUILD_PATH */
    33983418  if (!remote_description || *remote_description == '\0')
    33993419    printf (_("\n%sThis program is built for %s/%s/%s [" __DATE__ " " __TIME__ "]\n"),
    3400             precede, BUILD_PLATFORM, BUILD_PLATFORM_ARCH, BUILD_PLATFORM_CPU, remote_description);
     3420            precede, KBUILD_HOST, KBUILD_HOST_ARCH, KBUILD_HOST_CPU, remote_description);
    34013421  else
    34023422    printf (_("\n%sThis program is built for %s/%s/%s (%s) [" __DATE__ " " __TIME__ "]\n"),
    3403             precede, BUILD_PLATFORM, BUILD_PLATFORM_ARCH, BUILD_PLATFORM_CPU, remote_description);
     3423            precede, KBUILD_HOST, KBUILD_HOST_ARCH, KBUILD_HOST_CPU, remote_description);
    34043424#else
    34053425  if (!remote_description || *remote_description == '\0')
Note: See TracChangeset for help on using the changeset viewer.