Unify win32-g++ and Unix qmake Makefiles.

Replace the old sed / template @FOO@ method with echo.
Enable MSYS bash to build qmake.exe
Use qmake/Makefile.unix for all win32-g++ builds.

Change-Id: I6e27d69b28d27131838bbbb3a4ee5a08b470f31b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
This commit is contained in:
Ray Donnelly 2013-02-02 12:31:53 +00:00 committed by The Qt Project
parent 5ec342fefd
commit 1a0924dfc0
5 changed files with 166 additions and 210 deletions

72
configure vendored
View File

@ -381,6 +381,10 @@ if [ -d /System/Library/Frameworks/Carbon.framework ]; then
BUILD_ON_MAC=yes
PLATFORM_MAC=maybe
fi
BUILD_ON_MSYS=no
if [ "$OSTYPE" = "msys" ]; then
BUILD_ON_MSYS=yes
fi
#-----------------------------------------------------------------------------
# Qt version detection
@ -3638,10 +3642,6 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
setBootstrapVariable QMAKE_CXXFLAGS
setBootstrapVariable QMAKE_LFLAGS
if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
EXTRA_CFLAGS="$EXTRA_CFLAGS -DQMAKE_OPENSOURCE_EDITION"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -DQMAKE_OPENSOURCE_EDITION"
fi
if [ "$CFG_RELEASE_QMAKE" = "yes" ]; then
setBootstrapVariable QMAKE_CFLAGS_RELEASE
setBootstrapVariable QMAKE_CXXFLAGS_RELEASE
@ -3660,6 +3660,36 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
EXTRA_LFLAGS="\$(QMAKE_LFLAGS_RPATH)\"$rpath\" $EXTRA_LFLAGS"
done
fi
if [ "$BUILD_ON_MSYS" = "yes" ]; then
EXTRA_CFLAGS="-DUNICODE"
EXTRA_CXXFLAGS="-DUNICODE"
EXTRA_OBJS="qfilesystemengine_win.o \
qfilesystemiterator_win.o \
qfsfileengine_win.o \
qlocale_win.o \
qsettings_win.o \
qsystemlibrary.o \
registry.o"
EXTRA_SRCS="\"\$(SOURCE_PATH)/src/corelib/corelib/io/qfilesystemengine_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp\" \
\"\$(SOURCE_PATH)/tools/shared/windows/registry.cpp\""
EXTRA_LFLAGS="-static -s -lole32 -luuid -ladvapi32 -lkernel32"
EXEEXT=".exe"
else
EXTRA_OBJS="qfilesystemengine_unix.o \
qfilesystemiterator_unix.o \
qfsfileengine_unix.o \
qlocale_unix.o"
EXTRA_SRCS="\"\$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/tools/qlocal_unix.cpp\""
EXEEXT=
fi
if [ "$BUILD_ON_MAC" = "yes" ]; then
echo "export MACOSX_DEPLOYMENT_TARGET = 10.6" >> "$mkfile"
echo "CARBON_LFLAGS =-framework ApplicationServices" >>"$mkfile"
@ -3667,8 +3697,12 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
EXTRA_LFLAGS="$EXTRA_LFLAGS \$(CARBON_LFLAGS)"
EXTRA_CFLAGS="$EXTRA_CFLAGS \$(CARBON_CFLAGS)"
EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS \$(CARBON_CFLAGS)"
EXTRA_OBJS="qsettings_mac.o qcore_mac.o"
EXTRA_SRCS="\"$relpath/src/corelib/io/qsettings_mac.cpp\" \"$relpath/src/corelib/kernel/qcore_mac.cpp\""
EXTRA_OBJS="$EXTRA_OBJS \
qsettings_mac.o \
qcore_mac.o"
EXTRA_SRCS="$EXTRA_SRCS \
\"\$(SOURCE_PATH)/src/corelib/io/qsettings_mac.cpp\" \
\"\$(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp\""
fi
if [ '!' -z "$D_FLAGS" ]; then
EXTRA_CFLAGS="$EXTRA_CFLAGS $D_FLAGS"
@ -3681,13 +3715,25 @@ if true; then ###[ '!' -f "$outpath/bin/qmake" ];
adjrelpath=`echo "$relpath" | sed 's/ /\\\\\\\\ /g'`
adjoutpath=`echo "$outpath" | sed 's/ /\\\\\\\\ /g'`
adjqmakespec=`echo "$QMAKESPEC" | sed 's/ /\\\\\\\\ /g'`
sed -e "s,@SOURCE_PATH@,$adjrelpath,g" -e "s,@BUILD_PATH@,$adjoutpath,g" \
-e "s,@QMAKE_CFLAGS@,$EXTRA_CFLAGS,g" -e "s,@QMAKE_LFLAGS@,$EXTRA_LFLAGS,g" \
-e "s,@QMAKE_CXXFLAGS@,$EXTRA_CXXFLAGS,g" \
-e "s,@QT_INSTALL_BINS@,\$(INSTALL_ROOT)$QMAKE_BIN_DIR,g" \
-e "s,@QT_INSTALL_DATA@,\$(INSTALL_ROOT)$QMAKE_DATA_DIR,g" \
-e "s,@QMAKE_QTOBJS@,$EXTRA_OBJS,g" -e "s,@QMAKE_QTSRCS@,$EXTRA_SRCS,g" \
-e "s,@QMAKESPEC@,$adjqmakespec,g" -e "s,@QT_VERSION@,$QT_VERSION,g" "$in_mkfile" >>"$mkfile"
echo "BUILD_PATH = $adjoutpath" >> "$mkfile"
echo "SOURCE_PATH = $adjrelpath" >> "$mkfile"
echo "QMAKESPEC = $adjqmakespec" >> "$mkfile"
echo "QT_VERSION = $QT_VERSION" >> "$mkfile"
echo "EXTRA_CFLAGS = $EXTRA_CFLAGS" >> "$mkfile"
echo "EXTRA_CXXFLAGS = $EXTRA_CXXFLAGS" >> "$mkfile"
echo "QTOBJS = $EXTRA_OBJS" >> "$mkfile"
echo "QTSRCS = $EXTRA_SRCS" >> "$mkfile"
echo "LFLAGS = $EXTRA_LFLAGS" >> "$mkfile"
echo "QT_INSTALL_BINS = \$(INSTALL_ROOT)$QMAKE_BIN_DIR" >> "$mkfile"
echo "QT_INSTALL_DATA = \$(INSTALL_ROOT)$QMAKE_DATA_DIR" >> "$mkfile"
echo "EXEEXT = $EXEEXT" >> "$mkfile"
echo "RM_F = rm -f" >> "$mkfile"
echo "RM_RF = rm -rf" >> "$mkfile"
if [ $QT_EDITION = "QT_EDITION_OPENSOURCE" ]; then
echo "EXTRA_CPPFLAGS = -DQMAKE_OPENSOURCE_EDITION" >> "$mkfile"
fi
cat "$in_mkfile" >> "$mkfile"
if "$WHICH" makedepend >/dev/null 2>&1 && grep 'depend:' "$mkfile" >/dev/null 2>&1; then
(cd "$outpath/qmake" && "$MAKE" -f "$mkfile" depend) >/dev/null 2>&1

View File

@ -1,11 +1,3 @@
SOURCE_PATH = @SOURCE_PATH@
BUILD_PATH = @BUILD_PATH@
QT_VERSION = @QT_VERSION@
QTOBJS = @QMAKE_QTOBJS@
QTSRCS = @QMAKE_QTSRCS@
QMAKESPEC = @QMAKESPEC@
LFLAGS = @QMAKE_LFLAGS@
QMKSRC = $(SOURCE_PATH)/qmake
QMKLIBSRC = $(QMKSRC)/library
QMKGENSRC = $(QMKSRC)/generators
@ -22,18 +14,14 @@ OBJS=project.o option.o property.o main.o ioutils.o proitems.o \
#qt code
QOBJS=qtextcodec.o qutfcodec.o qstring.o qstringbuilder.o qtextstream.o qiodevice.o qmalloc.o qglobal.o \
qarraydata.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfiledevice.o qfile.o \
qfilesystementry.o qfilesystemengine_unix.o qfilesystemengine.o qfilesystemiterator_unix.o \
qfsfileengine_unix.o qfsfileengine.o \
qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o \
qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o \
qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o \
qlocale.o qlocale_tools.o qlocale_unix.o qlinkedlist.o qnumeric.o qcryptographichash.o \
qxmlstream.o qxmlutils.o qlogging.o \
qfilesystementry.o qfilesystemengine.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o \
qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o \
qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o \
qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnumeric.o \
qcryptographichash.o qxmlstream.o qxmlutils.o qlogging.o \
$(QTOBJS)
#all sources, used for the depend target
DEPEND_SRC = \
$(QMKSRC)/main.cpp $(QMKSRC)/project.cpp $(QMKSRC)/option.cpp $(QMKSRC)/property.cpp \
@ -58,10 +46,16 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/tools/qarraydata.cpp $(SOURCE_PATH)/src/corelib/tools/qbytearray.cpp\
$(SOURCE_PATH)/src/corelib/tools/qbytearraymatcher.cpp \
$(SOURCE_PATH)/src/corelib/io/qdatastream.cpp $(SOURCE_PATH)/src/corelib/io/qbuffer.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystementry.cpp $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystementry.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_mac.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemengine.cpp $(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp \
$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemengine.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp \
$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp \
$(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp \
$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp \
$(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp \
$(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.cpp \
$(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp $(SOURCE_PATH)/src/corelib/tools/qlist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qvector.cpp $(SOURCE_PATH)/src/corelib/tools/qbitarray.cpp \
@ -74,6 +68,7 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/tools/qlocale.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp \
$(SOURCE_PATH)/src/corelib/tools/qlinkedlist.cpp \
$(SOURCE_PATH)/src/corelib/tools/qhash.cpp $(SOURCE_PATH)/src/corelib/kernel/qcore_mac.cpp \
$(SOURCE_PATH)/src/corelib/io/qtemporaryfile.cpp $(SOURCE_PATH)/src/corelib/kernel/qmetatype.cpp \
@ -84,9 +79,11 @@ DEPEND_SRC = \
$(SOURCE_PATH)/src/corelib/xml/qxmlutils.cpp \
$(SOURCE_PATH)/src/corelib/kernel/qsystemerror.cpp \
$(SOURCE_PATH)/src/corelib/global/qlogging.cpp \
$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp \
$(SOURCE_PATH)/tools/shared/windows/registry.cpp \
$(QTSRCS)
CPPFLAGS = -g $(OPENSOURCE_CXXFLAGS) \
CPPFLAGS = -g $(EXTRA_CPPFLAGS) \
-I$(QMKSRC) -I$(QMKLIBSRC) -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 \
@ -98,19 +95,23 @@ CPPFLAGS = -g $(OPENSOURCE_CXXFLAGS) \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM
CXXFLAGS = @QMAKE_CXXFLAGS@ $(CPPFLAGS)
CXXFLAGS = $(EXTRA_CXXFLAGS) $(CPPFLAGS)
first all: $(BUILD_PATH)/bin/qmake
qmake: $(BUILD_PATH)/bin/qmake
first all: $(BUILD_PATH)/bin/qmake$(EXEEXT)
qmake: $(BUILD_PATH)/bin/qmake$(EXEEXT)
$(BUILD_PATH)/bin/qmake: $(OBJS) $(QOBJS)
$(BUILD_PATH)/bin/qmake$(EXEEXT): $(OBJS) $(QOBJS)
$(CXX) -o "$@" $(OBJS) $(QOBJS) $(LFLAGS)
Makefile: $(SOURCE_PATH)/qmake/Makefile.unix
@echo "Out of date, please rerun configure"
clean::
rm -f $(OBJS) $(QOBJS)
$(RM_F) $(OBJS) $(QOBJS)
distclean:: clean
rm -rf $(BUILD_PATH)/bin/qmake .deps
$(RM_RF) .deps
$(RM_F) $(BUILD_PATH)/bin/qmake$(EXEEXT)
depend:
makedepend -D__MAKEDEPEND__ $(CPPFLAGS) $(DEPEND_SRC)
@ -222,6 +223,9 @@ qnumeric.o: $(SOURCE_PATH)/src/corelib/global/qnumeric.cpp
qsettings_mac.o: $(SOURCE_PATH)/src/corelib/io/qsettings_mac.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qsettings_mac.cpp
qsettings_win.o: $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp
qiodevice.o: $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qiodevice.cpp
@ -270,6 +274,9 @@ qlocale_tools.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_tools.cpp
qlocale_unix.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_unix.cpp
qlocale_win.o: $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp
qdatastream.o: $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qdatastream.cpp
@ -297,9 +304,15 @@ qfilesystemengine_unix.o: $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_unix.c
qfilesystemengine_mac.o: $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_mac.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_mac.cpp
qfilesystemengine_win.o: $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp
qfilesystemiterator_unix.o: $(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_unix.cpp
qfilesystemiterator_win.o: $(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp
qfsfileengine.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine.cpp
@ -309,6 +322,9 @@ qfsfileengine_iterator.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_iterator.c
qfsfileengine_unix.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_unix.cpp
qfsfileengine_win.o: $(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp
qabstractfileengine.o: $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/io/qabstractfileengine.cpp
@ -363,4 +379,10 @@ 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
qsystemlibrary.o: $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp
registry.o: $(SOURCE_PATH)/tools/shared/windows/registry.cpp
$(CXX) -c -o $@ $(CXXFLAGS) $(SOURCE_PATH)/tools/shared/windows/registry.cpp
# DO NOT DELETE THIS LINE -- make depend depends on it

View File

@ -42,7 +42,7 @@ CFLAGS_BARE = -c -Fo./ \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
-DUNICODE
CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS)
CFLAGS = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS) $(EXTRA_CPPFLAGS)
CXXFLAGS_BARE = $(CFLAGS_BARE)
CXXFLAGS = $(CFLAGS)
@ -66,10 +66,6 @@ OBJS = project.obj main.obj ioutils.obj proitems.obj \
msvc_objectmodel.obj msbuild_objectmodel.obj registry.obj \
gbuild.obj cesdkhandler.obj
!IFDEF QMAKE_OPENSOURCE_EDITION
CFLAGS = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION
!ENDIF
#qt code
QTOBJS= \
qbitarray.obj \

View File

@ -1,160 +0,0 @@
ifeq "$(SOURCE_PATH)" ""
SOURCE_PATH = ..
endif
ifeq "$(BUILD_PATH)" ""
BUILD_PATH = ..
endif
CORESRC = $(SOURCE_PATH)/src/corelib
TOOLSRC = $(SOURCE_PATH)/tools
QMKSRC = $(SOURCE_PATH)/qmake
QMKLIBSRC = $(QMKSRC)/library
# SHELL is the full path of sh.exe, unless
# 1) it is found in the current directory
# 2) it is not found at all
# 3) it is overridden on the command line with an existing file
# ... otherwise it is always sh.exe. Specifically, SHELL from the
# environment has no effect.
#
# This check will fail if SHELL is explicitly set to a not
# sh-compatible shell. This is not a problem, because configure.exe
# will not do that.
ifeq ($(SHELL), sh.exe)
ifeq ($(wildcard $(CURDIR)/sh.exe), )
SH = 0
else
SH = 1
endif
else
SH = 1
endif
ifeq ($(SH), 1)
COPY = cp
DEL = rm -f
else
COPY = copy
DEL = del /f
endif
#
# specific stuff for mingw g++ make
#
CXX = g++
CFLAGS = -c -o$@ -O \
-I$(QMKSRC) -I$(QMKLIBSRC) -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 -DHAVE_QCONFIG_CPP \
-I$(SOURCE_PATH)/mkspecs/win32-g++ \
-I$(SOURCE_PATH)/tools/shared \
-DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DPROEVALUATOR_DEBUG \
-DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS \
-DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM \
-DUNICODE
CXXFLAGS = $(CFLAGS)
LFLAGS = -static -s
LIBS = -lole32 -luuid -ladvapi32 -lkernel32
LINKQMAKE = g++ $(LFLAGS) -o qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
ADDCLEAN =
#qmake code
OBJS = project.o main.o ioutils.o proitems.o \
qmakeglobals.o qmakeparser.o qmakeevaluator.o qmakebuiltins.o \
makefile.o unixmake.o unixmake2.o mingw_make.o \
option.o winmakefile.o projectgenerator.o property.o meta.o \
makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o \
msvc_nmake.o msvc_vcproj.o msvc_vcxproj.o \
msvc_objectmodel.o msbuild_objectmodel.o registry.o gbuild.o \
cesdkhandler.o
ifdef QMAKE_OPENSOURCE_EDITION
CFLAGS += -DQMAKE_OPENSOURCE_EDITION
endif
#qt code
QTOBJS= \
qbitarray.o \
qbuffer.o \
qarraydata.o \
qbytearray.o \
qcryptographichash.o \
qvsnprintf.o \
qbytearraymatcher.o \
qconfig.o \
qdatetime.o \
qdir.o \
qdiriterator.o \
qfiledevice.o \
qfile.o \
qtemporaryfile.o \
qfileinfo.o \
qabstractfileengine.o \
qfilesystementry.o \
qfilesystemengine.o \
qfilesystemengine_win.o \
qfilesystemiterator_win.o \
qfsfileengine.o \
qfsfileengine_iterator.o \
qfsfileengine_win.o \
qglobal.o \
qhash.o \
qiodevice.o \
qlibraryinfo.o \
qlist.o \
qlinkedlist.o \
qlocale.o \
qlocale_tools.o \
qlocale_win.o \
qmalloc.o \
qmap.o \
qregexp.o \
qtextcodec.o \
qutfcodec.o \
qstring.o \
qstringlist.o \
qstringbuilder.o \
qsystemerror.o \
qsystemlibrary.o \
qtextstream.o \
quuid.o \
qvector.o \
qsettings.o \
qsettings_win.o \
qvariant.o \
qmetatype.o \
qxmlstream.o \
qxmlutils.o \
qnumeric.o \
qlogging.o
qmake.exe: $(OBJS) $(QTOBJS)
$(LINKQMAKE)
-$(COPY) qmake.exe $(BUILD_PATH)\bin\qmake.exe
Makefile: $(SOURCE_PATH)/qmake/Makefile.win32-g++
@echo "Out of date, please rerun configure"
clean::
-$(DEL) $(OBJS) $(QTOBJS) $(ADDCLEAN)
distclean:: clean
-$(DEL) qmake.exe
.c.o:
$(CXX) $(CFLAGS) $<
.cpp.o:
$(CXX) $(CXXFLAGS) $<
QTVPATH = $(TOOLSRC)/shared/windows:$(CORESRC)/global:$(CORESRC)/kernel:$(CORESRC)/tools:$(CORESRC)/codecs:$(CORESRC)/io:$(CORESRC)/xml:$(CORESRC)/plugin:$(BUILD_PATH)/src/corelib/global
VPATH = $(QMKSRC):$(QMKLIBSRC):$(QMKSRC)/generators:$(QMKSRC)/generators/unix:$(QMKSRC)/generators/mac:$(QMKSRC)/generators/win32:$(QMKSRC)/generators/integrity:$(QTVPATH)
project.o: $(QMKSRC)/project.h $(QMKSRC)/option.h
meta.o: $(QMKSRC)/project.h $(QMKSRC)/option.h
main.o: $(QMKSRC)/project.h
option.o: $(QMKSRC)/option.h
property.o: $(QMKSRC)/project.h $(QMKSRC)/option.h

View File

@ -1277,7 +1277,7 @@ void Configure::parseCmdLine()
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
} else if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "mingw32-make";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32-g++";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.unix";
} else {
if (dictionary[ "MAKE" ].isEmpty()) dictionary[ "MAKE" ] = "make";
dictionary[ "QMAKEMAKEFILE" ] = "Makefile.win32";
@ -3687,12 +3687,64 @@ void Configure::buildQmake()
stream << "#AutoGenerated by configure.exe" << endl
<< "BUILD_PATH = " << QDir::toNativeSeparators(buildPath) << endl
<< "SOURCE_PATH = " << QDir::toNativeSeparators(sourcePath) << endl;
stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl
<< "QT_VERSION = " << dictionary["VERSION"] << endl;
stream << "QT_VERSION = " << dictionary["VERSION"] << endl;
if (dictionary[ "QMAKESPEC" ] == QString("win32-g++")) {
stream << "QMAKESPEC = $(SOURCE_PATH)\\mkspecs\\win32-g++" << endl
<< "EXTRA_CFLAGS = -DUNICODE" << endl
<< "EXTRA_CXXFLAGS = -DUNICODE" << endl
<< "QTOBJS = qfilesystemengine_win.o \\" << endl
<< " qfilesystemiterator_win.o \\" << endl
<< " qfsfileengine_win.o \\" << endl
<< " qlocale_win.o \\" << endl
<< " qsettings_win.o \\" << endl
<< " qsystemlibrary.o \\" << endl
<< " registry.o" << endl
<< "QTSRCS=\"$(SOURCE_PATH)/src/corelib/io/qfilesystemengine_win.cpp\" \\" << endl
<< " \"$(SOURCE_PATH)/src/corelib/io/qfilesystemiterator_win.cpp\" \\" << endl
<< " \"$(SOURCE_PATH)/src/corelib/io/qfsfileengine_win.cpp\" \\" << endl
<< " \"$(SOURCE_PATH)/src/corelib/io/qsettings_win.cpp\" \\" << endl
<< " \"$(SOURCE_PATH)/src/corelib/tools/qlocale_win.cpp\" \\" << endl\
<< " \"$(SOURCE_PATH)/src/corelib/plugin/qsystemlibrary.cpp\" \\" << endl
<< " \"$(SOURCE_PATH)/tools/shared/windows/registry.cpp\"" << endl
<< "EXEEXT=.exe" << endl
<< "LFLAGS=-static -s -lole32 -luuid -ladvapi32 -lkernel32" << endl;
/*
** SHELL is the full path of sh.exe, unless
** 1) it is found in the current directory
** 2) it is not found at all
** 3) it is overridden on the command line with an existing file
** ... otherwise it is always sh.exe. Specifically, SHELL from the
** environment has no effect.
**
** This check will fail if SHELL is explicitly set to a not
** sh-compatible shell. This is not a problem, because configure.bat
** will not do that.
*/
stream << "ifeq ($(SHELL), sh.exe)" << endl
<< " ifeq ($(wildcard $(CURDIR)/sh.exe), )" << endl
<< " SH = 0" << endl
<< " else" << endl
<< " SH = 1" << endl
<< " endif" << endl
<< "else" << endl
<< " SH = 1" << endl
<< "endif" << endl
<< "\n"
<< "ifeq ($(SH), 1)" << endl
<< " RM_F = rm -f" << endl
<< " RM_RF = rm -rf" << endl
<< "else" << endl
<< " RM_F = del /f" << endl
<< " RM_RF = rmdir /s /q" << endl
<< "endif" << endl;
stream << "\n\n";
} else {
stream << "QMAKESPEC = " << dictionary["QMAKESPEC"] << endl;
}
if (dictionary["EDITION"] == "OpenSource" ||
dictionary["QT_EDITION"].contains("OPENSOURCE"))
stream << "QMAKE_OPENSOURCE_EDITION = yes" << endl;
stream << "EXTRA_CPPFLAGS = -DQMAKE_OPENSOURCE_EDITION" << endl;
stream << "\n\n";
QFile in(sourcePath + "/qmake/" + dictionary["QMAKEMAKEFILE"]);