do not copy/symlink qmake to build dir

make is perfectly capable of doing shadow builds

Change-Id: I7e1c27cddc385b7a17ae5645b9cd26fa56d2f029
Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
This commit is contained in:
Oswald Buddenhagen 2012-03-09 10:50:23 +01:00 committed by Qt by Nokia
parent 38224d8d00
commit 46e51ce1dd
5 changed files with 88 additions and 142 deletions

24
configure vendored
View File

@ -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=

View File

@ -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

View File

@ -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) \

View File

@ -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::

View File

@ -142,46 +142,6 @@ Configure::Configure(int& argc, char** argv)
cout << "Preparing build tree..." << endl;
QDir(buildPath).mkpath("bin");
{ //duplicate qmake
QStack<QString> 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";
{