author | mickeyl <mickeyl> | 2003-12-28 00:32:51 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-12-28 00:32:51 (UTC) |
commit | e889485e945d8fa9564566f286114be10d2a1ce5 (patch) (unidiff) | |
tree | 23eb3b07521f36d22b165793164c25f1d0acdaae | |
parent | 7812187f6732eef351e501d993aa664b7e351cbb (diff) | |
download | opie-e889485e945d8fa9564566f286114be10d2a1ce5.zip opie-e889485e945d8fa9564566f286114be10d2a1ce5.tar.gz opie-e889485e945d8fa9564566f286114be10d2a1ce5.tar.bz2 |
fix qmake 1.05a to generate the PRO line in a Makefile
this feature seemed to have been removed in 1.05a - it was
in 1.04a and is needed for opie-lupdate to work
-rw-r--r-- | qmake/generators/unix/unixmake2.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/qmake/generators/unix/unixmake2.cpp b/qmake/generators/unix/unixmake2.cpp index 7fbb9f4..d8a4a0d 100644 --- a/qmake/generators/unix/unixmake2.cpp +++ b/qmake/generators/unix/unixmake2.cpp | |||
@@ -49,192 +49,193 @@ UnixMakefileGenerator::UnixMakefileGenerator(QMakeProject *p) : MakefileGenerato | |||
49 | } | 49 | } |
50 | 50 | ||
51 | bool | 51 | bool |
52 | UnixMakefileGenerator::writeMakefile(QTextStream &t) | 52 | UnixMakefileGenerator::writeMakefile(QTextStream &t) |
53 | { | 53 | { |
54 | writeHeader(t); | 54 | writeHeader(t); |
55 | if(!project->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) { | 55 | if(!project->variables()["QMAKE_FAILED_REQUIREMENTS"].isEmpty()) { |
56 | t << "all clean:" << "\n\t" | 56 | t << "all clean:" << "\n\t" |
57 | << "@echo \"Some of the required modules (" | 57 | << "@echo \"Some of the required modules (" |
58 | << var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t" | 58 | << var("QMAKE_FAILED_REQUIREMENTS") << ") are not available.\"" << "\n\t" |
59 | << "@echo \"Skipped.\"" << endl << endl; | 59 | << "@echo \"Skipped.\"" << endl << endl; |
60 | writeMakeQmake(t); | 60 | writeMakeQmake(t); |
61 | return TRUE; | 61 | return TRUE; |
62 | } | 62 | } |
63 | 63 | ||
64 | if (project->variables()["TEMPLATE"].first() == "app" || | 64 | if (project->variables()["TEMPLATE"].first() == "app" || |
65 | project->variables()["TEMPLATE"].first() == "lib") { | 65 | project->variables()["TEMPLATE"].first() == "lib") { |
66 | writeMakeParts(t); | 66 | writeMakeParts(t); |
67 | return MakefileGenerator::writeMakefile(t); | 67 | return MakefileGenerator::writeMakefile(t); |
68 | } else if(project->variables()["TEMPLATE"].first() == "subdirs") { | 68 | } else if(project->variables()["TEMPLATE"].first() == "subdirs") { |
69 | writeSubdirs(t); | 69 | writeSubdirs(t); |
70 | return TRUE; | 70 | return TRUE; |
71 | } | 71 | } |
72 | return FALSE; | 72 | return FALSE; |
73 | } | 73 | } |
74 | 74 | ||
75 | void | 75 | void |
76 | UnixMakefileGenerator::writeMakeParts(QTextStream &t) | 76 | UnixMakefileGenerator::writeMakeParts(QTextStream &t) |
77 | { | 77 | { |
78 | QString deps = fileFixify(Option::output.name()), prl; | 78 | QString deps = fileFixify(Option::output.name()), prl; |
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 | 84 | ||
85 | t << "####### Compiler, tools and options" << endl << endl; | 85 | t << "####### Compiler, tools and options" << endl << endl; |
86 | t << "CC = "; | 86 | t << "CC = "; |
87 | if (project->isActiveConfig("thread") && | 87 | if (project->isActiveConfig("thread") && |
88 | ! project->variables()["QMAKE_CC_THREAD"].isEmpty()) | 88 | ! project->variables()["QMAKE_CC_THREAD"].isEmpty()) |
89 | t << var("QMAKE_CC_THREAD") << endl; | 89 | t << var("QMAKE_CC_THREAD") << endl; |
90 | else | 90 | else |
91 | t << var("QMAKE_CC") << endl; | 91 | t << var("QMAKE_CC") << endl; |
92 | 92 | ||
93 | t << "CXX = "; | 93 | t << "CXX = "; |
94 | if (project->isActiveConfig("thread") && | 94 | if (project->isActiveConfig("thread") && |
95 | ! project->variables()["QMAKE_CXX_THREAD"].isEmpty()) | 95 | ! project->variables()["QMAKE_CXX_THREAD"].isEmpty()) |
96 | t << var("QMAKE_CXX_THREAD") << endl; | 96 | t << var("QMAKE_CXX_THREAD") << endl; |
97 | else | 97 | else |
98 | t << var("QMAKE_CXX") << endl; | 98 | t << var("QMAKE_CXX") << endl; |
99 | 99 | ||
100 | t << "LEX = " << var("QMAKE_LEX") << endl; | 100 | t << "LEX = " << var("QMAKE_LEX") << endl; |
101 | t << "YACC = " << var("QMAKE_YACC") << endl; | 101 | t << "YACC = " << var("QMAKE_YACC") << endl; |
102 | t << "CFLAGS = " << var("QMAKE_CFLAGS") << " " | 102 | t << "CFLAGS = " << var("QMAKE_CFLAGS") << " " |
103 | << varGlue("PRL_EXPORT_DEFINES","-D"," -D","") << " " | 103 | << varGlue("PRL_EXPORT_DEFINES","-D"," -D","") << " " |
104 | << varGlue("DEFINES","-D"," -D","") << endl; | 104 | << varGlue("DEFINES","-D"," -D","") << endl; |
105 | t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " " | 105 | t << "CXXFLAGS = " << var("QMAKE_CXXFLAGS") << " " |
106 | << varGlue("PRL_EXPORT_DEFINES","-D"," -D","") << " " | 106 | << varGlue("PRL_EXPORT_DEFINES","-D"," -D","") << " " |
107 | << varGlue("DEFINES","-D"," -D","") << endl; | 107 | << varGlue("DEFINES","-D"," -D","") << endl; |
108 | t << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl; | 108 | t << "LEXFLAGS = " << var("QMAKE_LEXFLAGS") << endl; |
109 | t << "YACCFLAGS= " << var("QMAKE_YACCFLAGS") << endl; | 109 | t << "YACCFLAGS= " << var("QMAKE_YACCFLAGS") << endl; |
110 | t << "INCPATH = " << "-I" << specdir(); | 110 | t << "INCPATH = " << "-I" << specdir(); |
111 | if(!project->isActiveConfig("no_include_pwd")) { | 111 | if(!project->isActiveConfig("no_include_pwd")) { |
112 | QString pwd = fileFixify(QDir::currentDirPath()); | 112 | QString pwd = fileFixify(QDir::currentDirPath()); |
113 | if(pwd.isEmpty()) | 113 | if(pwd.isEmpty()) |
114 | pwd = "."; | 114 | pwd = "."; |
115 | t << " -I" << pwd; | 115 | t << " -I" << pwd; |
116 | } | 116 | } |
117 | t << varGlue("INCLUDEPATH"," -I", " -I", "") << endl; | 117 | t << varGlue("INCLUDEPATH"," -I", " -I", "") << endl; |
118 | 118 | ||
119 | if(!project->isActiveConfig("staticlib")) { | 119 | if(!project->isActiveConfig("staticlib")) { |
120 | t << "LINK = "; | 120 | t << "LINK = "; |
121 | if (project->isActiveConfig("thread") && | 121 | if (project->isActiveConfig("thread") && |
122 | ! project->variables()["QMAKE_LINK_THREAD"].isEmpty()) | 122 | ! project->variables()["QMAKE_LINK_THREAD"].isEmpty()) |
123 | t << var("QMAKE_LINK_THREAD") << endl; | 123 | t << var("QMAKE_LINK_THREAD") << endl; |
124 | else | 124 | else |
125 | t << var("QMAKE_LINK") << endl; | 125 | t << var("QMAKE_LINK") << endl; |
126 | 126 | ||
127 | t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; | 127 | t << "LFLAGS = " << var("QMAKE_LFLAGS") << endl; |
128 | t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_LIBDIR_FLAGS") << " " << var("QMAKE_LIBS") << endl; | 128 | t << "LIBS = " << "$(SUBLIBS) " << var("QMAKE_LIBDIR_FLAGS") << " " << var("QMAKE_LIBS") << endl; |
129 | } | 129 | } |
130 | 130 | ||
131 | t << "AR = " << var("QMAKE_AR") << endl; | 131 | t << "AR = " << var("QMAKE_AR") << endl; |
132 | t << "RANLIB = " << var("QMAKE_RANLIB") << endl; | 132 | t << "RANLIB = " << var("QMAKE_RANLIB") << endl; |
133 | t << "MOC = " << var("QMAKE_MOC") << endl; | 133 | t << "MOC = " << var("QMAKE_MOC") << endl; |
134 | t << "UIC = "<< var("QMAKE_UIC") << endl; | 134 | t << "UIC = "<< var("QMAKE_UIC") << endl; |
135 | t << "QMAKE = "<< (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl; | 135 | t << "QMAKE = "<< (project->isEmpty("QMAKE_QMAKE") ? QString("qmake") : var("QMAKE_QMAKE")) << endl; |
136 | t << "TAR = "<< var("QMAKE_TAR") << endl; | 136 | t << "TAR = "<< var("QMAKE_TAR") << endl; |
137 | t << "GZIP = " << var("QMAKE_GZIP") << endl; | 137 | t << "GZIP = " << var("QMAKE_GZIP") << endl; |
138 | t << "COPY = " << var("QMAKE_COPY") << endl; | 138 | t << "COPY = " << var("QMAKE_COPY") << endl; |
139 | t << "COPY_FILE= " << var("QMAKE_COPY_FILE") << endl; | 139 | t << "COPY_FILE= " << var("QMAKE_COPY_FILE") << endl; |
140 | t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl; | 140 | t << "COPY_DIR = " << var("QMAKE_COPY_DIR") << endl; |
141 | t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; | 141 | t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; |
142 | t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl; | 142 | t << "SYMLINK = " << var("QMAKE_SYMBOLIC_LINK") << endl; |
143 | t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; | 143 | t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; |
144 | t << "MOVE = " << var("QMAKE_MOVE") << endl; | 144 | t << "MOVE = " << var("QMAKE_MOVE") << endl; |
145 | t << "PRO = " << fileFixify(project->projectFile() )<< endl; | ||
145 | t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl; | 146 | t << "CHK_DIR_EXISTS= " << var("QMAKE_CHK_DIR_EXISTS") << endl; |
146 | t << "MKDIR = " << var("QMAKE_MKDIR") << endl; | 147 | t << "MKDIR = " << var("QMAKE_MKDIR") << endl; |
147 | t << endl; | 148 | t << endl; |
148 | 149 | ||
149 | t << "####### Output directory" << endl << endl; | 150 | t << "####### Output directory" << endl << endl; |
150 | if (! project->variables()["OBJECTS_DIR"].isEmpty()) | 151 | if (! project->variables()["OBJECTS_DIR"].isEmpty()) |
151 | t << "OBJECTS_DIR = " << var("OBJECTS_DIR") << endl; | 152 | t << "OBJECTS_DIR = " << var("OBJECTS_DIR") << endl; |
152 | else | 153 | else |
153 | t << "OBJECTS_DIR = ./" << endl; | 154 | t << "OBJECTS_DIR = ./" << endl; |
154 | t << endl; | 155 | t << endl; |
155 | 156 | ||
156 | /* files */ | 157 | /* files */ |
157 | t << "####### Files" << endl << endl; | 158 | t << "####### Files" << endl << endl; |
158 | t << "HEADERS = " << varList("HEADERS") << endl; | 159 | t << "HEADERS = " << varList("HEADERS") << endl; |
159 | t << "SOURCES = " << varList("SOURCES") << endl; | 160 | t << "SOURCES = " << varList("SOURCES") << endl; |
160 | if(do_incremental) { | 161 | if(do_incremental) { |
161 | QStringList &objs = project->variables()["OBJECTS"], &incrs = project->variables()["QMAKE_INCREMENTAL"], incrs_out; | 162 | QStringList &objs = project->variables()["OBJECTS"], &incrs = project->variables()["QMAKE_INCREMENTAL"], incrs_out; |
162 | t << "OBJECTS = "; | 163 | t << "OBJECTS = "; |
163 | for(QStringList::Iterator objit = objs.begin(); objit != objs.end(); ++objit) { | 164 | for(QStringList::Iterator objit = objs.begin(); objit != objs.end(); ++objit) { |
164 | bool increment = FALSE; | 165 | bool increment = FALSE; |
165 | for(QStringList::Iterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) { | 166 | for(QStringList::Iterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) { |
166 | if((*objit).find(QRegExp((*incrit), TRUE, TRUE)) != -1) { | 167 | if((*objit).find(QRegExp((*incrit), TRUE, TRUE)) != -1) { |
167 | increment = TRUE; | 168 | increment = TRUE; |
168 | incrs_out.append((*objit)); | 169 | incrs_out.append((*objit)); |
169 | break; | 170 | break; |
170 | } | 171 | } |
171 | } | 172 | } |
172 | if(!increment) | 173 | if(!increment) |
173 | t << "\\\n\t\t" << (*objit); | 174 | t << "\\\n\t\t" << (*objit); |
174 | } | 175 | } |
175 | if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done! | 176 | if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done! |
176 | t << incrs_out.join(" \\\n\t\t") << endl; | 177 | t << incrs_out.join(" \\\n\t\t") << endl; |
177 | } else if(!incrs_out.count()) { | 178 | } else if(!incrs_out.count()) { |
178 | t << endl; | 179 | t << endl; |
179 | } else { | 180 | } else { |
180 | src_incremental = TRUE; | 181 | src_incremental = TRUE; |
181 | t << endl; | 182 | t << endl; |
182 | t << "INCREMENTAL_OBJECTS = " << incrs_out.join(" \\\n\t\t") << endl; | 183 | t << "INCREMENTAL_OBJECTS = " << incrs_out.join(" \\\n\t\t") << endl; |
183 | } | 184 | } |
184 | } else { | 185 | } else { |
185 | t << "OBJECTS = " << varList("OBJECTS") << endl; | 186 | t << "OBJECTS = " << varList("OBJECTS") << endl; |
186 | } | 187 | } |
187 | t << "FORMS = " << varList("FORMS") << endl; | 188 | t << "FORMS = " << varList("FORMS") << endl; |
188 | t << "UICDECLS = " << varList("UICDECLS") << endl; | 189 | t << "UICDECLS = " << varList("UICDECLS") << endl; |
189 | t << "UICIMPLS = " << varList("UICIMPLS") << endl; | 190 | t << "UICIMPLS = " << varList("UICIMPLS") << endl; |
190 | QString srcMoc = varList("SRCMOC"), objMoc = varList("OBJMOC"); | 191 | QString srcMoc = varList("SRCMOC"), objMoc = varList("OBJMOC"); |
191 | t << "SRCMOC = " << srcMoc << endl; | 192 | t << "SRCMOC = " << srcMoc << endl; |
192 | if(do_incremental) { | 193 | if(do_incremental) { |
193 | QStringList &objs = project->variables()["OBJMOC"], | 194 | QStringList &objs = project->variables()["OBJMOC"], |
194 | &incrs = project->variables()["QMAKE_INCREMENTAL"], incrs_out; | 195 | &incrs = project->variables()["QMAKE_INCREMENTAL"], incrs_out; |
195 | t << "OBJMOC = "; | 196 | t << "OBJMOC = "; |
196 | for(QStringList::Iterator objit = objs.begin(); objit != objs.end(); ++objit) { | 197 | for(QStringList::Iterator objit = objs.begin(); objit != objs.end(); ++objit) { |
197 | bool increment = FALSE; | 198 | bool increment = FALSE; |
198 | for(QStringList::Iterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) { | 199 | for(QStringList::Iterator incrit = incrs.begin(); incrit != incrs.end(); ++incrit) { |
199 | if((*objit).find(QRegExp((*incrit), TRUE, TRUE)) != -1) { | 200 | if((*objit).find(QRegExp((*incrit), TRUE, TRUE)) != -1) { |
200 | increment = TRUE; | 201 | increment = TRUE; |
201 | incrs_out.append((*objit)); | 202 | incrs_out.append((*objit)); |
202 | break; | 203 | break; |
203 | } | 204 | } |
204 | } | 205 | } |
205 | if(!increment) | 206 | if(!increment) |
206 | t << "\\\n\t\t" << (*objit); | 207 | t << "\\\n\t\t" << (*objit); |
207 | } | 208 | } |
208 | if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done! | 209 | if(incrs_out.count() == objs.count()) { //we just switched places, no real incrementals to be done! |
209 | t << incrs_out.join(" \\\n\t\t") << endl; | 210 | t << incrs_out.join(" \\\n\t\t") << endl; |
210 | } else if(!incrs_out.count()) { | 211 | } else if(!incrs_out.count()) { |
211 | t << endl; | 212 | t << endl; |
212 | } else { | 213 | } else { |
213 | moc_incremental = TRUE; | 214 | moc_incremental = TRUE; |
214 | t << endl; | 215 | t << endl; |
215 | t << "INCREMENTAL_OBJMOC = " << incrs_out.join(" \\\n\t\t") << endl; | 216 | t << "INCREMENTAL_OBJMOC = " << incrs_out.join(" \\\n\t\t") << endl; |
216 | } | 217 | } |
217 | } else { | 218 | } else { |
218 | t << "OBJMOC = " << objMoc << endl; | 219 | t << "OBJMOC = " << objMoc << endl; |
219 | } | 220 | } |
220 | if(do_incremental && !moc_incremental && !src_incremental) | 221 | if(do_incremental && !moc_incremental && !src_incremental) |
221 | do_incremental = FALSE; | 222 | do_incremental = FALSE; |
222 | t << "DIST = " << valList(fileFixify(project->variables()["DISTFILES"])) << endl; | 223 | t << "DIST = " << valList(fileFixify(project->variables()["DISTFILES"])) << endl; |
223 | t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; | 224 | t << "QMAKE_TARGET = " << var("QMAKE_ORIG_TARGET") << endl; |
224 | t << "DESTDIR = " << var("DESTDIR") << endl; | 225 | t << "DESTDIR = " << var("DESTDIR") << endl; |
225 | t << "TARGET = " << var("TARGET") << endl; | 226 | t << "TARGET = " << var("TARGET") << endl; |
226 | if(project->isActiveConfig("plugin") ) { | 227 | if(project->isActiveConfig("plugin") ) { |
227 | t << "TARGETD = " << var("TARGET") << endl; | 228 | t << "TARGETD = " << var("TARGET") << endl; |
228 | } else if (!project->isActiveConfig("staticlib") && project->variables()["QMAKE_APP_FLAG"].isEmpty()) { | 229 | } else if (!project->isActiveConfig("staticlib") && project->variables()["QMAKE_APP_FLAG"].isEmpty()) { |
229 | t << "TARGETA= " << var("TARGETA") << endl; | 230 | t << "TARGETA= " << var("TARGETA") << endl; |
230 | if (project->isEmpty("QMAKE_HPUX_SHLIB")) { | 231 | if (project->isEmpty("QMAKE_HPUX_SHLIB")) { |
231 | t << "TARGETD= " << var("TARGET_x.y.z") << endl; | 232 | t << "TARGETD= " << var("TARGET_x.y.z") << endl; |
232 | t << "TARGET0= " << var("TARGET_") << endl; | 233 | t << "TARGET0= " << var("TARGET_") << endl; |
233 | t << "TARGET1= " << var("TARGET_x") << endl; | 234 | t << "TARGET1= " << var("TARGET_x") << endl; |
234 | t << "TARGET2= " << var("TARGET_x.y") << endl; | 235 | t << "TARGET2= " << var("TARGET_x.y") << endl; |
235 | } else { | 236 | } else { |
236 | t << "TARGETD= " << var("TARGET_x") << endl; | 237 | t << "TARGETD= " << var("TARGET_x") << endl; |
237 | t << "TARGET0= " << var("TARGET_") << endl; | 238 | t << "TARGET0= " << var("TARGET_") << endl; |
238 | } | 239 | } |
239 | } | 240 | } |
240 | t << endl; | 241 | t << endl; |