Ignore:
Timestamp:
Aug 12, 2011, 3:55:22 PM (14 years ago)
Author:
Dmitry A. Kuminov
Message:

qmake: Make MakefileGenerator::writeHeader() virtual.

This lets generators have additional definitions common to
all generated makefiles in a single place. This is used by
e.g. the OS/2 GNUMAKE generator.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qmake/generators/os2/gnumake.cpp

    r953 r973  
    290290}
    291291
    292 bool GNUMakefileGenerator::writeMakefile(QTextStream &t)
    293 {
    294     writeHeader(t);
     292(QTextStream &t)
     293{
     294    writeHeader(t);
    295295
    296296    /* function to convert from DOS-like to Unix-like space escaping in file
     
    303303    t << "QMAKESPECDIR  = " << escapeFilePath(specdir()) << endl;
    304304
    305     QString ofile = escapeFilePath(Option::output.fileName());
    306     if(ofile.lastIndexOf(Option::dir_sep) != -1)
    307         ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
    308     t << "MAKEFILE      = " << ofile << endl << endl;
     305    // MakefileGenerator::writeSubTargets() already puts the MAKEFILE definitoin
     306    // but others don't; add it here since we use it within generated makefiles
     307    if (project->first("TEMPLATE") != "subdirs") {
     308        QString ofile = escapeFilePath(Option::output.fileName());
     309        if(ofile.lastIndexOf(Option::dir_sep) != -1)
     310            ofile = ofile.right(ofile.length() - ofile.lastIndexOf(Option::dir_sep) -1);
     311        t << "MAKEFILE      = " << ofile << endl;
     312    }
     313
     314    t << endl;
     315}
     316
     317bool GNUMakefileGenerator::writeMakefile(QTextStream &t)
     318{
     319    writeHeader(t);
    309320
    310321    if(!project->values("QMAKE_FAILED_REQUIREMENTS").isEmpty()) {
Note: See TracChangeset for help on using the changeset viewer.