Path: blob/aarch64-shenandoah-jdk8u272-b10/hotspot/src/share/tools/ProjectCreator/ProjectCreator.java
32285 views
/*1* Copyright (c) 1999, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*22*/2324public class ProjectCreator {2526public static void usage() {27System.out.println("ProjectCreator options:");28System.err.println("WinGammaPlatform platform-specific options:");29System.err.println(" -sourceBase <path to directory (workspace) "30+ "containing source files; no trailing slash>");31System.err.println(" -dspFileName <full pathname to which .dsp file "32+ "will be written; all parent directories must "33+ "already exist>");34System.err.println(" -envVar <environment variable to be inserted "35+ "into .dsp file, substituting for path given in "36+ "-sourceBase. Example: HotSpotWorkSpace>");37System.err.println(" -dllLoc <path to directory in which to put "38+ "jvm.dll; no trailing slash>");39System.err.println(" If any of the above are specified, "40+ "they must all be.");41System.err.println(" Note: if '-altRelativeInclude' option below is "42+ "used, then the '-relativeAltSrcInclude' option must be used "43+ "to specify the alternate source dir, e.g., 'src\\closed'");44System.err.println(" Additional, optional arguments, which can be "45+ "specified multiple times:");46System.err.println(" -absoluteInclude <string containing absolute "47+ "path to include directory>");48System.err.println(" -altRelativeInclude <string containing "49+ "alternate include directory relative to -envVar>");50System.err.println(" -relativeInclude <string containing include "51+ "directory relative to -envVar>");52System.err.println(" -define <preprocessor flag to be #defined "53+ "(note: doesn't yet support " + "#define (flag) (value))>");54System.err.println(" -perFileLine <file> <line>");55System.err.println(" -conditionalPerFileLine <file> <line for "56+ "release build> <line for debug build>");57System.err.println(" (NOTE: To work around a bug in nmake, where "58+ "you can't have a '#' character in a quoted "59+ "string, all of the lines outputted have \"#\"" + "prepended)");60System.err.println(" -startAt <subdir of sourceBase>");61System.err.println(" -ignoreFile <file which won't be able to be "62+ "found in the sourceBase because it's generated " + "later>");63System.err.println(" -additionalFile <file not in database but "64+ "which should show up in .dsp file>");65System.err66.println(" -additionalGeneratedFile <environment variable of "67+ "generated file's location> <relative path to "68+ "directory containing file; no trailing slash> "69+ "<name of file generated later in the build process>");70System.err.println(" -prelink <build> <desc> <cmds>:");71System.err72.println(" Generate a set of prelink commands for the given BUILD");73System.err74.println(" (\"Debug\" or \"Release\"). The prelink description and commands");75System.err.println(" are both quoted strings.");76System.err.println(" Default includes: \".\"");77System.err78.println(" Default defines: WIN32, _WINDOWS, \"HOTSPOT_BUILD_USER=$(USERNAME)\"");79}8081public static void main(String[] args) {82try {83if (args.length < 3) {84usage();85System.exit(1);86}8788String platformName = args[0];89Class platformClass = Class.forName(platformName);90WinGammaPlatform platform = (WinGammaPlatform) platformClass91.newInstance();9293String[] platformArgs = new String[args.length - 1];94System.arraycopy(args, 1, platformArgs, 0, platformArgs.length);9596// Allow the platform to write platform-specific files97platform.createVcproj(platformArgs);98} catch (Exception e) {99e.printStackTrace();100System.exit(1);101}102}103}104105106