qmake/generators/symbian/symmake.cpp
changeset 33 3e2da88830cd
parent 30 5dc02b23752f
child 37 758a864f9613
equal deleted inserted replaced
30:5dc02b23752f 33:3e2da88830cd
    54 #include <symbian/epocroot.h>
    54 #include <symbian/epocroot.h>
    55 
    55 
    56 #define RESOURCE_DIRECTORY_MMP "/resource/apps"
    56 #define RESOURCE_DIRECTORY_MMP "/resource/apps"
    57 #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
    57 #define REGISTRATION_RESOURCE_DIRECTORY_HW "/private/10003a3f/import/apps"
    58 #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
    58 #define PLUGIN_COMMON_DEF_FILE_FOR_MMP "./plugin_common.def"
    59 #define PLUGIN_COMMON_DEF_FILE_ACTUAL "plugin_commonu.def"
       
    60 #define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)
    59 #define BLD_INF_FILENAME_LEN (sizeof(BLD_INF_FILENAME) - 1)
    61 
    60 
    62 #define BLD_INF_RULES_BASE "BLD_INF_RULES."
    61 #define BLD_INF_RULES_BASE "BLD_INF_RULES."
    63 #define BLD_INF_TAG_PLATFORMS "prj_platforms"
    62 #define BLD_INF_TAG_PLATFORMS "prj_platforms"
    64 #define BLD_INF_TAG_MMPFILES "prj_mmpfiles"
    63 #define BLD_INF_TAG_MMPFILES "prj_mmpfiles"
   268 
   267 
   269     writeCustomDefFile();
   268     writeCustomDefFile();
   270     writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile);
   269     writeWrapperMakefile(wrapperMakefile, isPrimaryMakefile);
   271 
   270 
   272     return true;
   271     return true;
   273 }
       
   274 
       
   275 void SymbianMakefileGenerator::writeCustomDefFile()
       
   276 {
       
   277     if (targetType == TypePlugin && !project->isActiveConfig("stdbinary")) {
       
   278         // Create custom def file for plugin
       
   279         QFile ft(Option::output_dir + QLatin1Char('/') + QLatin1String(PLUGIN_COMMON_DEF_FILE_ACTUAL));
       
   280 
       
   281         if (ft.open(QIODevice::WriteOnly)) {
       
   282             if (Option::mkfile::listgen) {
       
   283                 generatePrint(fileInfo(ft.fileName()).absoluteFilePath());
       
   284             }
       
   285             generatedFiles << ft.fileName();
       
   286             QTextStream t(&ft);
       
   287 
       
   288             t << "; ==============================================================================" << endl;
       
   289             t << "; Generated by qmake (" << qmake_version() << ") (Qt " QT_VERSION_STR ") on: ";
       
   290             t << QDateTime::currentDateTime().toString(Qt::ISODate) << endl;
       
   291             t << "; This file is generated by qmake and should not be modified by the" << endl;
       
   292             t << "; user." << endl;
       
   293             t << ";  Name        : " PLUGIN_COMMON_DEF_FILE_ACTUAL << endl;
       
   294             t << ";  Part of     : " << project->values("TARGET").join(" ") << endl;
       
   295             t << ";  Description : Fixes common plugin symbols to known ordinals" << endl;
       
   296             t << ";  Version     : " << endl;
       
   297             t << ";" << endl;
       
   298             t << "; ==============================================================================" << "\n" << endl;
       
   299 
       
   300             t << endl;
       
   301 
       
   302             t << "EXPORTS" << endl;
       
   303             t << "\tqt_plugin_query_verification_data @ 1 NONAME" << endl;
       
   304             t << "\tqt_plugin_instance @ 2 NONAME" << endl;
       
   305             t << endl;
       
   306         } else {
       
   307             PRINT_FILE_CREATE_ERROR(QString(PLUGIN_COMMON_DEF_FILE_ACTUAL))
       
   308         }
       
   309     }
       
   310 }
   272 }
   311 
   273 
   312 void SymbianMakefileGenerator::init()
   274 void SymbianMakefileGenerator::init()
   313 {
   275 {
   314     MakefileGenerator::init();
   276     MakefileGenerator::init();
  1182     t << endl;
  1144     t << endl;
  1183 
  1145 
  1184     t << "distclean: clean dodistclean" << endl;
  1146     t << "distclean: clean dodistclean" << endl;
  1185     t << endl;
  1147     t << endl;
  1186 }
  1148 }
  1187 
       
  1188 void SymbianMakefileGenerator::generateExecutionTargets(QTextStream& t, const QStringList& platforms)
       
  1189 {
       
  1190     // create execution targets
       
  1191     if (targetType == TypeExe) {
       
  1192         if (platforms.contains("winscw")) {
       
  1193             t << "run:" << endl;
       
  1194             t << "\t-call " << epocRoot() << "epoc32/release/winscw/udeb/" << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl;
       
  1195         }
       
  1196         t << "runonphone: sis" << endl;
       
  1197         t << "\trunonphone $(QT_RUN_ON_PHONE_OPTIONS) --sis " << fixedTarget << ".sis " << fixedTarget << ".exe " << "$(QT_RUN_OPTIONS)" << endl;
       
  1198         t << endl;
       
  1199     }
       
  1200 }