author | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
---|---|---|
committer | llornkcor <llornkcor> | 2003-07-10 02:40:10 (UTC) |
commit | 155d68c1e7d7dc0fed2534ac43d6d77ce2781f55 (patch) (unidiff) | |
tree | e6edaa5a7040fe6c224c3943d1094dcf02e4f74c /qmake/generators/win32/borland_bmake.cpp | |
parent | 86703e8a5527ef114facd02c005b6b3a7e62e263 (diff) | |
download | opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.zip opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.gz opie-155d68c1e7d7dc0fed2534ac43d6d77ce2781f55.tar.bz2 |
update qmake to 1.05a
Diffstat (limited to 'qmake/generators/win32/borland_bmake.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | qmake/generators/win32/borland_bmake.cpp | 56 |
1 files changed, 44 insertions, 12 deletions
diff --git a/qmake/generators/win32/borland_bmake.cpp b/qmake/generators/win32/borland_bmake.cpp index ae7b47b..26eea88 100644 --- a/qmake/generators/win32/borland_bmake.cpp +++ b/qmake/generators/win32/borland_bmake.cpp | |||
@@ -127,16 +127,18 @@ BorlandMakefileGenerator::writeBorlandParts(QTextStream &t) | |||
127 | t << "ZIP =" << var("QMAKE_ZIP") << endl; | 127 | t << "ZIP =" << var("QMAKE_ZIP") << endl; |
128 | t << "DEF_FILE =" << varList("DEF_FILE") << endl; | 128 | t << "DEF_FILE =" << varList("DEF_FILE") << endl; |
129 | t << "RES_FILE =" << varList("RES_FILE") << endl; | 129 | t << "RES_FILE =" << varList("RES_FILE") << endl; |
130 | t << "COPY_FILE = " << var("QMAKE_COPY") << endl; | 130 | t << "COPY_FILE = " << var("QMAKE_COPY") << endl; |
131 | t << "COPY_DIR = " << var("QMAKE_COPY") << endl; | 131 | t << "COPY_DIR = " << var("QMAKE_COPY") << endl; |
132 | t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; | 132 | t << "DEL_FILE = " << var("QMAKE_DEL_FILE") << endl; |
133 | t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; | 133 | t << "DEL_DIR = " << var("QMAKE_DEL_DIR") << endl; |
134 | t << "MOVE = " << var("QMAKE_MOVE") << endl; | 134 | t << "MOVE = " << var("QMAKE_MOVE") << endl; |
135 | t << "CHK_DIR_EXISTS =" << var("QMAKE_CHK_DIR_EXISTS") << endl; | ||
136 | t << "MKDIR =" << var("QMAKE_MKDIR") << endl; | ||
135 | t << endl; | 137 | t << endl; |
136 | 138 | ||
137 | t << "####### Files" << endl << endl; | 139 | t << "####### Files" << endl << endl; |
138 | t << "HEADERS =" << varList("HEADERS") << endl; | 140 | t << "HEADERS =" << varList("HEADERS") << endl; |
139 | t << "SOURCES =" << varList("SOURCES") << endl; | 141 | t << "SOURCES =" << varList("SOURCES") << endl; |
140 | t << "OBJECTS =" << varList("OBJECTS") << endl; | 142 | t << "OBJECTS =" << varList("OBJECTS") << endl; |
141 | t << "FORMS =" << varList("FORMS") << endl; | 143 | t << "FORMS =" << varList("FORMS") << endl; |
142 | t << "UICDECLS =" << varList("UICDECLS") << endl; | 144 | t << "UICDECLS =" << varList("UICDECLS") << endl; |
@@ -145,35 +147,43 @@ BorlandMakefileGenerator::writeBorlandParts(QTextStream &t) | |||
145 | t << "OBJMOC =" << varList("OBJMOC") << endl; | 147 | t << "OBJMOC =" << varList("OBJMOC") << endl; |
146 | t << "DIST =" << varList("DISTFILES") << endl; | 148 | t << "DIST =" << varList("DISTFILES") << endl; |
147 | t << "TARGET =" | 149 | t << "TARGET =" |
148 | << varGlue("TARGET",project->first("DESTDIR"),"",project->first("TARGET_EXT")) | 150 | << varGlue("TARGET",project->first("DESTDIR"),"",project->first("TARGET_EXT")) |
149 | << endl; | 151 | << endl; |
150 | t << endl; | 152 | t << endl; |
151 | 153 | ||
152 | t << "####### Implicit rules" << endl << endl; | 154 | t << "####### Implicit rules" << endl << endl; |
153 | t << ".SUFFIXES: .cpp .cxx .cc .c" << endl << endl; | 155 | t << ".SUFFIXES: .c"; |
154 | t << ".cpp.obj:\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl; | 156 | QStringList::Iterator cppit; |
155 | t << ".cxx.obj:\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl; | 157 | for(cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) |
156 | t << ".cc.obj:\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl; | 158 | t << " " << (*cppit); |
157 | t << ".c.obj:\n\t" << var("QMAKE_RUN_CC_IMP") << endl << endl; | 159 | t << endl << endl; |
160 | for(cppit = Option::cpp_ext.begin(); cppit != Option::cpp_ext.end(); ++cppit) | ||
161 | t << (*cppit) << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CXX_IMP") << endl << endl; | ||
162 | t << ".c" << Option::obj_ext << ":\n\t" << var("QMAKE_RUN_CC_IMP") << endl << endl; | ||
158 | 163 | ||
159 | t << "####### Build rules" << endl << endl; | 164 | t << "####### Build rules" << endl << endl; |
160 | t << "all: " << varGlue("ALL_DEPS",""," "," ") << " $(TARGET)" << endl << endl; | 165 | t << "all: " << varGlue("ALL_DEPS",""," "," ") << " $(TARGET)" << endl << endl; |
161 | t << "$(TARGET): $(UICDECLS) $(OBJECTS) $(OBJMOC) " << var("TARGETDEPS"); | 166 | t << "$(TARGET): " << var("PRE_TARGETDEPS") << " $(UICDECLS) $(OBJECTS) $(OBJMOC) " |
167 | << var("POST_TARGETDEPS"); | ||
162 | if(!project->variables()["QMAKE_APP_OR_DLL"].isEmpty()) { | 168 | if(!project->variables()["QMAKE_APP_OR_DLL"].isEmpty()) { |
163 | t << "\n\t" << "$(LINK) @&&|" << "\n\t" | 169 | t << "\n\t" << "$(LINK) @&&|" << "\n\t" |
164 | << "$(LFLAGS) $(OBJECTS) $(OBJMOC),$(TARGET),,$(LIBS),$(DEF_FILE),$(RES_FILE)"; | 170 | << "$(LFLAGS) $(OBJECTS) $(OBJMOC),$(TARGET),,$(LIBS),$(DEF_FILE),$(RES_FILE)"; |
165 | } else { | 171 | } else { |
166 | t << "\n\t-del $(TARGET)" | 172 | t << "\n\t-del $(TARGET)" |
167 | << "\n\t" << "$(LIB) $(TARGET) @&&|" << " \n+" | 173 | << "\n\t" << "$(LIB) $(TARGET) @&&|" << " \n+" |
168 | << project->variables()["OBJECTS"].join(" \\\n+") << " \\\n+" | 174 | << project->variables()["OBJECTS"].join(" \\\n+") << " \\\n+" |
169 | << project->variables()["OBJMOC"].join(" \\\n+"); | 175 | << project->variables()["OBJMOC"].join(" \\\n+"); |
170 | } | 176 | } |
171 | t << endl << "|" << endl; | 177 | t << endl << "|" << endl; |
178 | |||
179 | if ( !project->variables()["QMAKE_POST_LINK"].isEmpty() ) | ||
180 | t << "\t" <<var("QMAKE_POST_LINK") << endl; | ||
181 | |||
172 | if(project->isActiveConfig("dll") && !project->variables()["DLLDESTDIR"].isEmpty()) { | 182 | if(project->isActiveConfig("dll") && !project->variables()["DLLDESTDIR"].isEmpty()) { |
173 | QStringList dlldirs = project->variables()["DLLDESTDIR"]; | 183 | QStringList dlldirs = project->variables()["DLLDESTDIR"]; |
174 | for ( QStringList::Iterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir ) { | 184 | for ( QStringList::Iterator dlldir = dlldirs.begin(); dlldir != dlldirs.end(); ++dlldir ) { |
175 | t << "\n\t" << "-copy $(TARGET) " << *dlldir; | 185 | t << "\n\t" << "-copy $(TARGET) " << *dlldir; |
176 | } | 186 | } |
177 | } | 187 | } |
178 | QString targetfilename = project->variables()["TARGET"].first(); | 188 | QString targetfilename = project->variables()["TARGET"].first(); |
179 | if(project->isActiveConfig("activeqt")) { | 189 | if(project->isActiveConfig("activeqt")) { |
@@ -208,25 +218,22 @@ BorlandMakefileGenerator::writeBorlandParts(QTextStream &t) | |||
208 | << endl << endl; | 218 | << endl << endl; |
209 | 219 | ||
210 | t << "clean:\n" | 220 | t << "clean:\n" |
211 | << varGlue("OBJECTS","\t-del ","\n\t-del ","") | 221 | << varGlue("OBJECTS","\t-del ","\n\t-del ","") |
212 | << varGlue("SRCMOC" ,"\n\t-del ","\n\t-del ","") | 222 | << varGlue("SRCMOC" ,"\n\t-del ","\n\t-del ","") |
213 | << varGlue("OBJMOC" ,"\n\t-del ","\n\t-del ","") | 223 | << varGlue("OBJMOC" ,"\n\t-del ","\n\t-del ","") |
214 | << varGlue("UICDECLS" ,"\n\t-del ","\n\t-del ","") | 224 | << varGlue("UICDECLS" ,"\n\t-del ","\n\t-del ","") |
215 | << varGlue("UICIMPLS" ,"\n\t-del ","\n\t-del ","") | 225 | << varGlue("UICIMPLS" ,"\n\t-del ","\n\t-del ","") |
216 | << "\n\t-del $(TARGET)" | ||
217 | << varGlue("QMAKE_CLEAN","\n\t-del ","\n\t-del ","") | 226 | << varGlue("QMAKE_CLEAN","\n\t-del ","\n\t-del ","") |
218 | << varGlue("CLEAN_FILES","\n\t-del ","\n\t-del ",""); | 227 | << varGlue("CLEAN_FILES","\n\t-del ","\n\t-del ",""); |
219 | if ( project->isActiveConfig("activeqt")) { | 228 | if ( project->isActiveConfig("activeqt")) { |
220 | t << ("\n\t-del tmp\\" + targetfilename + ".*"); | 229 | t << ("\n\t-del tmp\\" + targetfilename + ".*"); |
221 | t << "\n\t-del tmp\\dump.*"; | 230 | t << "\n\t-del tmp\\dump.*"; |
222 | } | 231 | } |
223 | if(project->isActiveConfig("dll") && !project->variables()["DLLDESTDIR"].isEmpty()) | ||
224 | t << "\n\t-del " << var("DLLDESTDIR") << "\\" << project->variables()[ "TARGET" ].first() << project->variables()[ "TARGET_EXT" ].first(); | ||
225 | if(!project->isEmpty("IMAGES")) | 232 | if(!project->isEmpty("IMAGES")) |
226 | t << varGlue("QMAKE_IMAGE_COLLECTION", "\n\t-del ", "\n\t-del ", ""); | 233 | t << varGlue("QMAKE_IMAGE_COLLECTION", "\n\t-del ", "\n\t-del ", ""); |
227 | 234 | ||
228 | // blasted user defined targets | 235 | // blasted user defined targets |
229 | QStringList &qut = project->variables()["QMAKE_EXTRA_WIN_TARGETS"]; | 236 | QStringList &qut = project->variables()["QMAKE_EXTRA_WIN_TARGETS"]; |
230 | for(QStringList::Iterator it = qut.begin(); it != qut.end(); ++it) { | 237 | for(QStringList::Iterator it = qut.begin(); it != qut.end(); ++it) { |
231 | QString targ = var((*it) + ".target"), | 238 | QString targ = var((*it) + ".target"), |
232 | cmd = var((*it) + ".commands"), deps; | 239 | cmd = var((*it) + ".commands"), deps; |
@@ -239,16 +246,20 @@ BorlandMakefileGenerator::writeBorlandParts(QTextStream &t) | |||
239 | dep = (*dep_it); | 246 | dep = (*dep_it); |
240 | deps += " " + dep; | 247 | deps += " " + dep; |
241 | } | 248 | } |
242 | t << "\n\n" << targ << ":" << deps << "\n\t" | 249 | t << "\n\n" << targ << ":" << deps << "\n\t" |
243 | << cmd; | 250 | << cmd; |
244 | } | 251 | } |
245 | 252 | ||
246 | t << endl << endl; | 253 | t << endl << endl; |
254 | |||
255 | t << "distclean: clean" | ||
256 | << "\n\t-del $(TARGET)" | ||
257 | << endl << endl; | ||
247 | } | 258 | } |
248 | 259 | ||
249 | void | 260 | void |
250 | BorlandMakefileGenerator::init() | 261 | BorlandMakefileGenerator::init() |
251 | { | 262 | { |
252 | if(init_flag) | 263 | if(init_flag) |
253 | return; | 264 | return; |
254 | init_flag = TRUE; | 265 | init_flag = TRUE; |
@@ -359,17 +370,17 @@ BorlandMakefileGenerator::init() | |||
359 | } else { | 370 | } else { |
360 | if(project->isActiveConfig("thread")) | 371 | if(project->isActiveConfig("thread")) |
361 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT_THREAD"]; | 372 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT_THREAD"]; |
362 | else | 373 | else |
363 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT"]; | 374 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_QT"]; |
364 | if ( !project->variables()["QMAKE_QT_DLL"].isEmpty() ) { | 375 | if ( !project->variables()["QMAKE_QT_DLL"].isEmpty() ) { |
365 | int hver = findHighestVersion(project->first("QMAKE_LIBDIR_QT"), "qt"); | 376 | int hver = findHighestVersion(project->first("QMAKE_LIBDIR_QT"), "qt"); |
366 | if ( hver == -1 ) | 377 | if ( hver == -1 ) |
367 | hver = findHighestVersion(project->first("QMAKE_LIBDIR_QT"), "qt-mt"); | 378 | hver = findHighestVersion(project->first("QMAKE_LIBDIR_QT"), "qtmt"); |
368 | if(hver != -1) { | 379 | if(hver != -1) { |
369 | QString ver; | 380 | QString ver; |
370 | ver.sprintf("qt%s" QTDLL_POSTFIX "%d.lib", (project->isActiveConfig("thread") ? "mt" : ""), hver); | 381 | ver.sprintf("qt%s" QTDLL_POSTFIX "%d.lib", (project->isActiveConfig("thread") ? "mt" : ""), hver); |
371 | QStringList &libs = project->variables()["QMAKE_LIBS"]; | 382 | QStringList &libs = project->variables()["QMAKE_LIBS"]; |
372 | for(QStringList::Iterator libit = libs.begin(); libit != libs.end(); ++libit) | 383 | for(QStringList::Iterator libit = libs.begin(); libit != libs.end(); ++libit) |
373 | (*libit).replace(QRegExp("qt(mt)?\\.lib"), ver); | 384 | (*libit).replace(QRegExp("qt(mt)?\\.lib"), ver); |
374 | } | 385 | } |
375 | } | 386 | } |
@@ -421,16 +432,38 @@ BorlandMakefileGenerator::init() | |||
421 | } | 432 | } |
422 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_WINDOWS"]; | 433 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_WINDOWS"]; |
423 | } else { | 434 | } else { |
424 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_CONSOLE_ANY"]; | 435 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_CONSOLE_ANY"]; |
425 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_CONSOLE_ANY"]; | 436 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_CONSOLE_ANY"]; |
426 | project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_CONSOLE_ANY"]; | 437 | project->variables()["QMAKE_LFLAGS"] += project->variables()["QMAKE_LFLAGS_CONSOLE_ANY"]; |
427 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_CONSOLE"]; | 438 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_CONSOLE"]; |
428 | } | 439 | } |
440 | if ( project->isActiveConfig("stl") ) { | ||
441 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_STL_ON"]; | ||
442 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_STL_ON"]; | ||
443 | } else { | ||
444 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_STL_OFF"]; | ||
445 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_STL_OFF"]; | ||
446 | } | ||
447 | if ( project->isActiveConfig("exceptions") ) { | ||
448 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_EXCEPTIONS_ON"]; | ||
449 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_EXCEPTIONS_ON"]; | ||
450 | } else { | ||
451 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_EXCEPTIONS_OFF"]; | ||
452 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_EXCEPTIONS_OFF"]; | ||
453 | } | ||
454 | if ( project->isActiveConfig("rtti") ) { | ||
455 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_RTTI_ON"]; | ||
456 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_RTTI_ON"]; | ||
457 | } else { | ||
458 | project->variables()["QMAKE_CFLAGS"] += project->variables()["QMAKE_CFLAGS_RTTI_OFF"]; | ||
459 | project->variables()["QMAKE_CXXFLAGS"] += project->variables()["QMAKE_CXXFLAGS_RTTI_OFF"]; | ||
460 | } | ||
461 | |||
429 | if ( project->isActiveConfig("thread") ) { | 462 | if ( project->isActiveConfig("thread") ) { |
430 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_RTMT"]; | 463 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_RTMT"]; |
431 | } else { | 464 | } else { |
432 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_RT"]; | 465 | project->variables()["QMAKE_LIBS"] += project->variables()["QMAKE_LIBS_RT"]; |
433 | } | 466 | } |
434 | if ( project->isActiveConfig("moc") ) { | 467 | if ( project->isActiveConfig("moc") ) { |
435 | setMocAware(TRUE); | 468 | setMocAware(TRUE); |
436 | } | 469 | } |
@@ -447,17 +480,17 @@ BorlandMakefileGenerator::init() | |||
447 | if ( !project->variables()["RC_FILE"].isEmpty()) { | 480 | if ( !project->variables()["RC_FILE"].isEmpty()) { |
448 | if ( !project->variables()["RES_FILE"].isEmpty()) { | 481 | if ( !project->variables()["RES_FILE"].isEmpty()) { |
449 | fprintf(stderr, "Both .rc and .res file specified.\n"); | 482 | fprintf(stderr, "Both .rc and .res file specified.\n"); |
450 | fprintf(stderr, "Please specify one of them, not both."); | 483 | fprintf(stderr, "Please specify one of them, not both."); |
451 | exit(666); | 484 | exit(666); |
452 | } | 485 | } |
453 | project->variables()["RES_FILE"] = project->variables()["RC_FILE"]; | 486 | project->variables()["RES_FILE"] = project->variables()["RC_FILE"]; |
454 | project->variables()["RES_FILE"].first().replace(".rc",".res"); | 487 | project->variables()["RES_FILE"].first().replace(".rc",".res"); |
455 | project->variables()["TARGETDEPS"] += project->variables()["RES_FILE"]; | 488 | project->variables()["POST_TARGETDEPS"] += project->variables()["RES_FILE"]; |
456 | } | 489 | } |
457 | MakefileGenerator::init(); | 490 | MakefileGenerator::init(); |
458 | if ( !project->variables()["VERSION"].isEmpty()) { | 491 | if ( !project->variables()["VERSION"].isEmpty()) { |
459 | QStringList l = QStringList::split('.', project->first("VERSION")); | 492 | QStringList l = QStringList::split('.', project->first("VERSION")); |
460 | project->variables()["VER_MAJ"].append(l[0]); | 493 | project->variables()["VER_MAJ"].append(l[0]); |
461 | project->variables()["VER_MIN"].append(l[1]); | 494 | project->variables()["VER_MIN"].append(l[1]); |
462 | } | 495 | } |
463 | 496 | ||
@@ -469,9 +502,8 @@ BorlandMakefileGenerator::init() | |||
469 | + ".tds"; | 502 | + ".tds"; |
470 | } else { | 503 | } else { |
471 | tdsPostfix = ".tds"; | 504 | tdsPostfix = ".tds"; |
472 | } | 505 | } |
473 | project->variables()["QMAKE_CLEAN"].append( | 506 | project->variables()["QMAKE_CLEAN"].append( |
474 | project->first("DESTDIR") + project->first("TARGET") + tdsPostfix ); | 507 | project->first("DESTDIR") + project->first("TARGET") + tdsPostfix ); |
475 | } | 508 | } |
476 | } | 509 | } |
477 | |||