-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 33 |
1 files changed, 17 insertions, 16 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index cbe2014..9bb6f6b 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp | |||
@@ -79,7 +79,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
79 | bool do_incremental = (project->isActiveConfig("incremental") && | 79 | bool do_incremental = (project->isActiveConfig("incremental") && |
80 | !project->variables()["QMAKE_INCREMENTAL"].isEmpty() && | 80 | !project->variables()["QMAKE_INCREMENTAL"].isEmpty() && |
81 | (!project->variables()["QMAKE_APP_FLAG"].isEmpty() || | 81 | (!project->variables()["QMAKE_APP_FLAG"].isEmpty() || |
82 | !project->isActiveConfig("staticlib"))), | 82 | !project->isActiveConfig("staticlib"))), |
83 | src_incremental=FALSE, moc_incremental=FALSE; | 83 | src_incremental=FALSE, moc_incremental=FALSE; |
84 | QString os = project->variables()["QMAKESPEC"].first().section( '-', 0, 0 ); | 84 | QString os = project->variables()["QMAKESPEC"].first().section( '-', 0, 0 ); |
85 | 85 | ||
@@ -136,6 +136,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
136 | t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl; | 136 | t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl; |
137 | t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; | 137 | t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; |
138 | t << "MOVE = " << var("QMAKE_MOVE") << endl; | 138 | t << "MOVE = " << var("QMAKE_MOVE") << endl; |
139 | t << "PRO = " << fileFixify(project->projectFile() )<< endl; | ||
139 | t << endl; | 140 | t << endl; |
140 | 141 | ||
141 | t << "####### Output directory" << endl << endl; | 142 | t << "####### Output directory" << endl << endl; |
@@ -530,7 +531,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
530 | t << endl << endl; | 531 | t << endl << endl; |
531 | } | 532 | } |
532 | } else { | 533 | } else { |
533 | t << "all: " << deps << " " << varGlue("ALL_DEPS",""," "," ") << var("DESTDIR") << "$(TARGET) " | 534 | t << "all: " << deps << " " << varGlue("ALL_DEPS",""," "," ") << var("DESTDIR") << "$(TARGET) " |
534 | << varGlue("QMAKE_AR_SUBLIBS", var("DESTDIR"), " " + var("DESTDIR"), "") << "\n\n" | 535 | << varGlue("QMAKE_AR_SUBLIBS", var("DESTDIR"), " " + var("DESTDIR"), "") << "\n\n" |
535 | << "staticlib: " << var("DESTDIR") << "$(TARGET)" << "\n\n"; | 536 | << "staticlib: " << var("DESTDIR") << "$(TARGET)" << "\n\n"; |
536 | if(project->isEmpty("QMAKE_AR_SUBLIBS")) { | 537 | if(project->isEmpty("QMAKE_AR_SUBLIBS")) { |
@@ -545,7 +546,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
545 | t << "\t" << var("QMAKE_POST_LINK") << "\n"; | 546 | t << "\t" << var("QMAKE_POST_LINK") << "\n"; |
546 | if(!project->isEmpty("QMAKE_RANLIB")) | 547 | if(!project->isEmpty("QMAKE_RANLIB")) |
547 | t << "\t" << "$(RANLIB) $(TARGET)" << "\n"; | 548 | t << "\t" << "$(RANLIB) $(TARGET)" << "\n"; |
548 | if(!project->isEmpty("DESTDIR")) | 549 | if(!project->isEmpty("DESTDIR")) |
549 | t << "\t" << "-$(DEL_FILE) " << var("DESTDIR") << "$(TARGET)" << "\n" | 550 | t << "\t" << "-$(DEL_FILE) " << var("DESTDIR") << "$(TARGET)" << "\n" |
550 | << "\t" << "-$(MOVE) $(TARGET) " << var("DESTDIR") << "\n"; | 551 | << "\t" << "-$(MOVE) $(TARGET) " << var("DESTDIR") << "\n"; |
551 | } else { | 552 | } else { |
@@ -553,17 +554,17 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
553 | QStringList objs = project->variables()["OBJECTS"] + project->variables()["OBJMOC"], | 554 | QStringList objs = project->variables()["OBJECTS"] + project->variables()["OBJMOC"], |
554 | libs = project->variables()["QMAKE_AR_SUBLIBS"]; | 555 | libs = project->variables()["QMAKE_AR_SUBLIBS"]; |
555 | libs.prepend("$(TARGET)"); | 556 | libs.prepend("$(TARGET)"); |
556 | for(QStringList::Iterator libit = libs.begin(), objit = objs.begin(); | 557 | for(QStringList::Iterator libit = libs.begin(), objit = objs.begin(); |
557 | libit != libs.end(); ++libit) { | 558 | libit != libs.end(); ++libit) { |
558 | QStringList build; | 559 | QStringList build; |
559 | for(cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++) | 560 | for(cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++) |
560 | build << (*objit); | 561 | build << (*objit); |
561 | QString ar; | 562 | QString ar; |
562 | if((*libit) == "$(TARGET)") { | 563 | if((*libit) == "$(TARGET)") { |
563 | t << var("DESTDIR") << "$(TARGET): $(UICDECLS) " << " $(TARGETDEPS) " | 564 | t << var("DESTDIR") << "$(TARGET): $(UICDECLS) " << " $(TARGETDEPS) " |
564 | << valList(build) << "\n\t"; | 565 | << valList(build) << "\n\t"; |
565 | ar = project->variables()["QMAKE_AR_CMD"].first(); | 566 | ar = project->variables()["QMAKE_AR_CMD"].first(); |
566 | ar = ar.replace("$(OBJMOC)", "").replace("$(OBJECTS)", | 567 | ar = ar.replace("$(OBJMOC)", "").replace("$(OBJECTS)", |
567 | build.join(" ")); | 568 | build.join(" ")); |
568 | } else { | 569 | } else { |
569 | t << (*libit) << ": " << valList(build) << "\n\t"; | 570 | t << (*libit) << ": " << valList(build) << "\n\t"; |
@@ -579,7 +580,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
579 | t << "\t" << var("QMAKE_POST_LINK") << "\n"; | 580 | t << "\t" << var("QMAKE_POST_LINK") << "\n"; |
580 | if(!project->isEmpty("QMAKE_RANLIB")) | 581 | if(!project->isEmpty("QMAKE_RANLIB")) |
581 | t << "\t" << "$(RANLIB) " << (*libit) << "\n"; | 582 | t << "\t" << "$(RANLIB) " << (*libit) << "\n"; |
582 | if(!project->isEmpty("DESTDIR")) | 583 | if(!project->isEmpty("DESTDIR")) |
583 | t << "\t" << "-$(DEL_FILE) " << var("DESTDIR") << (*libit) << "\n" | 584 | t << "\t" << "-$(DEL_FILE) " << var("DESTDIR") << (*libit) << "\n" |
584 | << "\t" << "-$(MOVE) " << (*libit) << " " << var("DESTDIR") << "\n"; | 585 | << "\t" << "-$(MOVE) " << (*libit) << " " << var("DESTDIR") << "\n"; |
585 | } | 586 | } |
@@ -596,7 +597,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
596 | QString moc = project->first("QMAKE_MOC"), target = project->first("TARGET"); | 597 | QString moc = project->first("QMAKE_MOC"), target = project->first("TARGET"); |
597 | fixEnvVariables(target); | 598 | fixEnvVariables(target); |
598 | fixEnvVariables(moc); | 599 | fixEnvVariables(moc); |
599 | if(target != moc) | 600 | if(target != moc) |
600 | t << "$(MOC): \n\t" | 601 | t << "$(MOC): \n\t" |
601 | << "( cd $(QTDIR)/src/moc ; $(MAKE) )" << endl << endl; | 602 | << "( cd $(QTDIR)/src/moc ; $(MAKE) )" << endl << endl; |
602 | } | 603 | } |
@@ -642,7 +643,7 @@ UnixMakefileGenerator::writeMakeParts(QTextStream &t) | |||
642 | QStringList &forms = project->variables()["FORMS"], ui_headers; | 643 | QStringList &forms = project->variables()["FORMS"], ui_headers; |
643 | for(QStringList::Iterator formit = forms.begin(); formit != forms.end(); ++formit) { | 644 | for(QStringList::Iterator formit = forms.begin(); formit != forms.end(); ++formit) { |
644 | QString ui_h = fileFixify((*formit) + Option::h_ext.first()); | 645 | QString ui_h = fileFixify((*formit) + Option::h_ext.first()); |
645 | if(QFile::exists(ui_h) ) | 646 | if(QFile::exists(ui_h) ) |
646 | ui_headers << ui_h; | 647 | ui_headers << ui_h; |
647 | } | 648 | } |
648 | if(!ui_headers.isEmpty()) | 649 | if(!ui_headers.isEmpty()) |
@@ -805,7 +806,7 @@ UnixMakefileGenerator::writeSubdirs(QTextStream &t, bool direct) | |||
805 | t << "QMAKE =" << var("QMAKE") << endl; | 806 | t << "QMAKE =" << var("QMAKE") << endl; |
806 | t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; | 807 | t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; |
807 | t << "SUBTARGETS ="; // subdirectory targets are sub-directory | 808 | t << "SUBTARGETS ="; // subdirectory targets are sub-directory |
808 | for( it.toFirst(); it.current(); ++it) | 809 | for( it.toFirst(); it.current(); ++it) |
809 | t << " \\\n\t\t" << it.current()->target; | 810 | t << " \\\n\t\t" << it.current()->target; |
810 | t << endl << endl; | 811 | t << endl << endl; |
811 | t << "first: all\n\nall: " << ofile << " $(SUBTARGETS)" << endl << endl; | 812 | t << "first: all\n\nall: " << ofile << " $(SUBTARGETS)" << endl << endl; |
@@ -834,7 +835,7 @@ UnixMakefileGenerator::writeSubdirs(QTextStream &t, bool direct) | |||
834 | for( it.toFirst(); it.current(); ) { | 835 | for( it.toFirst(); it.current(); ) { |
835 | QString tar = it.current()->target; | 836 | QString tar = it.current()->target; |
836 | ++it; | 837 | ++it; |
837 | if (it.current()) | 838 | if (it.current()) |
838 | t << it.current()->target << ": " << tar << endl; | 839 | t << it.current()->target << ": " << tar << endl; |
839 | } | 840 | } |
840 | t << endl; | 841 | t << endl; |
@@ -857,7 +858,7 @@ UnixMakefileGenerator::writeSubdirs(QTextStream &t, bool direct) | |||
857 | t << "\n\t ( "; | 858 | t << "\n\t ( "; |
858 | if(!(*it)->directory.isEmpty()) | 859 | if(!(*it)->directory.isEmpty()) |
859 | t << "[ -d " << (*it)->directory << " ] && cd " << (*it)->directory << " ; "; | 860 | t << "[ -d " << (*it)->directory << " ] && cd " << (*it)->directory << " ; "; |
860 | t << "grep \"^qmake_all:\" " << (*it)->makefile | 861 | t << "grep \"^qmake_all:\" " << (*it)->makefile |
861 | << " && $(MAKE) -f " << (*it)->makefile << " qmake_all" << "; ) || true"; | 862 | << " && $(MAKE) -f " << (*it)->makefile << " qmake_all" << "; ) || true"; |
862 | } | 863 | } |
863 | t << endl; | 864 | t << endl; |
@@ -922,7 +923,7 @@ void UnixMakefileGenerator::init2() | |||
922 | project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_SHLIB")); | 923 | project->first("TARGET") + "." + project->first("QMAKE_EXTENSION_SHLIB")); |
923 | if(project->isActiveConfig("lib_version_first")) | 924 | if(project->isActiveConfig("lib_version_first")) |
924 | project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." + | 925 | project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." + |
925 | project->first("VER_MAJ") + "." + | 926 | project->first("VER_MAJ") + "." + |
926 | project->first("QMAKE_EXTENSION_SHLIB")); | 927 | project->first("QMAKE_EXTENSION_SHLIB")); |
927 | else | 928 | else |
928 | project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." + | 929 | project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." + |
@@ -935,10 +936,10 @@ void UnixMakefileGenerator::init2() | |||
935 | } else if ( os == "hpux" ) { | 936 | } else if ( os == "hpux" ) { |
936 | project->variables()["TARGET_"].append("lib" + project->first("TARGET") + ".sl"); | 937 | project->variables()["TARGET_"].append("lib" + project->first("TARGET") + ".sl"); |
937 | if(project->isActiveConfig("lib_version_first")) | 938 | if(project->isActiveConfig("lib_version_first")) |
938 | project->variables()["TARGET_x"].append("lib" + project->first("VER_MAJ") + "." + | 939 | project->variables()["TARGET_x"].append("lib" + project->first("VER_MAJ") + "." + |
939 | project->first("TARGET")); | 940 | project->first("TARGET")); |
940 | else | 941 | else |
941 | project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." + | 942 | project->variables()["TARGET_x"].append("lib" + project->first("TARGET") + "." + |
942 | project->first("VER_MAJ")); | 943 | project->first("VER_MAJ")); |
943 | project->variables()["TARGET"] = project->variables()["TARGET_x"]; | 944 | project->variables()["TARGET"] = project->variables()["TARGET_x"]; |
944 | } else if ( os == "aix" ) { | 945 | } else if ( os == "aix" ) { |