unifiy initialization of QMAKE_LIBS{,_PRIVATE} among windows generators
[profile/ivi/qtbase.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-msvc11" || "$(QMAKESPEC)" == "win32-icc"
2
3 !if "$(SOURCE_PATH)" == ""
4 SOURCE_PATH = ..
5 !endif
6 !if "$(BUILD_PATH)" == ""
7 BUILD_PATH = ..
8 !endif
9
10 QMKSRC = $(SOURCE_PATH)\qmake
11
12 #
13 # specific stuff for NMake and ICC
14 #
15 !if "$(QMAKESPEC)" == "win32-icc"
16 CXX         = icl
17 LINK        = link
18 CFLAGS      = /Zc:forScope
19 !else
20 CXX         = cl
21 LINK        = link
22 !endif
23
24 #
25 # specific stuff for VS2005
26 #
27 !if "$(QMAKESPEC)" == "win32-msvc2005"
28 CFLAGS_EXTRA      = /Zc:wchar_t-
29 !elseif "$(QMAKESPEC)" == "win32-msvc2008" || "$(QMAKESPEC)" == "win32-msvc2010" || "$(QMAKESPEC)" == "win32-msvc11"
30 CFLAGS_EXTRA      = /MP
31 !endif
32
33 CFLAGS_BARE = -c -Fo./ \
34               -W3 -nologo -O1 \
35               $(CFLAGS_EXTRA) \
36               -I$(QMKSRC) -I$(QMKSRC)\generators -I$(QMKSRC)\generators\unix -I$(QMKSRC)\generators\win32 -I$(QMKSRC)\generators\mac -I$(QMKSRC)\generators\integrity \
37               -I$(BUILD_PATH)\include -I$(BUILD_PATH)\include\QtCore -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION) -I$(BUILD_PATH)\include\QtCore\$(QT_VERSION)\QtCore \
38               -I$(BUILD_PATH)\src\corelib\global \
39               -I$(SOURCE_PATH)\mkspecs\$(QMAKESPEC)  \
40               -I$(SOURCE_PATH)\tools\shared \
41               -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_LITE_COMPONENT \
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_BOOTSTRAPPED
44 CFLAGS   = -Yuqmake_pch.h -FIqmake_pch.h -Fpqmake_pch.pch $(CFLAGS_BARE) $(CFLAGS)
45
46 CXXFLAGS_BARE = $(CFLAGS_BARE)
47 CXXFLAGS = $(CFLAGS)
48
49 LFLAGS      =
50 LIBS        = ole32.lib advapi32.lib
51 LINKQMAKE   = $(LINK) $(LFLAGS) -OUT:qmake.exe $(OBJS) $(QTOBJS) $(LIBS)
52 ADDCLEAN    = vc60.pdb vc70.pdb qmake.pdb qmake.ilk
53
54 !ELSE
55 !ERROR Unsupported compiler for this Makefile
56 !ENDIF
57
58 #qmake code
59 OBJS        = project.obj main.obj makefile.obj unixmake.obj unixmake2.obj mingw_make.obj \
60               option.obj winmakefile.obj projectgenerator.obj property.obj meta.obj \
61               makefiledeps.obj metamakefile.obj xmloutput.obj pbuilder_pbx.obj \
62               borland_bmake.obj msvc_nmake.obj msvc_vcproj.obj msvc_vcxproj.obj \
63               msvc_objectmodel.obj msbuild_objectmodel.obj registry.obj \
64               gbuild.obj cesdkhandler.obj
65
66 !IFDEF QMAKE_OPENSOURCE_EDITION
67 CFLAGS      = $(CFLAGS) -DQMAKE_OPENSOURCE_EDITION
68 !ENDIF
69
70 #qt code
71 QTOBJS= \
72         qbitarray.obj \
73         qbuffer.obj \
74         qcryptographichash.obj \
75         qfilesystementry.obj \
76         qfilesystemengine.obj \
77         qfilesystemengine_win.obj \
78         qfilesystemiterator_win.obj \
79         qfsfileengine.obj \
80         qfsfileengine_iterator.obj \
81         qarraydata.obj \
82         qbytearray.obj \
83         qvsnprintf.obj \
84         qbytearraymatcher.obj \
85         qdatetime.obj \
86         qdir.obj \
87         qdiriterator.obj \
88         qfiledevice.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         qstringbuilder.obj \
111         qsystemerror.obj \
112         qtextstream.obj \
113         qdatastream.obj \
114         quuid.obj \
115         qvector.obj \
116         qsettings.obj \
117         qlibraryinfo.obj \
118         qvariant.obj \
119         qsettings_win.obj \
120         qmetatype.obj \
121         qxmlstream.obj \
122         qxmlutils.obj \
123         qnumeric.obj \
124         qlogging.obj
125
126 first all: qmake.exe
127
128 qmake.exe: $(OBJS) $(QTOBJS)
129         $(LINKQMAKE) qmake_pch.obj
130         -copy qmake.exe $(BUILD_PATH)\bin\qmake.exe
131
132 clean::
133         -del $(QTOBJS)
134         -del $(OBJS)
135         -del qmake_pch.obj
136         -del qmake_pch.pch
137         -del qsystemlibrary.obj
138         -del vc60.pdb
139         -del vc70.pdb
140         -del qmake.pdb
141         -del qmake.ilk
142         -del qmake.tds
143
144 distclean:: clean
145         -del qmake
146
147 .c.obj:
148         $(CXX) $(CFLAGS) $<
149
150 .cpp.obj:
151         $(CXX) $(CXXFLAGS) $<
152
153 .cc.obj:
154         $(CXX) $(CXXFLAGS) $<
155
156 .cxx.obj:
157         $(CXX) $(CXXFLAGS) $<
158
159 $(OBJS): qmake_pch.obj
160
161 $(QTOBJS): qmake_pch.obj
162
163 qmake_pch.obj:
164         $(CXX) $(CXXFLAGS_BARE) -c -Yc -Fpqmake_pch.pch -TP $(QMKSRC)\qmake_pch.h
165
166 {$(SOURCE_PATH)\qmake\generators\mac}.cpp{}.obj::
167         $(CXX) $(CXXFLAGS) $<
168
169 {$(SOURCE_PATH)\qmake\generators\integrity}.cpp{}.obj::
170         $(CXX) $(CXXFLAGS) $<
171
172 {$(SOURCE_PATH)\qmake\generators\unix}.cpp{}.obj::
173         $(CXX) $(CXXFLAGS) $<
174
175 {$(SOURCE_PATH)\qmake\generators\win32}.cpp{}.obj::
176         $(CXX) $(CXXFLAGS) $<
177
178 {$(SOURCE_PATH)\qmake\generators}.cpp{}.obj::
179         $(CXX) $(CXXFLAGS) $<
180
181 {$(SOURCE_PATH)\qmake}.cpp{}.obj::
182         $(CXX) $(CXXFLAGS) $<
183
184 {$(SOURCE_PATH)\src\3rdparty\md5}.cpp{}.obj::
185         $(CXX) $(CXXFLAGS) $<
186
187 {$(SOURCE_PATH)\src\corelib\codecs}.cpp{}.obj::
188         $(CXX) $(CXXFLAGS) $<
189
190 {$(SOURCE_PATH)\src\corelib\global}.cpp{}.obj::
191         $(CXX) $(CXXFLAGS) $<
192
193 {$(SOURCE_PATH)\src\corelib\io}.cpp{}.obj::
194         $(CXX) $(CXXFLAGS) $<
195
196 {$(SOURCE_PATH)\src\corelib\kernel}.cpp{}.obj::
197         $(CXX) $(CXXFLAGS) $<
198
199 {$(SOURCE_PATH)\src\corelib\plugin}.cpp{}.obj::
200         $(CXX) $(CXXFLAGS) $<
201
202 {$(SOURCE_PATH)\src\corelib\tools}.cpp{}.obj::
203         $(CXX) $(CXXFLAGS) $<
204
205 {$(SOURCE_PATH)\src\corelib\xml}.cpp{}.obj::
206         $(CXX) $(CXXFLAGS) $<
207
208 {$(SOURCE_PATH)\tools\shared\windows}.cpp{}.obj::
209         $(CXX) $(CXXFLAGS) $<