📄 unixmake2.cpp
字号:
destdir << "$(TARGET)" << endl << endl; t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(SUBLIBS) $(OBJCOMP) " << target_deps << " " << var("POST_TARGETDEPS"); } if(!destdir.isEmpty()) t << "\n\t" << mkdir_p_asstring(destdir); if(!project->isEmpty("QMAKE_PRE_LINK")) t << "\n\t" << var("QMAKE_PRE_LINK"); if(project->isActiveConfig("compile_libtool")) { t << "\n\t" << var("QMAKE_LINK_SHLIB_CMD"); } else if(project->isActiveConfig("plugin")) { t << "\n\t" << "-$(DEL_FILE) $(TARGET)" << "\n\t" << var("QMAKE_LINK_SHLIB_CMD"); if(!destdir.isEmpty()) t << "\n\t" << "-$(MOVE) $(TARGET) " << destdir; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK") << "\n\t"; t << endl << endl; } else if(!project->isEmpty("QMAKE_BUNDLE")) { t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(DESTDIR)$(TARGET0)" << "\n\t" << var("QMAKE_LINK_SHLIB_CMD") << "\n\t" << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGETD)`\"", false) << "\n\t" << "-$(MOVE) $(TARGET) $(DESTDIR)$(TARGETD)" << "\n\t" << mkdir_p_asstring("\"`dirname $(DESTDIR)$(TARGET0)`\"", false) << "\n\t" << varGlue("QMAKE_LN_SHLIB","-"," "," Versions/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/$(TARGET) $(DESTDIR)$(TARGET0)") << "\n\t" << "-$(DEL_FILE) " << destdir << "Versions/Current" << "\n\t" << varGlue("QMAKE_LN_SHLIB","-"," ", " " + project->first("QMAKE_FRAMEWORK_VERSION") + " " + destdir + "Versions/Current") << "\n\t"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else if(project->isEmpty("QMAKE_HPUX_SHLIB")) { t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2)" << "\n\t" << var("QMAKE_LINK_SHLIB_CMD") << "\n\t"; t << varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET0)") << "\n\t" << varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET1)") << "\n\t" << varGlue("QMAKE_LN_SHLIB","-"," "," $(TARGET) $(TARGET2)"); if(!destdir.isEmpty()) t << "\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET0)\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET1)\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET2)\n\t" << "-$(MOVE) $(TARGET) $(TARGET0) $(TARGET1) $(TARGET2) " << destdir; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } else { t << "\n\t" << "-$(DEL_FILE) $(TARGET) $(TARGET0)" << "\n\t" << var("QMAKE_LINK_SHLIB_CMD") << "\n\t"; t << varGlue("QMAKE_LN_SHLIB",""," "," $(TARGET) $(TARGET0)"); if(!destdir.isEmpty()) t << "\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET)\n\t" << "-$(DEL_FILE) " << destdir << "$(TARGET0)\n\t" << "-$(MOVE) $(TARGET) $(TARGET0) " << destdir; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\n\t" << var("QMAKE_POST_LINK"); t << endl << endl; } t << endl << endl; if (! project->isActiveConfig("plugin")) { t << "staticlib: $(TARGETA)" << endl << endl; t << "$(TARGETA): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP)"; if(do_incremental) t << " $(INCREMENTAL_OBJECTS)"; t << " " << var("POST_TARGETDEPS") << "\n\t" << "-$(DEL_FILE) $(TARGETA) " << "\n\t" << var("QMAKE_AR_CMD"); if(do_incremental) t << " $(INCREMENTAL_OBJECTS)"; if(!project->isEmpty("QMAKE_RANLIB")) t << "\n\t" << "$(RANLIB) $(TARGETA)"; t << endl << endl; } } else { QString destdir = project->first("DESTDIR"); t << "all: " << deps << " " << valGlue(escapeFilePaths(project->values("ALL_DEPS")),""," "," ") << destdir << "$(TARGET) " << varGlue("QMAKE_AR_SUBLIBS", destdir, " " + destdir, "") << "\n\n" << "staticlib: " << destdir << "$(TARGET)" << "\n\n"; if(project->isEmpty("QMAKE_AR_SUBLIBS")) { t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(OBJECTS) $(OBJCOMP) " << var("POST_TARGETDEPS") << "\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; t << "-$(DEL_FILE) $(TARGET)" << "\n\t" << var("QMAKE_AR_CMD") << "\n"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\t" << var("QMAKE_POST_LINK") << "\n"; if(!project->isEmpty("QMAKE_RANLIB")) t << "\t" << "$(RANLIB) $(TARGET)" << "\n"; if(!destdir.isEmpty()) t << "\t" << "-$(DEL_FILE) " << destdir << "$(TARGET)" << "\n" << "\t" << "-$(MOVE) $(TARGET) " << destdir << "\n"; } else { int max_files = project->first("QMAKE_MAX_FILES_PER_AR").toInt(); QStringList objs = project->values("OBJECTS") + project->values("OBJCOMP"), libs = project->values("QMAKE_AR_SUBLIBS"); libs.prepend("$(TARGET)"); for(QStringList::Iterator libit = libs.begin(), objit = objs.begin(); libit != libs.end(); ++libit) { QStringList build; for(int cnt = 0; cnt < max_files && objit != objs.end(); ++objit, cnt++) build << (*objit); QString ar; if((*libit) == "$(TARGET)") { t << destdir << "$(TARGET): " << var("PRE_TARGETDEPS") << " " << var("POST_TARGETDEPS") << valList(build) << "\n\t"; ar = project->values("QMAKE_AR_CMD").first(); ar = ar.replace("$(OBJECTS)", build.join(" ")); } else { t << (*libit) << ": " << valList(build) << "\n\t"; ar = "$(AR) " + (*libit) + " " + build.join(" "); } if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; t << "-$(DEL_FILE) " << (*libit) << "\n\t" << ar << "\n"; if(!project->isEmpty("QMAKE_POST_LINK")) t << "\t" << var("QMAKE_POST_LINK") << "\n"; if(!project->isEmpty("QMAKE_RANLIB")) t << "\t" << "$(RANLIB) " << (*libit) << "\n"; if(!destdir.isEmpty()) t << "\t" << "-$(DEL_FILE) " << destdir << (*libit) << "\n" << "\t" << "-$(MOVE) " << (*libit) << " " << destdir << "\n"; } } t << endl << endl; } writeMakeQmake(t); if(project->isEmpty("QMAKE_FAILED_REQUIREMENTS") && !project->isActiveConfig("no_autoqmake")) { QString meta_files; if(project->isActiveConfig("create_libtool") && project->first("TEMPLATE") == "lib" && !project->isActiveConfig("compile_libtool")) { //libtool if(!meta_files.isEmpty()) meta_files += " "; meta_files += libtoolFileName(); } if(project->isActiveConfig("create_pc") && project->first("TEMPLATE") == "lib") { //pkg-config if(!meta_files.isEmpty()) meta_files += " "; meta_files += pkgConfigFileName(); } if(!meta_files.isEmpty()) t << meta_files << ": " << "\n\t" << "@$(QMAKE) -prl " << buildArgs() << " " << project->projectFile() << endl; } if(!project->first("QMAKE_PKGINFO").isEmpty()) { QString pkginfo = escapeFilePath(project->first("QMAKE_PKGINFO")); QString destdir = escapeFilePath(project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents"); t << pkginfo << ": " << "\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; t << "@$(DEL_FILE) " << pkginfo << "\n\t" << "@echo \"APPL" << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << "\" >" << pkginfo << endl; } if(!project->isEmpty("QMAKE_BUNDLE")) { //copy the plist QString info_plist = escapeFilePath(fileFixify(project->first("QMAKE_INFO_PLIST"))), info_plist_out = escapeFilePath(project->first("QMAKE_INFO_PLIST_OUT")); QString destdir = info_plist_out.section(Option::dir_sep, 0, -2); t << info_plist_out << ": " << "\n\t"; if(!destdir.isEmpty()) t << mkdir_p_asstring(destdir) << "\n\t"; if(project->first("TEMPLATE") == "app") { QString icon = fileFixify(var("ICON")); t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed " << "-e \"s,@ICON@," << icon.section(Option::dir_sep, -1) << ",g\" " << "-e \"s,@EXECUTABLE@," << var("QMAKE_ORIG_TARGET") << ",g\" " << "-e \"s,@TYPEINFO@,"<< (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " << "" << info_plist << " >" << info_plist_out << endl; //copy the icon if(!project->isEmpty("ICON")) { QString dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/Contents/Resources/"; const QString icon_path = escapeFilePath(dir + icon.section(Option::dir_sep, -1)); t << icon_path << ": " << icon << "\n\t" << mkdir_p_asstring(dir) << "\n\t" << "@$(DEL_FILE) " << icon_path << "\n\t" << "@$(COPY_FILE) " << escapeFilePath(icon) << " " << icon_path << endl; } } else { t << "@$(DEL_FILE) " << info_plist_out << "\n\t" << "@sed " << "-e \"s,@LIBRARY@," << var("QMAKE_ORIG_TARGET") << ",g\" " << "-e \"s,@SHORT_VERSION@," << project->first("VER_MAJ") << "." << project->first("VER_MIN") << ",g\" " << "-e \"s,@TYPEINFO@," << (project->isEmpty("QMAKE_PKGINFO_TYPEINFO") ? QString::fromLatin1("????") : project->first("QMAKE_PKGINFO_TYPEINFO").left(4)) << ",g\" " << "" << info_plist << " >" << info_plist_out << endl; } //copy other data if(!project->isEmpty("QMAKE_BUNDLE_DATA")) { QString bundle_dir = project->first("DESTDIR") + project->first("QMAKE_BUNDLE") + "/"; const QStringList &bundle_data = project->values("QMAKE_BUNDLE_DATA"); for(int i = 0; i < bundle_data.count(); i++) { const QStringList &files = project->values(bundle_data[i] + ".files"); QString path = bundle_dir; if(!project->isEmpty(bundle_data[i] + ".version")) { QString version = project->first(bundle_data[i] + ".version") + "/" + project->first("QMAKE_FRAMEWORK_VERSION") + "/"; t << Option::fixPathToLocalOS(path + project->first(bundle_data[i] + ".path")) << ": " << "\n\t" << mkdir_p_asstring(path) << "\n\t" << "@$(SYMLINK) " << version << project->first(bundle_data[i] + ".path") << " " << path << endl; path += version; } path += project->first(bundle_data[i] + ".path"); path = Option::fixPathToLocalOS(path); for(int file = 0; file < files.count(); file++) { const QString dst = path + Option::dir_sep + fileInfo(files[file]).fileName(); t << dst << ": " << files[file] << "\n\t" << mkdir_p_asstring(path) << "\n\t"; QFileInfo fi(fileInfo(files[file])); if(fi.isDir()) t << "@$(DEL_FILE) -r " << dst << "\n\t" << "@$(COPY_DIR) " << files[file] << " " << dst << endl; else t << "@$(DEL_FILE) " << dst << "\n\t" << "@$(COPY_FILE) " << files[file] << " " << dst << endl; } } } } QString ddir; QString packageName(project->first("QMAKE_ORIG_TARGET")); if(!project->isActiveConfig("no_dist_version")) packageName += var("VERSION"); if (project->isEmpty("QMAKE_DISTDIR")) ddir = packageName; else ddir = project->first("QMAKE_DISTDIR"); QString ddir_c = escapeFilePath(fileFixify((project->isEmpty("OBJECTS_DIR") ? QString(".tmp/") :
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -