Changeset 670
- Timestamp:
- Mar 10, 2010, 11:06:48 PM (15 years ago)
- Location:
- trunk/qmake/generators/os2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/qmake/generators/os2/gnumake.cpp
r659 r670 90 90 // dependency escaping is always done Unix-way since this is a requirement 91 91 // of GNU make which allows " and ' to be part of the file name. 92 // Note that if the string is a make variable reference, we don't eascape! 92 // Note that if the string is a make variable reference, we don't eascape 93 // but instead use the q function defined in writeMakefile() that will do 94 // it at runtime. 93 95 QString ret = path; 94 96 QString trimmed = path.trimmed(); … … 96 98 ret.remove('\"'); 97 99 ret.replace(' ', "\\ "); 100 101 98 102 } 99 103 return ret; … … 522 526 { 523 527 t << "first: all" << endl; 524 t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") << escapeFileVars(" $(DESTDIR_TARGET)") << endl << endl; 525 t << escapeFileVars("$(DESTDIR_TARGET): ") << var("PRE_TARGETDEPS") << " $(OBJECTS) " << var("POST_TARGETDEPS"); 528 t << "all: " << escapeDependencyPath(fileFixify(Option::output.fileName())) << " " 529 << valGlue(escapeDependencyPaths(project->values("ALL_DEPS"))," "," "," ") 530 << escapeFileVars(" $(DESTDIR_TARGET)") << endl << endl; 531 t << escapeFileVars("$(DESTDIR_TARGET): ") << escapeFileVars(var("PRE_TARGETDEPS")) 532 << escapeFileVars(" $(OBJECTS) ") 533 << escapeFileVars(var("POST_TARGETDEPS")); 526 534 if (!project->isEmpty("QMAKE_PRE_LINK")) 527 535 t << "\n\t" <<var("QMAKE_PRE_LINK"); … … 564 572 if (!project->isEmpty("DEF_FILE_TEMPLATE")) { 565 573 t << "DEF_FILE_TEMPLATE = " << escapeFilePath(var("DEF_FILE_TEMPLATE")) << endl; 566 project->values("QMAKE_GENDEF_DEPS") += escapeFileVars("$(DEF_FILE_TEMPLATE)");574 project->values("QMAKE_GENDEF_DEPS") += ; 567 575 } 568 576 if (!project->isEmpty("DEF_FILE_MAP")) { 569 577 t << "DEF_FILE_MAP = " << escapeFilePath(var("DEF_FILE_MAP")) << endl; 570 project->values("QMAKE_GENDEF_DEPS") += escapeFileVars("$(DEF_FILE_MAP)");578 project->values("QMAKE_GENDEF_DEPS") += ; 571 579 } 572 580 } … … 578 586 } 579 587 t << "DEF_FILE = " << escapeFilePath(var("DEF_FILE")) << endl; 580 project->values("POST_TARGETDEPS") += escapeFileVars("$(DEF_FILE)");588 project->values("POST_TARGETDEPS") += ; 581 589 } 582 590 … … 598 606 if (project->isEmpty("DEF_FILE")) { 599 607 /* generate a DEF file for the DLL when not supplied */ 600 t << escapeFileVars("$(DEF_FILE): ") << var("QMAKE_GENDEF_DEPS");608 t << escapeFileVars("$(DEF_FILE): ") << ); 601 609 t << valGlue(var("QMAKE_RUN_GENDEF").split(";;"), "\n\t", "\n\t", "") << endl; 602 610 } … … 755 763 } 756 764 765 757 766 QString GNUMakefileGenerator::escapeFileVars(const QString &vars) 758 767 { 759 768 /* In DOS environment, we escape spaces and other illegal characters in 760 * filenames with double quotes. However, this is not appropriate for make761 * rule definitions (targets/dependencies) where Unix escaping is769 * filenames with double quotes. However, this is not appropriate for 770 * rule definitions (targets/dependencies) where Unix escaping is 762 771 * expected. If we'd deal only with immediate strings, we could provide 763 772 * necessary escaping in place, but we often use make variables instead of 764 773 * direct file names so we must perform such escaping on the fly. This is 765 774 * what we do here using the q function that we define in writeMakefile().*/ 766 if (isDosLikeShell()) { 767 QString ret = vars; 768 QRegExp rx = QRegExp("\\$\\((.+)\\)"); 769 rx.setMinimal(true); 770 ret.replace(rx, "$(call q,$(\\1))"); 771 return ret; 772 } 773 return vars; 775 QString ret = vars; 776 QRegExp rx = QRegExp("(?:\\$\\(call q,\\$\\((.+)\\)\\))|" 777 "(?:\\$\\(([^$)]+)\\))"); 778 rx.setMinimal(true); 779 ret.replace(rx, "$(call q,$(\\1\\2))"); 780 return ret; 774 781 } 775 782 -
trunk/qmake/generators/os2/gnumake.h
r659 r670 89 89 void createLinkerResponseFiles(QTextStream &t); 90 90 void createCompilerResponseFiles(QTextStream &t); 91 QString escapeFileVars(const QString &base); 91 92 static QString escapeFileVars(const QString &base); 92 93 93 94 bool init_flag;
Note:
See TracChangeset
for help on using the changeset viewer.