Changeset 66 for trunk/qmake/generators/os2/gnumake.cpp
- Timestamp:
- Mar 16, 2006, 9:57:36 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qmake/generators/os2/gnumake.cpp
r8 r66 99 99 100 100 t << "INCPATH = "; 101 QStringList &incs = project->variables()["INCLUDEPATH"]; 102 for(QStringList::Iterator incit = incs.begin(); incit != incs.end(); ++incit) { 103 QString inc = (*incit); 104 //@@TODO (dmik): old, remove 105 // inc.replace(QRegExp("\\\\$"), "\\\\"); 106 inc.replace(QRegExp("\\\\$"), ""); 107 inc.replace(QRegExp("\""), ""); 108 t << " " << var ("QMAKE_CFLAGS_INCDIR") << "\"" << inc << "\""; 109 } 110 t << " " << var ("QMAKE_CFLAGS_INCDIR") << "\"$(QMAKESPECDIR)\"" << endl; 101 { 102 QStringList &incs = project->variables()["INCLUDEPATH"]; 103 QString incsSemicolon; 104 for(QStringList::Iterator incit = incs.begin(); incit != incs.end(); ++incit) { 105 QString inc = (*incit); 106 inc.replace(QRegExp("\\\\$"), ""); 107 inc.replace(QRegExp("\""), ""); 108 if ( inc.contains( QRegExp("[ +&;$%()]") ) ) 109 inc = "\"" + inc + "\""; 110 t << " " << var ("QMAKE_CFLAGS_INCDIR") << inc; 111 incsSemicolon += inc + ";"; 112 } 113 t << " " << var ("QMAKE_CFLAGS_INCDIR") << "\"$(QMAKESPECDIR)\"" << endl; 114 incsSemicolon += "\"$(QMAKESPECDIR)\""; 115 t << "INCLUDEPATH = " << incsSemicolon << endl; 116 } 111 117 if(!project->variables()["QMAKE_APP_OR_DLL"].isEmpty()) { 112 118 t << "LINK = " << var("QMAKE_LINK") << endl; 113 119 t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; 114 120 t << "LIBS = "; 115 //@@TODO (dmik): old, remove116 // if ( !project->variables()["QMAKE_LIBDIR"].isEmpty() )117 // t << varGlue("QMAKE_LIBDIR","-L\"","\" -L\"","\"") << " ";118 // t << var("QMAKE_LIBS").replace(QRegExp("(\\slib|^lib)")," -l") << endl;119 121 QString flag = var ("QMAKE_LFLAGS_LIBDIR") + "\""; 120 122 if ( !project->variables()["QMAKE_LIBDIR"].isEmpty() ) … … 134 136 t << "IDC = " << (project->isEmpty("QMAKE_IDC") ? QString("idc") : 135 137 Option::fixPathToTargetOS(var("QMAKE_IDC"), FALSE)) << endl; 136 t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString(" midl") :138 t << "IDL = " << (project->isEmpty("QMAKE_IDL") ? QString("") : 137 139 Option::fixPathToTargetOS(var("QMAKE_IDL"), FALSE)) << endl; 140 t << "RC = " << (project->isEmpty("QMAKE_RC") ? QString("rc") : 141 Option::fixPathToTargetOS(var("QMAKE_RC"), FALSE)) << endl; 138 142 t << "ZIP = " << var("QMAKE_ZIP") << endl; 139 143 t << "COPY_FILE = " << var("QMAKE_COPY") << endl; … … 205 209 t << "DEF_FILE = " << var( "DEF_FILE" ) << endl; 206 210 } 211 212 if ( !project->isEmpty( "RC_FILE" ) ) { 213 t << "RC_FILE = " << var("RC_FILE") << endl; 214 } 215 if ( !project->isEmpty( "RES_FILE" ) ) { 216 t << "RES_FILE = " << var("RES_FILE") << endl; 217 } 207 218 208 219 if ( project->isActiveConfig("dll") && !project->isEmpty( "QMAKE_RUN_IMPLIB" ) ) { … … 236 247 else 237 248 t << "\n\t" << var( "QMAKE_RUN_LINK" ); 249 if ( !project->isEmpty( "RES_FILE" ) && !project->isEmpty( "QMAKE_RUN_RC_EXE" ) ) 250 t << "\n\t" << var("QMAKE_RUN_RC_EXE"); 238 251 if ( project->isActiveConfig("dll") && !project->isEmpty( "QMAKE_RUN_IMPLIB" ) ) 239 252 t << "\n\t" << var( "QMAKE_RUN_IMPLIB" ); … … 252 265 } 253 266 } 254 QString targetfilename = project->variables()["TARGET"].first();255 if(project->isActiveConfig("activeqt")) {256 QString version = project->variables()["VERSION"].first();257 if ( version.isEmpty() )258 version = "1.0";259 260 if ( project->isActiveConfig("dll")) {261 t << "\n\t" << ("-$(IDC) $(TARGET) /idl " + var("OBJECTS_DIR") + targetfilename + ".idl -version " + version);262 t << "\n\t" << ("-$(IDL) /nologo " + var("OBJECTS_DIR") + targetfilename + ".idl /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb");263 t << "\n\t" << ("-$(IDC) $(TARGET) /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb");264 t << "\n\t" << ("-$(IDC) $(TARGET) /regserver" );265 } else {266 t << "\n\t" << ("-$(TARGET) -dumpidl " + var("OBJECTS_DIR") + targetfilename + ".idl -version " + version);267 t << "\n\t" << ("-$(IDL) /nologo " + var("OBJECTS_DIR") + targetfilename + ".idl /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb");268 t << "\n\t" << ("-$(IDC) $(TARGET) /tlb " + var("OBJECTS_DIR") + targetfilename + ".tlb");269 t << "\n\t" << "-$(TARGET) -regserver";270 }271 }272 267 t << endl << endl; 273 268 … … 278 273 } 279 274 280 if(!project->variables()["RC_FILE"].isEmpty()) { 281 t << var("RES_FILE") << ": " << var("RC_FILE") << "\n\t" 282 << var("QMAKE_RC") << " -i " << var("RC_FILE") << " -o " << var("RC_FILE").replace(QRegExp("\\.rc"),Option::obj_ext) << " --include-dir=" << QFileInfo(var("RC_FILE")).dirPath() << endl << endl; 283 } 284 project->variables()["RES_FILE"].first().replace(QRegExp("\\.rc"),Option::obj_ext); 275 if ( !project->isEmpty( "RC_FILE" ) && !project->isEmpty( "QMAKE_RUN_RC_RES" ) ) { 276 t << "$(RES_FILE): $(RC_FILE)\n\t"; 277 t << var("QMAKE_RUN_RC_RES") << endl << endl; 278 } 285 279 286 280 t << "mocables: $(SRCMOC)" << endl << endl; … … 303 297 dist_files << fileFixify(*it); 304 298 } 305 // @@TODO (dmik):guess we don't need to zip this299 /// @todo (dmik) guess we don't need to zip this 306 300 // if(!project->isEmpty("QMAKE_INTERNAL_INCLUDED_FILES")) 307 301 // dist_files += project->variables()["QMAKE_INTERNAL_INCLUDED_FILES"]; … … 329 323 << varGlue("QMAKE_CLEAN","\n\t-$(DEL_FILE) ","\n\t-$(DEL_FILE) ","") 330 324 << varGlue("CLEAN_FILES","\n\t-$(DEL_FILE) ","\n\t-$(DEL_FILE) ",""); 331 if ( project->isActiveConfig("activeqt")) {332 t << ("\n\t-$(DEL_FILE) " + var("OBJECTS_DIR") + targetfilename + ".idl");333 t << ("\n\t-$(DEL_FILE) " + var("OBJECTS_DIR") + targetfilename + ".tlb");334 }335 325 if(!project->isEmpty("IMAGES")) 336 326 t << varGlue("QMAKE_IMAGE_COLLECTION", "\n\t-$(DEL_FILE) ", "\n\t-$(DEL_FILE) ", ""); … … 552 542 project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT"]; 553 543 } else { 554 //@@TODO (dmik): old, remove555 // if ( !project->variables()["QMAKE_QT_DLL"].isEmpty() ) {556 544 if(project->isActiveConfig("thread")) 557 545 project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT_THREAD_DLL"]; … … 563 551 if(hver != -1) { 564 552 QString ver; 565 //@@TODO (dmik): old, remove566 // ver.sprintf("libqt%s" QTDLL_POSTFIX "%d.a", (project->isActiveConfig("thread") ? "-mt" : ""), hver);567 553 ver.sprintf("qt%s" QTDLL_POSTFIX "%d.lib", (project->isActiveConfig("thread") ? "-mt" : ""), hver); 568 554 QStringList &libs = project->variables()["QMAKE_LIBS"]; 569 //@@TODO (dmik): remove the comment below570 // @@@HGTODO maybe we must change the replace regexp if we understand what's going on571 555 for(QStringList::Iterator libit = libs.begin(); libit != libs.end(); ++libit) 572 //@@TODO (dmik): old, remove573 // (*libit).replace(QRegExp("qt(-mt)?\\.lib"), ver);574 // (*libit).replace(QRegExp("-lqt(-mt)?"), ver);575 556 (*libit).replace(QRegExp("qt(-mt)?(\\.lib)?"), ver); 576 }577 }578 if ( project->isActiveConfig( "activeqt" ) ) {579 project->variables().remove("QMAKE_LIBS_QT_ENTRY");580 project->variables()["QMAKE_LIBS_QT_ENTRY"] = "-lqaxserver";581 if ( project->isActiveConfig( "dll" ) ) {582 project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT_ENTRY"];583 557 } 584 558 } … … 618 592 project->variables()["TARGET_EXT"].append(".exe"); 619 593 } else { 620 //@@TODO (dmik): old, guess to remove621 // project->variables()["TARGET_EXT"].append(".a");622 // project->variables()["QMAKE_LFLAGS"].append("-static");623 // if(project->variables()["TARGET"].first().left(3) != "lib")624 // project->variables()["TARGET"].first().prepend("lib");625 // }626 594 project->variables()["TARGET_EXT"].append(".lib"); 627 595 } … … 676 644 677 645 project->variables()["QMAKE_FILETAGS"] += QStringList::split(' ', 678 "HEADERS SOURCES DEF_FILE DEF_FILE_TEMPLATE DEF_FILE_MAP RC_FILE TARGET"679 " QMAKE_LIBS DESTDIR DLLDESTDIR INCLUDEPATH");646 "HEADERS SOURCES DEF_FILE DEF_FILE_TEMPLATE DEF_FILE_MAP RC_FILE " 647 "RES_FILE TARGET QMAKE_LIBS DESTDIR DLLDESTDIR INCLUDEPATH"); 680 648 QStringList &l = project->variables()["QMAKE_FILETAGS"]; 681 649 QStringList::Iterator it; … … 686 654 } 687 655 688 //@@TODO (dmik): old, remove689 // if ( project->isActiveConfig("dll") ) {690 // QString destDir = "";691 // if (!project->first("DESTDIR").isEmpty())692 // destDir = project->first("DESTDIR") + "\\";693 // project->variables()["QMAKE_LFLAGS"].append(QString("-Wl,--out-implib,") +694 // destDir + "lib" + project->first("TARGET") + ".a");695 // }696 697 // if(!project->isActiveConfig("incremental"))698 // project->variables()["QMAKE_LFLAGS"].append(QString("/incremental:no"));699 700 656 if ( !project->variables()["RC_FILE"].isEmpty()) { 701 657 if ( !project->variables()["RES_FILE"].isEmpty()) { 702 658 fprintf( stderr, "Both RC_FILE and RES_FILE are specified.\n" ); 703 fprintf( stderr, "Please specify one of them, not both. " );659 fprintf( stderr, "Please specify one of them, not both.\n" ); 704 660 exit( 666 ); 705 661 } 706 project->variables()["RES_FILE"] = project->variables()["RC_FILE"]; 707 project->variables()["RES_FILE"].first().replace(".rc",Option::obj_ext); 708 project->variables()["POST_TARGETDEPS"] += project->variables()["RES_FILE"]; 709 project->variables()["CLEAN_FILES"] += project->variables()["RES_FILE"]; 710 } 711 662 project->variables()["RES_FILE"] = 663 Option::fixPathToLocalOS( var( "OBJECTS_DIR" ) + "/" 664 + QFileInfo( var( "RC_FILE" ) ).baseName( TRUE ) 665 + ".res", 666 FALSE ); 667 project->variables()["CLEAN_FILES"] += "$(RES_FILE)"; 668 } 669 712 670 if ( !project->variables()["RES_FILE"].isEmpty()) 713 project->variables()[" QMAKE_LIBS"] += project->variables()["RES_FILE"];714 671 project->variables()["POST_TARGETDEPS"] += "$(RES_FILE)"; 672 715 673 MakefileGenerator::init(); 716 674 … … 721 679 } 722 680 723 //@@TODO (dmik): old, remove724 // if(project->isActiveConfig("dll")) {725 // project->variables()["QMAKE_CLEAN"].append(project->first("DESTDIR") +"lib" + project->first("TARGET") + ".a");726 // }727 728 681 QStringList &quc = project->variables()["QMAKE_EXTRA_COMPILERS"]; 729 682 for(it = quc.begin(); it != quc.end(); ++it) {
Note:
See TracChangeset
for help on using the changeset viewer.