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

CWPlatform

public class CWPlatform extends Platform
Metrowerks CodeWarrior for Windows

Fields Summary
private FileName
giMchProxyIncl
All C++ sources include the grand include file by the name of "incls/_precompiled.incl". For VisualC++ the compiler switches do the magic of using a precompiled header instead of the grand include file. For CodeWarrior we need to include the precompiled header explicitly, so "incls/_precompiled.incl" is a "proxy" file that contains only the #include directive for the precompiled header. Hence we point giFileTemplate to a file with a different name, and save in this variable the grand include name that sources expect.
private static String[]
suffixes
Constructors Summary
Methods Summary
public java.lang.StringasmFileSuffix()

        return ".asm";
    
public java.lang.StringdependentPrefix()

        return "";
    
public booleanfileNameStringEquality(java.lang.String s1, java.lang.String s2)

      return s1.equalsIgnoreCase(s2);
    
public java.lang.StringfileSeparator()

      return "\\";
    
public booleanincludeGIDependencies()

        return false;
    
public booleanincludeGIInEachIncl()

      return false;
    
public java.lang.StringobjFileSuffix()

        return ".obj";
    
public java.lang.String[]outerSuffixes()


       
        return suffixes;
    
public voidsetupFileTemplates()

see
#giMchProxyIncl
see
#writePlatformSpecificFiles

        super.setupFileTemplates();

        String stem = giFileTemplate.nameOfList();

        // a funky way to clone a FileName
        giMchProxyIncl = giFileTemplate.copyStem(stem);

	// write grand include into a different file that is be used
	// to generate the precompiled header, but is not used by the
	// rest of the sources
	// IMPL_NOTE: hardcoded name, must agree with the makefile
        giFileTemplate = giFileTemplate.copyStem(stem + "_pch");
    
public voidwritePlatformSpecificFiles(Database previousDB, Database currentDB, java.lang.String[] args)

see
#giMchProxyIncl
see
#setupFileTemplates

	// Generate "incls/_precompiled.incl" that is just a proxy
	// include for the precompiled header.
        System.out.println("\twriting MCH proxy file");

        ByteArrayOutputStream baos = new ByteArrayOutputStream();
        OutputStreamWriter writer = new OutputStreamWriter(baos);
        PrintWriter inclFile = new PrintWriter(writer);

        // IMPL_NOTE: hardcoded name, must agree with the makefile
        inclFile.println("#include \"cldcvm.mch\"");

        inclFile.flush();
        currentDB.updateFile(giMchProxyIncl.dirPreStemSuff(), baos);
        inclFile.close();