diff --git a/configure b/configure index 2b8b4031ef..5e574e668a 100755 --- a/configure +++ b/configure @@ -2221,29 +2221,6 @@ if [ "$OPT_SHADOW" = "yes" ]; then [ -d "$outpath/bin" ] || mkdir -p "$outpath/bin" - # symlink the qmake directory - find "$relpath/qmake" | while read a; do - my_a=`echo "$a" | sed "s,^${relpath}/,${outpath}/,"` - if [ '!' -f "$my_a" ]; then - if [ -d "$a" ]; then - # directories are created... - mkdir -p "$my_a" - else - a_dir=`dirname "$my_a"` - [ -d "$a_dir" ] || mkdir -p "$a_dir" - # ... and files are symlinked - case `basename "$a"` in - *.o|*.d|GNUmakefile*|qmake) - ;; - *) - rm -f "$my_a" - ln -s "$a" "$my_a" - ;; - esac - fi - fi - done - # make a syncqt script that can be used in the shadow rm -f "$outpath/bin/syncqt" if [ -x "$relpath/bin/syncqt" ]; then @@ -4098,6 +4075,7 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ]; #mkspecs/default is used as a (gasp!) default mkspec so QMAKESPEC needn't be set once configured rm -rf mkspecs/default ln -s `echo $XQMAKESPEC | sed "s,^${relpath}/mkspecs/,,"` mkspecs/default + mkdir -p "$outpath/qmake" || exit # fix makefiles for mkfile in GNUmakefile Makefile; do EXTRA_LFLAGS= diff --git a/qmake/Makefile.unix b/qmake/Makefile.unix index d9835932d6..03a8597eff 100644 --- a/qmake/Makefile.unix +++ b/qmake/Makefile.unix @@ -6,6 +6,8 @@ QTSRCS = @QMAKE_QTSRCS@ QMAKESPEC = @QMAKESPEC@ LFLAGS = @QMAKE_LFLAGS@ +QMKSRC = $(SOURCE_PATH)/qmake + #qmake code OBJS=project.o property.o main.o makefile.o unixmake2.o unixmake.o \ mingw_make.o option.o winmakefile.o projectgenerator.o \ @@ -69,8 +71,8 @@ DEPEND_SRC=project.cpp property.cpp meta.cpp main.cpp generators/makefile.cpp ge $(SOURCE_PATH)/src/corelib/global/qlogging.cpp \ $(QTSRCS) -CPPFLAGS = -g -I. -Igenerators -Igenerators/unix -Igenerators/win32 \ - -Igenerators/mac -Igenerators/integrity \ +CPPFLAGS = -g -I$(QMKSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 \ + -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \ -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore \ -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ @@ -97,7 +99,74 @@ distclean:: clean depend: makedepend -D__MAKEDEPEND__ $(CPPFLAGS) $(DEPEND_SRC) -# don't use optimization for these + +project.o: $(QMKSRC)/project.cpp $(QMKSRC)/project.h $(QMKSRC)/option.h + $(CXX) -c -o $@ $(CXXFLAGS) $< + +property.o: $(QMKSRC)/property.cpp $(QMKSRC)/project.h $(QMKSRC)/option.h + $(CXX) -c -o $@ $(CXXFLAGS) $< + +meta.o: $(QMKSRC)/meta.cpp $(QMKSRC)/project.h $(QMKSRC)/option.h + $(CXX) -c -o $@ $(CXXFLAGS) $< + +main.o: $(QMKSRC)/main.cpp $(QMKSRC)/project.h + $(CXX) -c -o $@ $(CXXFLAGS) $< + +option.o: $(QMKSRC)/option.cpp $(QMKSRC)/option.h + $(CXX) -c -o $@ $(CXXFLAGS) $< + +metamakefile.o: $(QMKSRC)/generators/metamakefile.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +xmloutput.o: $(QMKSRC)/generators/xmloutput.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +makefiledeps.o: $(QMKSRC)/generators/makefiledeps.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +makefile.o: $(QMKSRC)/generators/makefile.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +unixmake.o: $(QMKSRC)/generators/unix/unixmake.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +unixmake2.o: $(QMKSRC)/generators/unix/unixmake2.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +winmakefile.o: $(QMKSRC)/generators/win32/winmakefile.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +borland_bmake.o: $(QMKSRC)/generators/win32/borland_bmake.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +mingw_make.o: $(QMKSRC)/generators/win32/mingw_make.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +msvc_objectmodel.o: $(QMKSRC)/generators/win32/msvc_objectmodel.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +msvc_vcproj.o: $(QMKSRC)/generators/win32/msvc_vcproj.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +msbuild_objectmodel.o: $(QMKSRC)/generators/win32/msbuild_objectmodel.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +msvc_vcxproj.o: $(QMKSRC)/generators/win32/msvc_vcxproj.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +msvc_nmake.o: $(QMKSRC)/generators/win32/msvc_nmake.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +pbuilder_pbx.o: $(QMKSRC)/generators/mac/pbuilder_pbx.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +gbuild.o: $(QMKSRC)/generators/integrity/gbuild.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + +projectgenerator.o: $(QMKSRC)/generators/projectgenerator.cpp + $(CXX) -c -o $@ $(CXXFLAGS) $< + + qtextstream.o: $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qtextstream.cpp @@ -242,75 +311,9 @@ qhash.o: $(SOURCE_PATH)/src/corelib/tools/qhash.cpp qlinkedlist.o: $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp -winmakefile.o: generators/win32/winmakefile.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/winmakefile.cpp - -project.o: project.cpp project.h option.h - $(CXX) -c -o $@ $(CXXFLAGS) project.cpp - -property.o: property.cpp project.h option.h - $(CXX) -c -o $@ $(CXXFLAGS) property.cpp - -meta.o: meta.cpp project.h option.h - $(CXX) -c -o $@ $(CXXFLAGS) meta.cpp - -main.o: main.cpp project.h - $(CXX) -c -o $@ $(CXXFLAGS) main.cpp - -option.o: option.cpp option.h $(BUILD_PATH)/src/corelib/global/qconfig.cpp - $(CXX) -c -o $@ $(CXXFLAGS) option.cpp - qcryptographichash.o: $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qcryptographichash.cpp -metamakefile.o: generators/metamakefile.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/metamakefile.cpp - -xmloutput.o: generators/xmloutput.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/xmloutput.cpp - -makefiledeps.o: generators/makefiledeps.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/makefiledeps.cpp - -makefile.o: generators/makefile.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/makefile.cpp - -unixmake.o: generators/unix/unixmake.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/unix/unixmake.cpp - -unixmake2.o: generators/unix/unixmake2.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/unix/unixmake2.cpp - -borland_bmake.o: generators/win32/borland_bmake.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/borland_bmake.cpp - -mingw_make.o: generators/win32/mingw_make.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/mingw_make.cpp - -msvc_objectmodel.o: generators/win32/msvc_objectmodel.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_objectmodel.cpp - -msvc_vcproj.o: generators/win32/msvc_vcproj.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcproj.cpp - -msbuild_objectmodel.o: generators/win32/msbuild_objectmodel.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msbuild_objectmodel.cpp - -msvc_vcxproj.o: generators/win32/msvc_vcxproj.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_vcxproj.cpp - -msvc_nmake.o: generators/win32/msvc_nmake.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/win32/msvc_nmake.cpp - -pbuilder_pbx.o: generators/mac/pbuilder_pbx.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/mac/pbuilder_pbx.cpp - -gbuild.o: generators/integrity/gbuild.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/integrity/gbuild.cpp - -projectgenerator.o: generators/projectgenerator.cpp - $(CXX) -c -o $@ $(CXXFLAGS) generators/projectgenerator.cpp - qxmlstream.o: $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/xml/qxmlstream.cpp @@ -320,8 +323,4 @@ qxmlutils.o: $(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp qlogging.o: $(SOURCE_PATH)/src/corelib/global/qlogging.cpp $(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/global/qlogging.cpp -#default rules -.cpp.o: - $(CXX) -c -o $@ $(CXXFLAGS) $< - # DO NOT DELETE THIS LINE -- make depend depends on it diff --git a/qmake/Makefile.win32 b/qmake/Makefile.win32 index f640216036..89444c9c3c 100644 --- a/qmake/Makefile.win32 +++ b/qmake/Makefile.win32 @@ -7,6 +7,8 @@ SOURCE_PATH = .. BUILD_PATH = .. !endif +QMKSRC = $(SOURCE_PATH)\qmake + # # specific stuff for NMake and ICC # @@ -31,7 +33,7 @@ CFLAGS_EXTRA = /MP CFLAGS_BARE = -c -Fo./ \ -W3 -nologo -O1 \ $(CFLAGS_EXTRA) \ - -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\integrity \ + -I$(QMKSRC) -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \ -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \ -I$(BUILD_PATH)\src\corelib\global \ -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC) \ diff --git a/qmake/Makefile.win32-g++ b/qmake/Makefile.win32-g++ index 57e6c1aa4e..95108b351b 100644 --- a/qmake/Makefile.win32-g++ +++ b/qmake/Makefile.win32-g++ @@ -43,9 +43,7 @@ endif # CXX = g++ CFLAGS = -c -o$@ -O \ - -I. -Igenerators -Igenerators/unix \ - -Igenerators/win32 -Igenerators/mac \ - -Igenerators/integrity \ + -I$(QMKSRC) -I$(QMKSRC)/generators -I$(QMKSRC)/generators/unix -I$(QMKSRC)/generators/win32 -I$(QMKSRC)/generators/mac -I$(QMKSRC)/generators/integrity \ -I$(BUILD_PATH)/include -I$(BUILD_PATH)/include/QtCore -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION) -I$(BUILD_PATH)/include/QtCore/$(QT_VERSION)/QtCore \ -I$(BUILD_PATH)/src/corelib/global \ -I$(SOURCE_PATH)/mkspecs/win32-g++ \ @@ -131,7 +129,7 @@ qmake.exe: $(OBJS) $(QTOBJS) $(LINKQMAKE) -$(COPY) qmake.exe $(BUILD_PATH)\bin\qmake.exe -Makefile: Makefile.win32-g++ +Makefile: $(SOURCE_PATH)/qmake/Makefile.win32-g++ @echo "Out of date, please rerun configure" clean:: diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index dea7415d43..62ec3e8d8c 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -142,46 +142,6 @@ Configure::Configure(int& argc, char** argv) cout << "Preparing build tree..." << endl; QDir(buildPath).mkpath("bin"); - { //duplicate qmake - QStack qmake_dirs; - qmake_dirs.push("qmake"); - while (!qmake_dirs.isEmpty()) { - QString dir = qmake_dirs.pop(); - QString od(buildPath + "/" + dir); - QString id(sourcePath + "/" + dir); - QFileInfoList entries = QDir(id).entryInfoList(QDir::NoDotAndDotDot|QDir::AllEntries); - for (int i = 0; i < entries.size(); ++i) { - QFileInfo fi(entries.at(i)); - if (fi.isDir()) { - qmake_dirs.push(dir + "/" + fi.fileName()); - QDir().mkpath(od + "/" + fi.fileName()); - } else { - QDir().mkpath(od); - bool justCopy = true; - const QString fname = fi.fileName(); - const QString outFile(od + "/" + fname), inFile(id + "/" + fname); - if (fi.fileName() == "Makefile") { //ignore - } else if (fi.suffix() == "h" || fi.suffix() == "cpp") { - QTemporaryFile tmpFile; - if (tmpFile.open()) { - QTextStream stream(&tmpFile); - stream << "#include \"" << inFile << "\"" << endl; - justCopy = false; - stream.flush(); - tmpFile.flush(); - if (filesDiffer(tmpFile.fileName(), outFile)) { - QFile::remove(outFile); - tmpFile.copy(outFile); - } - } - } - if (justCopy && filesDiffer(inFile, outFile)) - QFile::copy(inFile, outFile); - } - } - } - } - { //make a syncqt script(s) that can be used in the shadow QFile syncqt(buildPath + "/bin/syncqt"); if (syncqt.open(QFile::WriteOnly)) { @@ -3145,7 +3105,16 @@ void Configure::buildQmake() // Build qmake QString pwd = QDir::currentPath(); - QDir::setCurrent(buildPath + "/qmake"); + if (!QDir(buildPath).mkpath("qmake")) { + cout << "Cannot create qmake build dir." << endl; + dictionary[ "DONE" ] = "error"; + return; + } + if (!QDir::setCurrent(buildPath + "/qmake")) { + cout << "Cannot enter qmake build dir." << endl; + dictionary[ "DONE" ] = "error"; + return; + } QString makefile = "Makefile"; {