[EXPLORER][EXPLORER_NEW]
[reactos.git] / base / shell / explorer / Makefile-Wine
1 TOPSRCDIR = ../..
2 TOPOBJDIR = ../..
3 SRCDIR = .
4
5 MODULE = explorer.exe
6 APPMODE = gui
7 IMPORTS = shell32 comctl32 msimg32 ole32 user32 gdi32 kernel32 advapi32 oleaut32
8 EXTRADEFS = -D__WINE__ -D_WIN32_IE=0x0600 -D_WIN32_WINNT=0x0501 -DWINVER=0x0500 -D__MINGW32__ -DCINTERFACE
9 EXTRA_OBJS = notifyhook.dll
10 EXTRALIBS = $(LIBUUID)
11
12 C_SRCS = \
13 services/startup.c \
14 utility/splitpath.c
15
16 CPP_SRCS = \
17 explorer.cpp \
18 desktop/desktop.cpp \
19 utility/shellclasses.cpp \
20 utility/utility.cpp \
21 utility/window.cpp \
22 utility/dragdropimpl.cpp \
23 utility/shellbrowserimpl.cpp \
24 utility/xmlstorage.cpp \
25 utility/xmlstorage.cpp \
26 utility/xs-native.cpp
27 shell/entries.cpp \
28 shell/winfs.cpp \
29 shell/unixfs.cpp \
30 shell/shellfs.cpp \
31 shell/mainframe.cpp \
32 shell/filechild.cpp \
33 shell/pane.cpp \
34 shell/shellbrowser.cpp \
35 shell/ntobjfs.cpp \
36 shell/regfs.cpp \
37 shell/fatfs.cpp \
38 shell/webchild.cpp \
39 services/shellservices.cpp \
40 taskbar/desktopbar.cpp \
41 taskbar/taskbar.cpp \
42 taskbar/startmenu.cpp \
43 taskbar/traynotify.cpp \
44 taskbar/quicklaunch.cpp \
45 taskbar/favorites.cpp \
46 dialogs/searchprogram.cpp \
47 dialogs/settings.cpp
48
49 RC_SRCS = explorer_intres.rc
50 EXTRARCFLAGS = -D__WRC__ -D_WIN32
51
52
53 # Global rules for building a Winelib program -*-Makefile-*-
54 #
55 # Each individual makefile should define the following variables:
56 # MODULE : name of the main module being built
57 # APPMODE : program mode (cui,gui,cuiw,guiw)
58 # EXTRALIBS : extra libraries to link in (optional)
59 # EXTRADEFS : extra symbol definitions, like -DWINELIB (optional)
60 #
61 # plus all variables required by the global Make.rules.in
62 #
63
64 DEFS = -D_REENTRANT -fPIC $(EXTRADEFS)
65 LDDLLFLAGS = -Wl,-Bsymbolic,-z,defs
66 ALL_OBJS = $(OBJS) $(MODULE).dbg.o
67 ALL_LIBS = $(LIBWINE) $(EXTRALIBS) $(LIBPORT) $(LDFLAGS) $(LIBS)
68 BASEMODULE = $(MODULE:.exe=)
69 TESTIMPORTS = $(DELAYIMPORTS) $(IMPORTS)
70 RUNTESTFLAGS= -q -P wine -T $(TOPOBJDIR) $(PLTESTPROGRAM:%=-p %)
71
72
73 # Global rules shared by all makefiles -*-Makefile-*-
74 #
75 # Each individual makefile must define the following variables:
76 # TOPSRCDIR : top-level source directory
77 # TOPOBJDIR : top-level object directory
78 # SRCDIR : source directory for this module
79 # MODULE : name of the module being built
80 #
81 # Each individual makefile may define the following additional variables:
82 # C_SRCS : C sources for the module
83 # CPP_SRCS : C++ sources for the module
84 # C_SRCS16 : 16-bit C sources for the module
85 # RC_SRCS : resource source files
86 # EXTRA_SRCS : extra source files for make depend
87 # EXTRA_OBJS : extra object files
88 # IMPORTS : dlls to import
89 # DELAYIMPORTS : dlls to import in delayed mode
90 # SUBDIRS : subdirectories that contain a Makefile
91 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
92 # INSTALLSUBDIRS : subdirectories to run make install/uninstall into
93
94 # First some useful definitions
95
96 SHELL = /bin/sh
97 CC = gcc
98 CXX = g++
99 CPP = gcc -E
100 #CFLAGS = -g -O2
101 CFLAGS = -g
102 CPPFLAGS =
103 LIBS = -lm -lstdc++
104 YACC = bison -y
105 LEX = flex
106 LEXLIB = -lfl
107 EXEEXT =
108 OBJEXT = o
109 LIBEXT = so
110 DLLEXT = .so
111 IMPLIBEXT = def
112 LDSHARED = $(CC) -shared $(SONAME:%=-Wl,-soname,%)
113 DLLTOOL = false
114 DLLWRAP =
115 AR = ar rc
116 RANLIB = ranlib
117 STRIP = strip
118 WINDRES = mingw32-windres
119 LN = ln
120 LN_S = ln -s
121 TOOLSDIR = $(TOPOBJDIR)
122 AS = as
123 LD = ld
124 LDFLAGS =
125 LDCOMBINE = $(LD) -r
126 RM = rm -f
127 MV = mv
128 LINT =
129 LINTFLAGS =
130 INCLUDES = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
131 EXTRACFLAGS = -mpreferred-stack-boundary=2 -fno-strict-aliasing -gstabs+ -Wpointer-arith
132 ALLCFLAGS = $(INCLUDES) $(DEFS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS)
133 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
134 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
135 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
136 WINEWRAPPER = $(TOPSRCDIR)/tools/winewrapper
137 C2MAN = $(TOPSRCDIR)/tools/c2man.pl
138 RUNTEST = $(TOPSRCDIR)/tools/runtest
139 WINEBUILD = $(TOOLSDIR)/tools/winebuild/winebuild
140 MAKEDEP = $(TOOLSDIR)/tools/makedep
141 WRC = $(TOOLSDIR)/tools/wrc/wrc
142 WMC = $(TOOLSDIR)/tools/wmc/wmc
143 WIDL = $(TOOLSDIR)/tools/widl/widl
144 RC = $(WRC)
145 RC16 = $(WRC)
146 RCFLAGS = --nostdinc $(INCLUDES) $(EXTRARCFLAGS)
147 RC16FLAGS = -O res16 $(RCFLAGS)
148 LDPATH = LD_LIBRARY_PATH="$(TOOLSDIR)/libs/unicode:$$LD_LIBRARY_PATH"
149 DLLDIR = $(TOPOBJDIR)/dlls
150 LIBDIR = $(TOPOBJDIR)/libs
151 LIBPORT = -L$(TOPOBJDIR)/libs/port -lwine_port
152 LIBUNICODE = -L$(TOPOBJDIR)/libs/unicode -lwine_unicode
153 LIBUUID = -L$(TOPOBJDIR)/libs/uuid -lwine_uuid
154 LIBWINE = -L$(TOPOBJDIR)/libs/wine -lwine
155
156
157
158 # Installation infos
159
160 INSTALL = /usr/bin/install -c $(INSTALL_FLAGS)
161 INSTALL_PROGRAM = ${INSTALL} $(INSTALL_PROGRAM_FLAGS)
162 INSTALL_SCRIPT = ${INSTALL} $(INSTALL_SCRIPT_FLAGS)
163 INSTALL_DATA = ${INSTALL} -m 644 $(INSTALL_DATA_FLAGS)
164 prefix = /usr/local
165 exec_prefix = ${prefix}
166 bindir = ${exec_prefix}/bin
167 libdir = ${exec_prefix}/lib
168 datadir = ${prefix}/share
169 infodir = ${prefix}/info
170 mandir = ${prefix}/man
171 sysconfdir = ${prefix}/etc
172 includedir = ${prefix}/include/wine
173 dlldir = ${exec_prefix}/lib/wine
174 prog_manext = 1
175 api_manext = 3w
176 conf_manext = 5
177 CLEAN_FILES = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
178 *.flc *.spec.c *.spec.def *.dbg.c y.tab.c y.tab.h lex.yy.c core */*.o
179
180 OBJS = $(C_SRCS:.c=.o) $(CPP_SRCS:.cpp=.o) $(EXTRA_OBJS)
181
182 RCOBJS = $(RC_SRCS:.rc=.res.o)
183 LINTS = $(C_SRCS:.c=.ln) $(CPP_SRCS:.cpp=.ln)
184
185 # Implicit rules
186
187 .SUFFIXES: .mc .rc .mc.rc .res .res.o .coff .spec .spec.c .spec.def .ok
188
189 .c.o:
190 $(CC) -c $(ALLCFLAGS) -o $@ $<
191
192 .cpp.o:
193 $(CXX) -c $(ALLCFLAGS) -o $@ $<
194
195 .s.o:
196 $(AS) -o $@ $<
197
198 .mc.mc.rc:
199 $(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
200
201 .rc.res:
202 $(LDPATH) $(RC) $(RCFLAGS) -fo$@ $<
203
204 .res.res.o:
205 $(WINDRES) -i $< -o $@
206
207 .rc.coff:
208 $(WINDRES) -i $< -o $@
209
210 .spec.spec.c:
211 $(WINEBUILD) $(DEFS) -o $@ --main-module $(MODULE) --spec $<
212
213 .spec.spec.def:
214 $(WINEBUILD) $(DEFS) -o $@ --def $<
215
216 .c.ln:
217 $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
218
219 .c.ok:
220 $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
221
222 # 'all' target first in case the enclosing Makefile didn't define any target
223
224 all: Makefile
225
226 filter:
227 @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
228
229 .PHONY: all filter
230
231 # Rule for main module debug channels
232
233 $(MODULE).dbg.c: $(C_SRCS) $(CPP_SRCS) $(C_SRCS16) $(WINEBUILD)
234 $(WINEBUILD) $(DEFS) -o $@ --debug -C$(SRCDIR) $(C_SRCS) $(CPP_SRCS) $(C_SRCS16)
235
236 # Rule to rebuild the tools
237
238 $(MAKEDEP):
239 cd $(TOOLSDIR)/tools && $(MAKE) `basename $@`
240
241 # Rules for makefile
242
243 Makefile: Makefile.in $(TOPSRCDIR)/configure
244 @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
245 @exit 1
246
247 # Rule for linting
248
249 $(MODULE).ln : $(LINTS)
250 if test "$(LINTS)" ; \
251 then \
252 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
253 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
254 else \
255 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
256 fi
257
258 lint:: $(MODULE).ln
259
260 # Rules for Windows API checking
261
262 winapi_check:: dummy
263 $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
264
265 .PHONY: winapi_check
266
267 # Rules for dependencies
268
269 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
270 cd `dirname $@` && $(MAKE) depend
271
272 depend: $(MAKEDEP) $(SUBDIRS:%=%/__depend__)
273 $(MAKEDEP) $(INCLUDES) -C$(SRCDIR) $(C_SRCS) $(CPP_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(EXTRA_SRCS)
274
275 .PHONY: depend $(SUBDIRS:%=%/__depend__)
276
277 # Rules for cleaning
278
279 $(SUBDIRS:%=%/__clean__): dummy
280 cd `dirname $@` && $(MAKE) clean
281
282 $(SUBDIRS:%=%/__testclean__): dummy
283 cd `dirname $@` && $(MAKE) testclean
284
285 $(EXTRASUBDIRS:%=%/__clean__): dummy
286 -cd `dirname $@` && $(RM) $(CLEAN_FILES)
287
288 testclean:: $(SUBDIRS:%=%/__testclean__)
289
290 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
291 $(RM) $(CLEAN_FILES) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
292
293 .PHONY: clean testclean $(SUBDIRS:%=%/__clean__) $(SUBDIRS:%=%/__testclean__) $(EXTRASUBDIRS:%=%/__clean__)
294
295 # Rules for installing
296
297 $(SUBDIRS:%=%/__install__): dummy
298 cd `dirname $@` && $(MAKE) install
299
300 $(SUBDIRS:%=%/__install-lib__): dummy
301 cd `dirname $@` && $(MAKE) install-lib
302
303 $(SUBDIRS:%=%/__install-dev__): dummy
304 cd `dirname $@` && $(MAKE) install-dev
305
306 $(SUBDIRS:%=%/__uninstall__): dummy
307 cd `dirname $@` && $(MAKE) uninstall
308
309 install:: $(INSTALLSUBDIRS:%=%/__install__)
310
311 uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
312
313 .PHONY: install install-lib install-dev uninstall \
314 $(SUBDIRS:%=%/__install__) $(SUBDIRS:%=%/__uninstall__) \
315 $(SUBDIRS:%=%/__install-lib__) $(SUBDIRS:%=%/__install-dev__)
316
317 # Rules for checking that no imports are missing
318
319 $(SUBDIRS:%=%/__checklink__): dummy
320 @cd `dirname $@` && $(MAKE) checklink
321
322 .PHONY: checklink $(SUBDIRS:%=%/__checklink__)
323
324 # Rules for testing
325
326 $(SUBDIRS:%=%/__test__): dummy
327 @cd `dirname $@` && $(MAKE) test
328
329 $(SUBDIRS:%=%/__crosstest__): dummy
330 @cd `dirname $@` && $(MAKE) crosstest
331
332 .PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
333
334 # Misc. rules
335
336 $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC)
337
338 $(MC_SRCS:.mc=.mc.rc): $(WMC)
339
340 $(IDL_SRCS:.idl=.h): $(WIDL)
341
342 $(SUBDIRS): dummy
343 @cd $@ && $(MAKE)
344
345 dummy:
346
347 .PHONY: dummy $(SUBDIRS)
348
349 # End of global rules
350
351 all: $(MODULE)$(DLLEXT) $(BASEMODULE)$(EXEEXT)
352
353 # Rule for main module spec file
354
355 $(MODULE).spec.c: $(RC_SRCS:.rc=.res) $(ALL_OBJS) $(WINEBUILD)
356 $(WINEBUILD) $(DEFS) -o $@ --exe $(MODULE) $(APPMODE:%=--exe-mode %) $(RC_SRCS:.rc=.res) $(ALL_OBJS) -L$(DLLDIR) $(DELAYIMPORTS:%=-d%) $(IMPORTS:%=-l%)
357
358 # Rules for .so main module
359
360 $(MODULE).so: $(MODULE).spec.o $(ALL_OBJS) Makefile.in
361 $(LDSHARED) $(LDDLLFLAGS) $(MODULE).spec.o $(ALL_OBJS) -o $@ $(ALL_LIBS) -lc
362
363 $(BASEMODULE): $(WINEWRAPPER)
364 $(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
365
366 # Rules for .exe main module
367
368 $(MODULE): $(ALL_OBJS) $(RCOBJS) Makefile.in
369 $(CC) $(ALL_OBJS) $(RCOBJS) -o $@ $(DELAYIMPORTS:%=-l%) $(IMPORTS:%=-l%) $(ALL_LIBS)
370
371 # Rules for testing
372
373 check test:: $(SUBDIRS:%=%/__test__)
374
375 $(TESTRESULTS): $(MODULE)$(DLLEXT)
376
377 # Rules for installation
378
379 .PHONY: install_prog install_prog.so uninstall_prog uninstall_prog.so
380
381 install_prog.so: $(MODULE).so dummy
382 $(MKINSTALLDIRS) $(dlldir)
383 $(INSTALL_PROGRAM) $(MODULE).so $(dlldir)/$(MODULE).so
384
385 install_prog: $(MODULE) dummy
386 $(MKINSTALLDIRS) $(bindir)
387 $(INSTALL_PROGRAM) $(MODULE) $(bindir)/$(MODULE)
388
389 uninstall_prog.so: dummy
390 $(RM) $(dlldir)/$(MODULE).so
391
392 uninstall_prog: dummy
393 $(RM) $(bindir)/$(MODULE)
394
395 install:: install_prog$(DLLEXT)
396
397 uninstall:: uninstall_prog$(DLLEXT)
398
399 clean::
400 $(RM) $(BASEMODULE) $(MODULE)
401
402 ### Dependencies: