winex11: add owned windows to taskbar if owner is not mapped
[wine] / Make.rules.in
1 # Global rules shared by all makefiles     -*-Makefile-*-
2 #
3 # Each individual makefile must define the following variables:
4 # TOPSRCDIR    : top-level source directory
5 # TOPOBJDIR    : top-level object directory
6 # SRCDIR       : source directory for this module
7 # MODULE       : name of the module being built
8 #
9 # Each individual makefile may define the following additional variables:
10 # C_SRCS       : C sources for the module
11 # C_SRCS16     : 16-bit C sources for the module
12 # RC_SRCS      : resource source files
13 # EXTRA_SRCS   : extra source files for make depend
14 # EXTRA_OBJS   : extra object files
15 # IMPORTS      : dlls to import
16 # DELAYIMPORTS : dlls to import in delayed mode
17 # SUBDIRS      : subdirectories that contain a Makefile
18 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
19 # INSTALLSUBDIRS : subdirectories to run make install/uninstall into
20 # MODCFLAGS    : extra CFLAGS for this module
21
22 # First some useful definitions
23
24 SHELL     = /bin/sh
25 CC        = @CC@
26 CFLAGS    = @CFLAGS@
27 CPPFLAGS  = @CPPFLAGS@
28 LIBS      = @LIBS@
29 BISON     = @BISON@
30 FLEX      = @FLEX@
31 EXEEXT    = @EXEEXT@
32 OBJEXT    = @OBJEXT@
33 LIBEXT    = @LIBEXT@
34 DLLEXT    = @DLLEXT@
35 IMPLIBEXT = @IMPLIBEXT@
36 LDSHARED  = @LDSHARED@
37 DLLTOOL   = @DLLTOOL@
38 DLLWRAP   = @DLLWRAP@
39 AR        = @AR@
40 ARFLAGS   = @ARFLAGS@
41 RANLIB    = @RANLIB@
42 STRIP     = @STRIP@
43 WINDRES   = @WINDRES@
44 LN        = @LN@
45 LN_S      = @LN_S@
46 TOOLSDIR  = @TOOLSDIR@
47 AS        = @AS@
48 LD        = @LD@
49 LDFLAGS   = @LDFLAGS@
50 PRELINK   = @PRELINK@
51 RM        = rm -f
52 MV        = mv
53 LINT      = @LINT@
54 LINTFLAGS = @LINTFLAGS@
55 FONTFORGE = @FONTFORGE@
56 RSVG      = @RSVG@
57 ICOTOOL   = @ICOTOOL@
58 INCLUDES     = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
59 EXTRACFLAGS  = @EXTRACFLAGS@
60 ALLCFLAGS    = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
61 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
62 IDLFLAGS     = $(INCLUDES) $(DEFS) $(EXTRAIDLFLAGS)
63 WINEBUILDFLAGS = $(DLLFLAGS) --as-cmd "$(AS)"
64 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
65 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi/winapi_check
66 WINEWRAPPER  = $(TOPSRCDIR)/tools/winewrapper
67 C2MAN        = $(TOPSRCDIR)/tools/c2man.pl
68 RUNTEST      = $(TOPSRCDIR)/tools/runtest
69 WINEBUILD    = $(TOOLSDIR)/tools/winebuild/winebuild
70 MAKEDEP      = $(TOOLSDIR)/tools/makedep
71 MAKECTESTS   = $(TOOLSDIR)/tools/make_ctests
72 WRC          = $(TOOLSDIR)/tools/wrc/wrc
73 WMC          = $(TOOLSDIR)/tools/wmc/wmc
74 WIDL         = $(TOOLSDIR)/tools/widl/widl
75 WINEGCC      = $(TOOLSDIR)/tools/winegcc/winegcc
76 RELPATH      = $(TOOLSDIR)/tools/relpath
77 SFNT2FNT     = $(TOOLSDIR)/tools/sfnt2fnt
78 FNT2FON      = $(TOOLSDIR)/tools/fnt2fon
79 RC           = $(WRC)
80 RC16         = $(WRC)
81 RCFLAGS      = --nostdinc $(INCLUDES) $(DEFS) $(EXTRARCFLAGS)
82 RC16FLAGS    = -O res16 $(RCFLAGS)
83 LDPATH       = @LDPATH@
84 DLLDIR       = $(TOPOBJDIR)/dlls
85 LIBPORT      = $(TOPOBJDIR)/libs/port/libwine_port.a
86 LIBWPP       = $(TOPOBJDIR)/libs/wpp/libwpp.a
87 LIBWINE      = -L$(TOPOBJDIR)/libs/wine -lwine
88 LDRPATH_INSTALL = @LDRPATH_INSTALL@
89 LDRPATH_LOCAL   = @LDRPATH_LOCAL@
90
91 @SET_MAKE@
92
93 # Installation infos
94
95 INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
96 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
97 INSTALL_SCRIPT  = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS)
98 INSTALL_DATA    = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS)
99 prefix          = @prefix@
100 exec_prefix     = @exec_prefix@
101 bindir          = @bindir@
102 libdir          = @libdir@
103 datarootdir     = @datarootdir@
104 datadir         = @datadir@
105 infodir         = @infodir@
106 mandir          = @mandir@
107 sysconfdir      = @sysconfdir@
108 includedir      = @includedir@/wine
109 dlldir          = @libdir@/wine
110 prog_manext     = 1
111 api_manext      = 3w
112 conf_manext     = 5
113 CLEAN_FILES     = *.o *.a *.so *.ln *.res *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core
114
115 IDL_GEN_C_SRCS  = $(IDL_C_SRCS:.idl=_c.c) $(IDL_I_SRCS:.idl=_i.c) \
116                   $(IDL_P_SRCS:.idl=_p.c) $(IDL_S_SRCS:.idl=_s.c)
117 IDL_GEN_HEADERS = $(IDL_H_SRCS:.idl=.h) $(IDL_C_SRCS:.idl=.h) $(IDL_I_SRCS:.idl=.h) \
118                   $(IDL_P_SRCS:.idl=.h) $(IDL_S_SRCS:.idl=.h)
119
120 CLEAN_TARGETS = $(IDL_GEN_C_SRCS) $(IDL_GEN_HEADERS) $(IDL_TLB_SRCS:.idl=.tlb) $(IDL_P_SRCS:%=dlldata.c) \
121                 $(BISON_SRCS:.y=.tab.c) $(BISON_SRCS:.y=.tab.h) $(LEX_SRCS:.l=.yy.c) $(MC_SRCS:.mc=.mc.rc)
122
123 OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) $(EXTRA_OBJS)
124
125 RCOBJS = $(RC_SRCS:.rc=.res.o)
126 LINTS  = $(C_SRCS:.c=.ln)
127
128 # Implicit rules
129
130 .SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.o .idl .tlb .h .y .l .tab.c .tab.h .yy.c .ok .man.in .man _c.c _i.c _p.c _s.c @MAINTAINER_MODE@ .sfd .ttf .svg .ico
131
132 .c.o:
133         $(CC) -c $(ALLCFLAGS) -o $@ $<
134
135 .s.o:
136         $(AS) -o $@ $<
137
138 .y.tab.c:
139         $(BISON) $(BISONFLAGS) -p $*_ -o $@ $<
140
141 .y.tab.h:
142         $(BISON) $(BISONFLAGS) -p $*_ -o $*.tab.c -d $<
143
144 .l.yy.c:
145         $(FLEX) $(LEXFLAGS) -o$@ $<
146
147 .mc.mc.rc:
148         $(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
149
150 .rc.res:
151         $(LDPATH) $(RC) $(RCFLAGS) -fo$@ $<
152
153 .res.res.o:
154         $(WINDRES) -i $< -o $@
155
156 .spec.spec.o:
157         $(WINEBUILD) $(WINEBUILDFLAGS) --dll -o $@ --main-module $(MODULE) --export $<
158
159 .idl.h:
160         $(WIDL) $(IDLFLAGS) -h -H $@ $<
161
162 .idl_c.c:
163         $(WIDL) $(IDLFLAGS) -c -C $@ $<
164
165 .idl_i.c:
166         $(WIDL) $(IDLFLAGS) -u -U $@ $<
167
168 .idl_p.c:
169         $(WIDL) $(IDLFLAGS) -p -P $@ $<
170
171 .idl_s.c:
172         $(WIDL) $(IDLFLAGS) -s -S $@ $<
173
174 .idl.tlb:
175         $(WIDL) $(IDLFLAGS) -t -T $@ $<
176
177 .c.ln:
178         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
179
180 .c.ok:
181         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
182
183 .sfd.ttf:
184         $(FONTFORGE) -script $(TOPSRCDIR)/fonts/genttf.ff $< $@
185
186 .man.in.man:
187         LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $< >$@ || ($(RM) $@ && false)
188
189 .svg.ico:
190         $(RSVG) -w 16 -h 16 -f png $< $*-16.png
191         $(RSVG) -w 32 -h 32 -f png $< $*-32.png
192         $(RSVG) -w 48 -h 48 -f png $< $*-48.png
193         $(ICOTOOL) -c -o $@ $*-16.png $*-32.png $*-48.png
194         $(RM) $*-16.png $*-32.png $*-48.png
195
196 # 'all' target first in case the enclosing Makefile didn't define any target
197
198 all:
199
200 filter: dummy
201         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
202
203 .PHONY: all filter
204
205 # Rules for IDL files
206
207 dlldata.c: $(WIDL) Makefile.in
208         $(WIDL) $(IDLFLAGS) --dlldata-only --dlldata=$@ $(IDL_P_SRCS)
209
210 # Rules for resources
211
212 $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC) $(IDL_TLB_SRCS:.idl=.tlb)
213
214 # Rule for linting
215
216 $(MODULE).ln : $(LINTS)
217         if test "$(LINTS)" ; \
218         then \
219                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
220                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
221         else \
222                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
223         fi
224
225 lint:: $(MODULE).ln
226
227 # Rules for Windows API checking
228
229 winapi_check:: dummy
230         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
231
232 .PHONY: winapi_check
233
234 # Rules for dependencies
235
236 DEPEND_SRCS = $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) $(IDL_GEN_C_SRCS) $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
237
238 $(SUBDIRS:%=%/__depend__): dummy
239         @cd `dirname $@` && $(MAKE) depend
240
241 depend: $(SUBDIRS:%=%/__depend__) dummy
242         $(MAKEDEP) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(EXTRAINCL) $(DEPEND_SRCS)
243
244 .PHONY: depend $(SUBDIRS:%=%/__depend__)
245
246 # Rules for cleaning
247
248 $(SUBDIRS:%=%/__clean__): dummy
249         @cd `dirname $@` && $(MAKE) clean
250
251 $(EXTRASUBDIRS:%=%/__clean__): dummy
252         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
253
254 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
255         $(RM) $(CLEAN_FILES) $(CLEAN_TARGETS) $(PROGRAMS) $(MANPAGES)
256
257 .PHONY: clean $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
258
259 # Rules for installing
260
261 $(SUBDIRS:%=%/__install__): dummy
262         @cd `dirname $@` && $(MAKE) install
263
264 $(SUBDIRS:%=%/__install-lib__): dummy
265         @cd `dirname $@` && $(MAKE) install-lib
266
267 $(SUBDIRS:%=%/__install-dev__): dummy
268         @cd `dirname $@` && $(MAKE) install-dev
269
270 $(SUBDIRS:%=%/__uninstall__): dummy
271         @cd `dirname $@` && $(MAKE) uninstall
272
273 install:: $(INSTALLSUBDIRS:%=%/__install__)
274
275 uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
276
277 $(INSTALLDIRS):
278         $(MKINSTALLDIRS) $@
279
280 .PHONY: install install-lib install-dev uninstall \
281         $(SUBDIRS:%=%/__install__) $(SUBDIRS:%=%/__uninstall__) \
282         $(SUBDIRS:%=%/__install-lib__) $(SUBDIRS:%=%/__install-dev__)
283
284 # Rules for testing
285
286 $(TESTSUBDIRS:%=%/__test__): dummy
287         @cd `dirname $@` && $(MAKE) test
288
289 $(TESTSUBDIRS:%=%/__crosstest__): dummy
290         @cd `dirname $@` && $(MAKE) crosstest
291
292 $(TESTSUBDIRS:%=%/__testclean__): dummy
293         @cd `dirname $@` && $(MAKE) testclean
294
295 check test:: $(TESTSUBDIRS:%=%/__test__)
296
297 crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
298
299 testclean:: $(TESTSUBDIRS:%=%/__testclean__)
300
301 .PHONY: check test testclean crosstest $(TESTSUBDIRS:%=%/__test__) $(TESTSUBDIRS:%=%/__crosstest__) $(TESTSUBDIRS:%=%/__testclean__) 
302
303 # Rules for auto documentation
304
305 $(DOCSUBDIRS:%=%/__man__): dummy
306         @cd `dirname $@` && $(MAKE) man
307
308 $(DOCSUBDIRS:%=%/__doc_html__): dummy
309         @cd `dirname $@` && $(MAKE) doc-html
310
311 $(DOCSUBDIRS:%=%/__doc_sgml__): dummy
312         @cd `dirname $@` && $(MAKE) doc-sgml
313
314 man: $(DOCSUBDIRS:%=%/__man__)
315 doc-html: $(DOCSUBDIRS:%=%/__doc_html__)
316 doc-sgml: $(DOCSUBDIRS:%=%/__doc_sgml__)
317
318 .PHONY: man doc-html doc-sgml $(DOCSUBDIRS:%=%/__man__) $(DOCSUBDIRS:%=%/__doc_html__) $(DOCSUBDIRS:%=%/__doc_sgml__)
319
320 # Misc. rules
321
322 $(MC_SRCS:.mc=.mc.rc): $(WMC)
323
324 $(IDL_GEN_HEADERS) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb): $(WIDL)
325
326 $(SUBDIRS): dummy
327         @cd $@ && $(MAKE)
328
329 dummy:
330
331 .PHONY: dummy $(SUBDIRS)
332
333 # End of global rules