FileDocCategorySizeDatePackage
Platform.javaAPI DocphoneME MR2 API (J2ME)6392Wed May 02 17:59:48 BST 2007makedep

Platform

public abstract class Platform extends Object
Defines what must be specified for each platform. This class must have a no-arg constructor.

Fields Summary
protected FileName
inclFileTemplate
An incl file is produced per .c file and contains all the includes it needs
protected FileName
giFileTemplate
A GI (grand-include) file has any file used more than N times for precompiled headers
protected FileName
gdFileTemplate
A GD (grand-dependencies) file that tells Unix make all the .o's needed for linking and the include dependencies
boolean
usePrecompiledHeader
Constructors Summary
Methods Summary
public voidabort()
Abort means an internal error

      throw new RuntimeException("Internal error");
    
public abstract java.lang.StringasmFileSuffix()

public intdefaultGrandIncludeThreshold()

      return 30;
    
public abstract java.lang.StringdependentPrefix()

public voidfatalError(java.lang.String msg)
fatalError is used by clients to stop the system

      System.err.println(msg);
      System.exit(1);
    
public intfileNameLengthLimit()
max is 31 on mac, so warn

      return 40;
    
public voidfileNamePortabilityCheck(java.lang.String name)

      // Empty for now
    
public voidfileNamePortabilityCheck(java.lang.String name, java.lang.String matchingName)

      if (!name.equals(matchingName)) {
          fatalError("Error: file " + name + " also appears as " +
                   matchingName + ".  Case must be consistent for " +
                   "portability.");
      }
    
public booleanfileNameStringEquality(java.lang.String s1, java.lang.String s2)
Default implementation performs case-sensitive comparison

      return s1.equals(s2);
    
public abstract java.lang.StringfileSeparator()

public java.lang.StringgeneratePlatformDependentInclude()
A line with a filename and the generatePlatformDependentInclude means that an include file for the header file must be generated. Does not effect the dependency computation.

      return "generate_platform_dependent_include";
    
public FileNamegetGDFileTemplate()

      return gdFileTemplate;
    
public FileNamegetGIFileTemplate()

      return giFileTemplate;
    
public FileNamegetInclFileTemplate()

      return inclFileTemplate;
    
booleangetUsePrecompiledHeader()

        return usePrecompiledHeader;
    
public booleanhaveGrandInclude()
empty file name -> no grand include file

      return usePrecompiledHeader && 
          (giFileTemplate.nameOfList().length() > 0);
    
public booleanincludeGIDependencies()
For some platforms, e.g. Solaris, include the grand-include dependencies in the makefile. For others, e.g. Windows, do not.

      return false;
    
public booleanincludeGIInEachIncl()

A gi file is the grand-include file. It includes in one file any file that is included more than a certain number of times.

It is used for precompiled header files.

It has a source name, that is the file that this program generates, and a compiled name; that is the file that is included by other files.

Some platforms have this program actually explicitly include the preprocessed gi file-- see includeGIInEachIncl().

Also, some platforms need a pragma in the GI file.

      return false;
    
public java.lang.StringnoGrandInclude()
A line with a filename and the noGrandInclude string means that this file cannot use the precompiled header.

      return "no_precompiled_headers";
    
public abstract java.lang.StringobjFileSuffix()
Prefix and suffix strings for emitting Makefile rules

public abstract java.lang.String[]outerSuffixes()

public voidsetUsePrecompiledHeader(boolean value)


        
        usePrecompiledHeader = value;
    
public voidsetupFileTemplates()

        String inclsDir = "incls" + fileSeparator();
        inclFileTemplate = new FileName(this,
          inclsDir, "_", "", ".incl", "", "");
        giFileTemplate = new FileName(this,
              inclsDir, "",  "_precompiled", ".incl", "", "");
        gdFileTemplate = new FileName(this,
              "", "",  "Dependencies",         "",      "", "");
    
public java.lang.StringtranslateFileName(java.lang.String name)

        return name;
    
public booleanwriteDeps()

      return (gdFileTemplate.nameOfList().length() > 0);
    
public voidwriteGIPragma(java.io.PrintWriter out)
Default implementation does nothing

    
public voidwritePlatformSpecificFiles(Database previousDB, Database currentDB, java.lang.String[] args)
Not very general, but this is a way to get platform-specific files to be written. Default implementation does nothing.