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