hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
author mikael
Tue, 09 Oct 2012 10:09:34 -0700
changeset 13963 e5b53c306fb5
parent 13892 9ba13acea673
child 15096 3db45569f8c0
permissions -rw-r--r--
7197424: update copyright year to match last edit in jdk8 hotspot repository Summary: Update copyright year to 2012 for relevant files Reviewed-by: dholmes, coleenp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     1
/*
13963
e5b53c306fb5 7197424: update copyright year to match last edit in jdk8 hotspot repository
mikael
parents: 13892
diff changeset
     2
 * Copyright (c) 1999, 2012, Oracle and/or its affiliates. All rights reserved.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     4
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
489c9b5090e2 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
489c9b5090e2 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
489c9b5090e2 Initial load
duke
parents:
diff changeset
     8
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
489c9b5090e2 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
489c9b5090e2 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
489c9b5090e2 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
489c9b5090e2 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
489c9b5090e2 Initial load
duke
parents:
diff changeset
    14
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
489c9b5090e2 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
489c9b5090e2 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
489c9b5090e2 Initial load
duke
parents:
diff changeset
    18
 *
5547
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
f4b087cbb361 6941466: Oracle rebranding changes for Hotspot repositories
trims
parents: 1
diff changeset
    21
 * questions.
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    22
 *
489c9b5090e2 Initial load
duke
parents:
diff changeset
    23
 */
489c9b5090e2 Initial load
duke
parents:
diff changeset
    24
7397
5b173b4ca846 6989984: Use standard include model for Hospot
stefank
parents: 5547
diff changeset
    25
public class ProjectCreator {
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    26
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    27
   public static void usage() {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    28
      System.out.println("ProjectCreator options:");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    29
      System.err.println("WinGammaPlatform platform-specific options:");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    30
      System.err.println("  -sourceBase <path to directory (workspace) "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    31
            + "containing source files; no trailing slash>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    32
      System.err.println("  -dspFileName <full pathname to which .dsp file "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    33
            + "will be written; all parent directories must "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    34
            + "already exist>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    35
      System.err.println("  -envVar <environment variable to be inserted "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    36
            + "into .dsp file, substituting for path given in "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    37
            + "-sourceBase. Example: HotSpotWorkSpace>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    38
      System.err.println("  -dllLoc <path to directory in which to put "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    39
            + "jvm.dll and jvm_g.dll; no trailing slash>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    40
      System.err.println("  If any of the above are specified, "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    41
            + "they must all be.");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    42
      System.err.println("  Additional, optional arguments, which can be "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    43
            + "specified multiple times:");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    44
      System.err.println("    -absoluteInclude <string containing absolute "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    45
            + "path to include directory>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    46
      System.err.println("    -relativeInclude <string containing include "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    47
            + "directory relative to -envVar>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    48
      System.err.println("    -define <preprocessor flag to be #defined "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    49
            + "(note: doesn't yet support " + "#define (flag) (value))>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    50
      System.err.println("    -perFileLine <file> <line>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    51
      System.err.println("    -conditionalPerFileLine <file> <line for "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    52
            + "release build> <line for debug build>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    53
      System.err.println("  (NOTE: To work around a bug in nmake, where "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    54
            + "you can't have a '#' character in a quoted "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    55
            + "string, all of the lines outputted have \"#\"" + "prepended)");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    56
      System.err.println("    -startAt <subdir of sourceBase>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    57
      System.err.println("    -ignoreFile <file which won't be able to be "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    58
            + "found in the sourceBase because it's generated " + "later>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    59
      System.err.println("    -additionalFile <file not in database but "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    60
            + "which should show up in .dsp file>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    61
      System.err
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    62
            .println("    -additionalGeneratedFile <environment variable of "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    63
                  + "generated file's location> <relative path to "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    64
                  + "directory containing file; no trailing slash> "
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    65
                  + "<name of file generated later in the build process>");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    66
      System.err.println("    -prelink <build> <desc> <cmds>:");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    67
      System.err
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    68
            .println(" Generate a set of prelink commands for the given BUILD");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    69
      System.err
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    70
            .println(" (\"Debug\" or \"Release\"). The prelink description and commands");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    71
      System.err.println(" are both quoted strings.");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    72
      System.err.println("    Default includes: \".\"");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    73
      System.err
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    74
            .println("    Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    75
   }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    76
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    77
   public static void main(String[] args) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    78
      try {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    79
         if (args.length < 3) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    80
            usage();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    81
            System.exit(1);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    82
         }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    83
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    84
         String platformName = args[0];
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    85
         Class platformClass = Class.forName(platformName);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    86
         WinGammaPlatform platform = (WinGammaPlatform) platformClass
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    87
               .newInstance();
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    88
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    89
         String[] platformArgs = new String[args.length - 1];
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    90
         System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    91
13892
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    92
         // Allow the platform to write platform-specific files
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    93
         platform.createVcproj(platformArgs);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    94
      } catch (Exception e) {
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    95
         e.printStackTrace();
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    96
         System.exit(1);
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    97
      }
9ba13acea673 7163863: Updated projectcreator
neliasso
parents: 7397
diff changeset
    98
   }
1
489c9b5090e2 Initial load
duke
parents:
diff changeset
    99
}