Print this page
make: unifdef for SUNOS4_AND_AFTER (defined)

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/make/bin/nse_printdep.cc
          +++ new/usr/src/cmd/make/bin/nse_printdep.cc
↓ open down ↓ 61 lines elided ↑ open up ↑
  62   62   *              done            The Name ".DONE"
  63   63   *              init            The Name ".INIT"
  64   64   *              makefiles_used  List of all makefiles read
  65   65   */
  66   66  void
  67   67  print_dependencies(register Name target, register Property line)
  68   68  {
  69   69          Dependency      dp;
  70   70          static Boolean  makefiles_printed = false;
  71   71  
  72      -#ifdef SUNOS4_AND_AFTER
  73   72          if (target_variants) {
  74      -#else
  75      -        if (is_true(flag.target_variants)) {
  76      -#endif
  77   73                  depvar_print_results();
  78   74          }
  79   75          
  80   76          if (!makefiles_printed) {
  81   77                  /*
  82   78                   * Search the makefile list for the primary makefile,
  83   79                   * then print it and its inclusions.  After that go back
  84   80                   * and print the default.mk file and its inclusions.
  85   81                   */
  86   82                  for (dp = makefiles_used; dp != NULL; dp = dp->next) {
↓ open down ↓ 7 lines elided ↑ open up ↑
  94   90                                  if (dp->name == primary_makefile) {
  95   91                                          break;
  96   92                                  }
  97   93                                  (void)printf(" %s", dp->name->string_mb);
  98   94                          }
  99   95                  }
 100   96                  (void) printf("\n");
 101   97                  makefiles_printed = true;
 102   98          }
 103   99          print_deps(target, line);
 104      -#ifdef SUNOS4_AND_AFTER
 105  100  /*
 106  101          print_more_deps(target, init);
 107  102          print_more_deps(target, done);
 108  103   */
 109  104          if (target_variants) {
 110      -#else
 111      -        print_more_deps(target, cached_names.init);
 112      -        print_more_deps(target, cached_names.done);
 113      -        if (is_true(flag.target_variants)) {
 114      -#endif
 115  105                  print_forest(target);
 116  106          }
 117  107  }
 118  108  
 119  109  /*
 120  110   *      print_more_deps(target, name)
 121  111   *
 122  112   *      Print some special dependencies.
 123  113   *      These are the dependencies for the .INIT and .DONE targets.
 124  114   *
↓ open down ↓ 35 lines elided ↑ open up ↑
 160  150   *              go_recursive    Should we show all dependencies recursively?
 161  151   *
 162  152   *      Global variables used:
 163  153   *              recursive_name  The Name ".RECURSIVE", printed
 164  154   */
 165  155  static void
 166  156  print_deps(register Name target, register Property line)
 167  157  {
 168  158          register Dependency     dep;
 169  159  
 170      -#ifdef SUNOS4_AND_AFTER
 171  160          if ((target->dependency_printed) ||
 172  161              (target == force)) {
 173      -#else
 174      -        if (is_true(target->dependency_printed)) {
 175      -#endif
 176  162                  return;
 177  163          }
 178  164          target->dependency_printed = true;
 179  165  
 180  166          /* only print entries that are actually derived and are not leaf
 181  167           * files and are not the result of sccs get.
 182  168           */
 183  169          if (should_print_dep(line)) {
 184  170  #ifdef NSE
 185  171                  nse_check_no_deps_no_rule(target, line, line);
↓ open down ↓ 96 lines elided ↑ open up ↑
 282  268   */
 283  269  static Boolean
 284  270  should_print_dep(Property line)
 285  271  {
 286  272          if (line == NULL) {
 287  273                  return false;
 288  274          }
 289  275          if (line->body.line.dependencies != NULL) {
 290  276                  return true;
 291  277          }
 292      -#ifdef SUNOS4_AND_AFTER
 293  278          if (line->body.line.sccs_command) {
 294      -#else
 295      -        if (is_true(line->body.line.sccs_command)) {
 296      -#endif
 297  279                  return false;
 298  280          }
 299  281          return true;
 300  282  }
 301  283  
 302  284  /*
 303  285   * Print out the root nodes of all the dependency trees
 304  286   * in this makefile.
 305  287   */
 306  288  static void
 307  289  print_forest(Name target)
 308  290  {
 309  291          Name_set::iterator np, e;
 310  292          Property        line;
 311  293  
 312  294          for (np = hashtab.begin(), e = hashtab.end(); np != e; np++) {
 313      -#ifdef SUNOS4_AND_AFTER
 314  295                          if (np->is_target && !np->has_parent && np != target) {
 315      -#else
 316      -                        if (is_true(np->is_target) && 
 317      -                            is_false(np->has_parent) &&
 318      -                            np != target) {
 319      -#endif
 320  296                                  (void) doname_check(np, true, false, false);
 321  297                                  line = get_prop(np->prop, line_prop);
 322  298                                  printf("-\n");
 323  299                                  print_deps(np, line);
 324  300                          }
 325  301          }
 326  302  }
 327  303  
 328      -#ifndef SUNOS4_AND_AFTER
 329      -printdesc()
 330      -{
 331      -        Name_set::iterator      p, e;
 332      -        register Property       prop;
 333      -        register Dependency     dep;
 334      -        register Cmd_line       rule;
 335      -        Percent                 percent, percent_depe;
 336      -
 337      -        /* Default target */
 338      -        if (default_target_to_build != NULL) {
 339      -                print_rule(default_target_to_build);
 340      -                default_target_to_build->dependency_printed= true;
 341      -        };
 342      -        (void)printf("\n");
 343      -
 344      -        /* .AR_REPLACE */
 345      -        if (ar_replace_rule != NULL) {
 346      -                (void)printf("%s:\n", cached_names.ar_replace->string_mb);
 347      -                for (rule= ar_replace_rule; rule != NULL; rule= rule->next)
 348      -                        (void)printf("\t%s\n", rule->command_line->string_mb);
 349      -        };
 350      -
 351      -        /* .DEFAULT */
 352      -        if (default_rule != NULL) {
 353      -                (void)printf("%s:\n", cached_names.default_rule->string_mb);
 354      -                for (rule= default_rule; rule != NULL; rule= rule->next)
 355      -                        (void)printf("\t%s\n", rule->command_line->string_mb);
 356      -        };
 357      -
 358      -        /* .IGNORE */
 359      -        if (is_true(flag.ignore_errors))
 360      -                (void)printf("%s:\n", cached_names.ignore->string_mb);
 361      -
 362      -        /* .KEEP_STATE: */
 363      -        if (is_true(flag.keep_state))
 364      -                (void)printf("%s:\n\n", cached_names.dot_keep_state->string_mb);
 365      -
 366      -        /* .PRECIOUS */
 367      -        (void)printf("%s: ", cached_names.precious->string_mb);
 368      -        for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
 369      -                        if (is_true(p->stat.is_precious | all_precious))
 370      -                                (void)printf("%s ", p->string_mb);
 371      -        (void)printf("\n");
 372      -
 373      -        /* .SCCS_GET */
 374      -        if (sccs_get_rule != NULL) {
 375      -                (void)printf("%s:\n", cached_names.sccs_get->string_mb);
 376      -                for (rule= sccs_get_rule; rule != NULL; rule= rule->next)
 377      -                        (void)printf("\t%s\n", rule->command_line->string_mb);
 378      -        };
 379      -
 380      -        /* .SILENT */
 381      -        if (is_true(flag.silent))
 382      -                (void)printf("%s:\n", cached_names.silent->string_mb);
 383      -
 384      -        /* .SUFFIXES: */
 385      -        (void)printf("%s: ", cached_names.suffixes->string_mb);
 386      -        for (dep= suffixes; dep != NULL; dep= dep->next) {
 387      -                (void)printf("%s ", dep->name->string_mb);
 388      -                build_suffix_list(dep->name);
 389      -        };
 390      -        (void)printf("\n\n");
 391      -
 392      -        /* % rules */
 393      -        for (percent= percent_list; percent != NULL; percent= percent->next) {
 394      -                (void) printf("%s:", percent->name->string_mb);
 395      -
 396      -                for (percent_depe= percent->dependencies; percent_depe != NULL; percent_depe = percent_depe->next)
 397      -                        (void) printf(" %s", percent_depe->name->string_mb);
 398      -
 399      -                (void) printf("\n");
 400      -
 401      -                for (rule= percent->command_template; rule != NULL; rule= rule->next)
 402      -                        (void)printf("\t%s\n", rule->command_line->string_mb);
 403      -        };
 404      -
 405      -        /* Suffix rules */
 406      -        for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
 407      -                        if (is_false(p->dependency_printed) && (p->string[0] == PERIOD)) {
 408      -                                print_rule(p);
 409      -                                p->dependency_printed= true;
 410      -                        };
 411      -
 412      -        /* Macro assignments */
 413      -        for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
 414      -                        if (((prop= get_prop(p->prop, macro_prop)) != NULL) &&
 415      -                            (prop->body.macro.value != NULL)) {
 416      -                                (void)printf("%s", p->string_mb);
 417      -                                print_value(prop->body.macro.value,
 418      -                                            prop->body.macro.daemon);
 419      -                        };
 420      -        (void)printf("\n");
 421      -
 422      -        /* Delays */
 423      -        for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
 424      -                        for (prop= get_prop(p->prop, conditional_prop);
 425      -                             prop != NULL;
 426      -                             prop= get_prop(prop->next, conditional_prop)) {
 427      -                                (void)printf("%s := %s",
 428      -                                             p->string_mb,
 429      -                                             prop->body.conditional.name->string_mb);
 430      -                                print_value(prop->body.conditional.value, no_daemon);
 431      -                        };
 432      -        (void)printf("\n");
 433      -
 434      -        /* All other dependencies */
 435      -        for (p = hashtab.begin(), e = hashtab.end(); p != e; p++)
 436      -                        if (is_false(p->dependency_printed) && (p->colons != no_colon))
 437      -                                print_rule(p);
 438      -        (void)printf("\n");
 439      -        exit(0);
 440      -}
 441      -#endif
 442  304  
 443  305  /*
 444  306   *      This is a set  of routines for dumping the internal make state
 445  307   *      Used for the -p option
 446  308   */
 447  309  void
 448  310  print_value(register Name value, Daemon daemon)
 449  311                                        
 450      -#ifdef SUNOS4_AND_AFTER
 451  312                                         
 452      -#else
 453      -                                       
 454      -#endif
 455  313  {
 456  314          Chain                   cp;
 457  315  
 458  316          if (value == NULL)
 459  317                  (void)printf("=\n");
 460  318          else
 461  319                  switch (daemon) {
 462  320                      case no_daemon:
 463  321                          (void)printf("= %s\n", value->string_mb);
 464  322                          break;
↓ open down ↓ 48 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX