Add detection of and support for Visual Studio 2015
[qt:qt.git] / qmake / Makefile.win32
1 !IF "$(QMAKESPEC)" == "win32-msvc" || "$(QMAKESPEC)" == "win32-msvc.net" || "$(QMAKESPEC)" == "win32-msvc2002" || "$(QMAKESPEC)" == "win32-msvc2003" || "$(QMAKESPEC)" == "win32-msvc2005" || "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013" || "$(QMAKESPEC)" == "win32-msvc2015" || "$(QMAKESPEC)" == "win32-icc"
2
3 !if "$(SOURCE_PATH)" == ""
4 SOURCE_PATH = ..
5 !endif
6 !if "$(BUILD_PATH)" == ""
7 BUILD_PATH = ..
8 !endif
9
10 #
11 # specific stuff for NMake and ICC
12 #
13 !if "$(QMAKESPEC)" == "win32-icc"
14 CXX         = icl
15 LINK        = link
16 CFLAGS      = /Zc:forScope
17 !else
18 CXX         = cl
19 LINK        = link
20 !endif
21
22 #
23 # specific stuff for VS2005
24 #
25 !if "$(QMAKESPEC)" == "win32-msvc2005"
26 CFLAGS_EXTRA      = /Zc:wchar_t-
27 !elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc2012" || "$(QMAKESPEC)" == "win32-msvc2013"
28 CFLAGS_EXTRA      = /MP
29 !endif
30
31 CFLAGS_BARE = -c -Fo./ \
32               -W3 -nologo -O2 \
33               $(CFLAGS_EXTRA) \
34               -I. -Igenerators -Igenerators\unix -Igenerators\win32 -Igenerators\mac -Igenerators\symbian -Igenerators\integrity \
35               -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore \
36               -I$(SOURCE_PATH)\include -I$(SOURCE_PATH)\include\QtCore \
37               -I$(BUILD_PATH)\src\corelib\global \
38               -I$(BUILD_PATH)\src\corelib\xml \
39               -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC)  \
40               -I$(SOURCE_PATH)\tools\shared \
41               -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT -DQT_NODLL -DQT_NO_STL \
42               -DQT_NO_COMPRESS -DUNICODE -DHAVE_QCONFIG_CPP -DQT_BUILD_QMAKE -DQT_NO_THREAD \
43               -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_NO_PCRE -DQT_BOOTSTRAPPED \
44               -DQLIBRARYINFO_EPOCROOT
45 CFLAGS   = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS)
46
47 CXXFLAGS_BARE = $(CFLAGS_BARE)
48 CXXFLAGS = $(CFLAGS)
49
50 LFLAGS      =
51 LIBS        = ole32.lib advapi32.lib
52 LINKQMAKE   = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
53 ADDCLEAN    = vc60.pdb vc70.pdb qmake.pdb qmake.ilk
54
55 !ELSE
56 !ERROR Unsupported compiler for this Makefile
57 !ENDIF
58
59 #qmake code
60 OBJS        = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw_make.obj \
61               option.obj winmakefile.obj projectgenerator.obj property.obj meta.obj \
62               makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \
63               borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj msvc_vcxproj.obj \
64               msvc_objectmodel.obj msbuild_objectmodel.obj symmake.obj initprojectdeploy_symbian.obj \
65               symmake_abld.obj symmake_sbsv2.obj symbiancommon.obj registry.obj epocroot.obj \
66               gbuild.obj
67
68 !IFDEF QMAKE_OPENSOURCE_EDITION
69 CFLAGS      = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION
70 !ENDIF
71
72 #qt code
73 QTOBJS= \
74         qbitarray.obj \
75         qbuffer.obj \
76         qcryptographichash.obj \
77         qfilesystementry.obj \
78         qfilesystemengine.obj \
79         qfilesystemengine_win.obj \
80         qfilesystemiterator_win.obj \
81         qfsfileengine.obj \
82         qfsfileengine_iterator.obj \
83         qbytearray.obj \
84         qvsnprintf.obj \
85         qbytearraymatcher.obj \
86         qdatetime.obj \
87         qdir.obj \
88         qdiriterator.obj \
89         qfile.obj \
90         qtemporaryfile.obj \
91         qabstractfileengine.obj \
92         qfsfileengine_win.obj \
93         qsystemlibrary.obj \
94         qfileinfo.obj \
95         qglobal.obj \
96         qhash.obj \
97         qiodevice.obj \
98         qlist.obj \
99         qlinkedlist.obj \
100         qlocale.obj \
101         qlocale_tools.obj \
102         qlocale_win.obj \
103         qmalloc.obj \
104         qmap.obj \
105         qregexp.obj \
106         qtextcodec.obj \
107         qutfcodec.obj \
108         qstring.obj \
109         qstringlist.obj \
110         qsystemerror.obj \
111         qtextstream.obj \
112         qdatastream.obj \
113         quuid.obj \
114         qvector.obj \
115         qsettings.obj \
116         qlibraryinfo.obj \
117         qvariant.obj \
118         qsettings_win.obj \
119         qmetatype.obj \
120         qxmlstream.obj \
121         qxmlutils.obj \
122         qnumeric.obj
123
124
125 first all: qmake.exe
126
127 qmake.exe: $(OBJS) $(QTOBJS)
128         $(LINKQMAKE) qmake_pch.obj
129         -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe
130
131 clean::
132         -del $(QTOBJS)
133         -del $(OBJS)
134         -del qmake_pch.obj
135         -del qmake_pch.pch
136         -del qsystemlibrary.obj
137         -del vc60.pdb
138         -del vc70.pdb
139         -del qmake.pdb
140         -del qmake.ilk
141         -del qmake.tds
142
143 distclean:: clean
144         -del qmake
145
146 .c.obj:
147         $(CXX) $(CFLAGS) $<
148
149 .cpp.obj:
150         $(CXX) $(CXXFLAGS) $<
151
152 .cc.obj:
153         $(CXX) $(CXXFLAGS) $<
154
155 .cxx.obj:
156         $(CXX) $(CXXFLAGS) $<
157
158 $(OBJS): qmake_pch.obj
159
160 $(QTOBJS): qmake_pch.obj
161
162 qmake_pch.obj:
163         $(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP qmake_pch.h
164
165 {$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj::
166         $(CXX) $(CXXFLAGS) $<
167
168 {$(SOURCE_PATH)\qmake\generators\symbian}.cpp{}.obj::
169         $(CXX) $(CXXFLAGS) $<
170
171 {$(SOURCE_PATH)\qmake\generators\integrity}.cpp{}.obj::
172         $(CXX) $(CXXFLAGS) $<
173
174 {$(SOURCE_PATH)\qmake\generators\unix}.cpp{}.obj::
175         $(CXX) $(CXXFLAGS) $<
176
177 {$(SOURCE_PATH)\qmake\generators\win32}.cpp{}.obj::
178         $(CXX) $(CXXFLAGS) $<
179
180 {$(SOURCE_PATH)\qmake\generators}.cpp{}.obj::
181         $(CXX) $(CXXFLAGS) $<
182
183 {$(SOURCE_PATH)\qmake}.cpp{}.obj::
184         $(CXX) $(CXXFLAGS) $<
185
186 {$(SOURCE_PATH)\src\3rdparty\md5}.cpp{}.obj::
187         $(CXX) $(CXXFLAGS) $<
188
189 {$(SOURCE_PATH)\src\corelib\codecs}.cpp{}.obj::
190         $(CXX) $(CXXFLAGS) $<
191
192 {$(SOURCE_PATH)\src\corelib\global}.cpp{}.obj::
193         $(CXX) $(CXXFLAGS) $<
194
195 {$(SOURCE_PATH)\src\corelib\io}.cpp{}.obj::
196         $(CXX) $(CXXFLAGS) $<
197
198 {$(SOURCE_PATH)\src\corelib\kernel}.cpp{}.obj::
199         $(CXX) $(CXXFLAGS) $<
200
201 {$(SOURCE_PATH)\src\corelib\plugin}.cpp{}.obj::
202         $(CXX) $(CXXFLAGS) $<
203
204 {$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
205         $(CXX) $(CXXFLAGS) $<
206
207 {$(SOURCE_PATH)\src\corelib\xml}.cpp{}.obj::
208         $(CXX) $(CXXFLAGS) $<
209
210 {$(SOURCE_PATH)\tools\shared\symbian}.cpp{}.obj::
211         $(CXX) $(CXXFLAGS) $<
212
213 {$(SOURCE_PATH)\tools\shared\windows}.cpp{}.obj::
214         $(CXX) $(CXXFLAGS) $<