Source Code Cross Referenced for Platform.java in  » 6.0-JDK-Modules » j2me » makedep » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » 6.0 JDK Modules » j2me » makedep 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         *   
003:         *
004:         * Copyright  1990-2007 Sun Microsystems, Inc. All Rights Reserved.
005:         * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER
006:         * 
007:         * This program is free software; you can redistribute it and/or
008:         * modify it under the terms of the GNU General Public License version
009:         * 2 only, as published by the Free Software Foundation.
010:         * 
011:         * This program is distributed in the hope that it will be useful, but
012:         * WITHOUT ANY WARRANTY; without even the implied warranty of
013:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
014:         * General Public License version 2 for more details (a copy is
015:         * included at /legal/license.txt).
016:         * 
017:         * You should have received a copy of the GNU General Public License
018:         * version 2 along with this work; if not, write to the Free Software
019:         * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
020:         * 02110-1301 USA
021:         * 
022:         * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
023:         * Clara, CA 95054 or visit www.sun.com if you need additional
024:         * information or have any questions.
025:         */
026:
027:        package makedep;
028:
029:        /** Defines what must be specified for each platform. This class must
030:         have a no-arg constructor. */
031:
032:        import java.io.*;
033:
034:        public abstract class Platform {
035:            // The next three must be instantiated in subclasses' constructors
036:
037:            /** An incl file is produced per .c file and contains all the
038:              includes it needs */
039:            protected FileName inclFileTemplate;
040:
041:            /** A GI (grand-include) file has any file used more than N times
042:              for precompiled headers */
043:            protected FileName giFileTemplate;
044:
045:            /** A GD (grand-dependencies) file that tells Unix make all the
046:              .o's needed for linking and the include dependencies */
047:            protected FileName gdFileTemplate;
048:
049:            // Accessors
050:            public FileName getInclFileTemplate() {
051:                return inclFileTemplate;
052:            }
053:
054:            public FileName getGIFileTemplate() {
055:                return giFileTemplate;
056:            }
057:
058:            public FileName getGDFileTemplate() {
059:                return gdFileTemplate;
060:            }
061:
062:            // an incl file is the file included by each.c file that includes
063:            // all needed header files
064:
065:            public void setupFileTemplates() {
066:                String inclsDir = "incls" + fileSeparator();
067:                inclFileTemplate = new FileName(this , inclsDir, "_", "",
068:                        ".incl", "", "");
069:                giFileTemplate = new FileName(this , inclsDir, "",
070:                        "_precompiled", ".incl", "", "");
071:                gdFileTemplate = new FileName(this , "", "", "Dependencies", "",
072:                        "", "");
073:            }
074:
075:            public abstract String[] outerSuffixes();
076:
077:            public abstract String fileSeparator();
078:
079:            /** empty file name -> no grand include file */
080:            public boolean haveGrandInclude() {
081:                return usePrecompiledHeader
082:                        && (giFileTemplate.nameOfList().length() > 0);
083:            }
084:
085:            public boolean writeDeps() {
086:                return (gdFileTemplate.nameOfList().length() > 0);
087:            }
088:
089:            /** <p> A gi file is the grand-include file. It includes in one
090:              file any file that is included more than a certain number of
091:              times. </p>
092:
093:              <p> It is used for precompiled header files. </p>
094:
095:              <p> It has a source name, that is the file that this program
096:              generates, and a compiled name; that is the file that is
097:              included by other files. </p>
098:
099:              <p> Some platforms have this program actually explicitly
100:              include the preprocessed gi file-- see includeGIInEachIncl().
101:              </p>
102:
103:              <p> Also, some platforms need a pragma in the GI file. </p> */
104:            public boolean includeGIInEachIncl() {
105:                return false;
106:            }
107:
108:            /** For some platforms, e.g. Solaris, include the grand-include
109:              dependencies in the makefile. For others, e.g. Windows, do
110:              not. */
111:            public boolean includeGIDependencies() {
112:                return false;
113:            }
114:
115:            /** Default implementation does nothing */
116:            public void writeGIPragma(PrintWriter out) {
117:            }
118:
119:            /** A line with a filename and the noGrandInclude string means
120:              that this file cannot use the precompiled header. */
121:            public String noGrandInclude() {
122:                return "no_precompiled_headers";
123:            }
124:
125:            /** A line with a filename and the
126:              generatePlatformDependentInclude means that an include file
127:              for the header file must be generated. Does not effect the
128:              dependency computation. */
129:            public String generatePlatformDependentInclude() {
130:                return "generate_platform_dependent_include";
131:            }
132:
133:            /** Prefix and suffix strings for emitting Makefile rules */
134:            public abstract String objFileSuffix();
135:
136:            public abstract String asmFileSuffix();
137:
138:            public abstract String dependentPrefix();
139:
140:            // Exit routines:
141:
142:            /** Abort means an internal error */
143:            public void abort() {
144:                throw new RuntimeException("Internal error");
145:            }
146:
147:            /** fatalError is used by clients to stop the system */
148:            public void fatalError(String msg) {
149:                System.err.println(msg);
150:                System.exit(1);
151:            }
152:
153:            /** Default implementation performs case-sensitive comparison */
154:            public boolean fileNameStringEquality(String s1, String s2) {
155:                return s1.equals(s2);
156:            }
157:
158:            public void fileNamePortabilityCheck(String name) {
159:                // Empty for now
160:            }
161:
162:            public void fileNamePortabilityCheck(String name,
163:                    String matchingName) {
164:                if (!name.equals(matchingName)) {
165:                    fatalError("Error: file " + name + " also appears as "
166:                            + matchingName + ".  Case must be consistent for "
167:                            + "portability.");
168:                }
169:            }
170:
171:            /** max is 31 on mac, so warn */
172:            public int fileNameLengthLimit() {
173:                return 40;
174:            }
175:
176:            public int defaultGrandIncludeThreshold() {
177:                return 30;
178:            }
179:
180:            /** Not very general, but this is a way to get platform-specific
181:                files to be written. Default implementation does nothing. */
182:            public void writePlatformSpecificFiles(Database previousDB,
183:                    Database currentDB, String[] args)
184:                    throws IllegalArgumentException, IOException {
185:            }
186:
187:            /* A platform may use this to process the name of a file. E.g., Symbian
188:             * strips leading DOS drive names */
189:            public String translateFileName(String name) {
190:                return name;
191:            }
192:
193:            boolean usePrecompiledHeader = true;
194:
195:            public void setUsePrecompiledHeader(boolean value) {
196:                usePrecompiledHeader = value;
197:            }
198:
199:            boolean getUsePrecompiledHeader() {
200:                return usePrecompiledHeader;
201:            }
202:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.