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