gdi32: Do not load 16-bit gdi.exe by default.
[wine/multimedia.git] / Make.rules.in
blob6a52a011f286816c6ce195f99d68f690c1bd5d18
1 # Global rules shared by all makefiles     -*-Makefile-*-
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
9 # Each individual makefile may define the following additional variables:
10 # C_SRCS       : C sources for the module
11 # RC_SRCS      : resource source files
12 # EXTRA_SRCS   : extra source files for make depend
13 # EXTRA_OBJS   : extra object files
14 # IMPORTS      : dlls to import
15 # DELAYIMPORTS : dlls to import in delayed mode
16 # SUBDIRS      : subdirectories that contain a Makefile
17 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
18 # INSTALLSUBDIRS : subdirectories to run make install/uninstall into
19 # MODCFLAGS    : extra CFLAGS for this module
21 # First some useful definitions
23 SHELL     = /bin/sh
24 CC        = @CC@
25 CFLAGS    = @CFLAGS@
26 CPPFLAGS  = @CPPFLAGS@
27 LIBS      = @LIBS@
28 BISON     = @BISON@
29 FLEX      = @FLEX@
30 EXEEXT    = @EXEEXT@
31 OBJEXT    = @OBJEXT@
32 LIBEXT    = @LIBEXT@
33 DLLEXT    = @DLLEXT@
34 TOOLSEXT  = @TOOLSEXT@
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 LN_S      = @LN_S@
44 TOOLSDIR  = @TOOLSDIR@
45 LDFLAGS   = @LDFLAGS@
46 PRELINK   = @PRELINK@
47 RM        = rm -f
48 MV        = mv
49 LINT      = @LINT@
50 LINTFLAGS = @LINTFLAGS@
51 FONTFORGE = @FONTFORGE@
52 RSVG      = @RSVG@
53 ICOTOOL   = @ICOTOOL@
54 CROSSCC   = @CROSSCC@
55 CROSSTARGET = @CROSSTARGET@
56 CROSSAR     = $(CROSSTARGET)-ar
57 CROSSRANLIB = $(CROSSTARGET)-ranlib
58 FAKEEXT   = $(DLLEXT:.so=.fake)
59 INCLUDES     = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
60 EXTRACFLAGS  = @EXTRACFLAGS@
61 ALLCFLAGS    = $(INCLUDES) $(DEFS) $(DLLFLAGS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS) $(MODCFLAGS)
62 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
63 IDLFLAGS     = $(INCLUDES) $(DEFS) $(EXTRAIDLFLAGS)
64 TARGETFLAGS  = @TARGETFLAGS@
65 WINEBUILDFLAGS = $(TARGETFLAGS) $(DLLFLAGS)
66 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
67 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi/winapi_check
68 C2MAN        = $(TOPSRCDIR)/tools/c2man.pl
69 RUNTEST      = $(TOPSRCDIR)/tools/runtest
70 WINEBUILD    = $(TOOLSDIR)/tools/winebuild/winebuild$(TOOLSEXT)
71 MAKEDEP      = $(TOOLSDIR)/tools/makedep$(TOOLSEXT)
72 MAKECTESTS   = $(TOOLSDIR)/tools/make_ctests$(TOOLSEXT)
73 WRC          = $(TOOLSDIR)/tools/wrc/wrc$(TOOLSEXT)
74 WMC          = $(TOOLSDIR)/tools/wmc/wmc$(TOOLSEXT)
75 WIDL         = $(TOOLSDIR)/tools/widl/widl$(TOOLSEXT)
76 WINEGCC      = $(TOOLSDIR)/tools/winegcc/winegcc $(TARGETFLAGS) -B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR)
77 CROSSWINEGCC = $(TOOLSDIR)/tools/winegcc/winegcc $(CROSSTARGET:%=-b %) -B$(TOOLSDIR)/tools/winebuild --sysroot=$(TOPOBJDIR) --lib-suffix=.cross.a
78 RELPATH      = $(TOOLSDIR)/tools/relpath$(TOOLSEXT)
79 SFNT2FNT     = $(TOOLSDIR)/tools/sfnt2fnt$(TOOLSEXT)
80 RC           = $(WRC)
81 RCFLAGS      = --nostdinc $(INCLUDES) $(DEFS) $(EXTRARCFLAGS)
82 LDPATH       = @LDPATH@
83 DLLDIR       = $(TOPOBJDIR)/dlls
84 LIBPORT      = $(TOPOBJDIR)/libs/port/libwine_port.a
85 LIBWPP       = $(TOPOBJDIR)/libs/wpp/libwpp.a
86 LIBWINE      = -L$(TOPOBJDIR)/libs/wine -lwine
87 LDRPATH_INSTALL = @LDRPATH_INSTALL@
88 LDRPATH_LOCAL   = @LDRPATH_LOCAL@
90 @SET_MAKE@
92 # Installation infos
94 INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
95 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
96 INSTALL_SCRIPT  = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS)
97 INSTALL_DATA    = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS)
98 prefix          = @prefix@
99 exec_prefix     = @exec_prefix@
100 bindir          = @bindir@
101 libdir          = @libdir@
102 datarootdir     = @datarootdir@
103 datadir         = @datadir@
104 infodir         = @infodir@
105 mandir          = @mandir@
106 sysconfdir      = @sysconfdir@
107 includedir      = @includedir@/wine
108 dlldir          = @libdir@/wine
109 fakedlldir      = $(dlldir)/fakedlls
110 prog_manext     = 1
111 api_manext      = 3w
112 conf_manext     = 5
113 CLEAN_FILES     = *.o *.a *.so *.ln *.res *.fake *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej *.flc core
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)
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)
123 OBJS = $(C_SRCS:.c=.o) $(BISON_SRCS:.y=.tab.o) $(LEX_SRCS:.l=.yy.o) $(IDL_GEN_C_SRCS:.c=.o) \
124        $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.mc.res) $(EXTRA_OBJS)
126 CROSSOBJS = $(OBJS:.o=.cross.o)
127 LINTS  = $(C_SRCS:.c=.ln)
129 # 'all' target first in case the enclosing Makefile didn't define any target
131 all:
133 filter: dummy
134         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
136 .PHONY: all filter
138 # Implicit rules
140 .SUFFIXES: .mc .rc .mc.rc .res .idl .tlb .h .y .l .tab.c .tab.h .yy.c .ok .man.in .man _c.c _i.c _p.c _s.c .cross.o @MAINTAINER_MODE@ .sfd .ttf .svg .ico
142 .c.o:
143         $(CC) -c $(ALLCFLAGS) -o $@ $<
145 .c.cross.o:
146         $(CROSSCC) -c $(INCLUDES) $(DEFS) $(CPPFLAGS) $(CFLAGS) -o $@ $<
148 .y.tab.c:
149         $(BISON) $(BISONFLAGS) -p $*_ -o $@ $<
151 .y.tab.h:
152         $(BISON) $(BISONFLAGS) -p $*_ -o $*.tab.c -d $<
154 .l.yy.c:
155         $(FLEX) $(LEXFLAGS) -o$@ $<
157 .mc.mc.rc:
158         $(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
160 .rc.res:
161         $(LDPATH) $(RC) $(RCFLAGS) -fo$@ $<
163 .idl.h:
164         $(WIDL) $(IDLFLAGS) -h -H $@ $<
166 .idl_c.c:
167         $(WIDL) $(IDLFLAGS) -c -C $@ $<
169 .idl_i.c:
170         $(WIDL) $(IDLFLAGS) -u -U $@ $<
172 .idl_p.c:
173         $(WIDL) $(IDLFLAGS) -p -P $@ $<
175 .idl_s.c:
176         $(WIDL) $(IDLFLAGS) -s -S $@ $<
178 .idl.tlb:
179         $(WIDL) $(TARGETFLAGS) $(IDLFLAGS) -t -T $@ $<
181 .c.ln:
182         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
184 .c.ok:
185         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
187 .sfd.ttf:
188         $(FONTFORGE) -script $(TOPSRCDIR)/fonts/genttf.ff $< $@
190 .man.in.man:
191         LC_ALL=C sed -e 's,@bindir\@,$(bindir),g' -e 's,@dlldir\@,$(dlldir),g' -e 's,@PACKAGE_STRING\@,@PACKAGE_STRING@,g' $< >$@ || ($(RM) $@ && false)
193 .svg.ico:
194         $(RSVG) -w 16 -h 16 -f png $< $*-16.png
195         $(RSVG) -w 32 -h 32 -f png $< $*-32.png
196         $(RSVG) -w 48 -h 48 -f png $< $*-48.png
197         $(ICOTOOL) -c -o $@ $*-16.png $*-32.png $*-48.png
198         $(RM) $*-16.png $*-32.png $*-48.png
200 # Rules for IDL files
202 dlldata.c: $(WIDL) Makefile.in
203         $(WIDL) $(IDLFLAGS) --dlldata-only --dlldata=$@ $(IDL_P_SRCS)
205 # Rule for linting
207 $(MODULE).ln : $(LINTS)
208         if test "$(LINTS)" ; \
209         then \
210                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
211                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
212         else \
213                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
214         fi
216 lint:: $(MODULE).ln
218 # Rules for Windows API checking
220 winapi_check:: dummy
221         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
223 .PHONY: winapi_check
225 # Rules for dependencies
227 DEPEND_SRCS = $(C_SRCS) $(RC_SRCS) $(MC_SRCS) \
228               $(IDL_H_SRCS) $(IDL_C_SRCS) $(IDL_I_SRCS) $(IDL_P_SRCS) $(IDL_S_SRCS) \
229               $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS) $(IDL_TLB_SRCS:.idl=.tlb) \
230               $(BISON_SRCS) $(LEX_SRCS) $(EXTRA_SRCS)
232 $(SUBDIRS:%=%/__depend__): dummy
233         @cd `dirname $@` && $(MAKE) depend
235 depend: $(SUBDIRS:%=%/__depend__) dummy
236         $(MAKEDEP) $(MAKEDEPFLAGS) -C$(SRCDIR) -S$(TOPSRCDIR) -T$(TOPOBJDIR) $(EXTRAINCL) $(DEPEND_SRCS)
238 .PHONY: depend $(SUBDIRS:%=%/__depend__)
240 # Rules for cleaning
242 $(SUBDIRS:%=%/__clean__): dummy
243         @cd `dirname $@` && $(MAKE) clean
245 $(EXTRASUBDIRS:%=%/__clean__): dummy
246         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
248 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
249         $(RM) $(CLEAN_FILES) $(CLEAN_TARGETS) $(PROGRAMS) $(MANPAGES)
251 .PHONY: clean $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
253 # Rules for installing
255 $(SUBDIRS:%=%/__install__): dummy
256         @cd `dirname $@` && $(MAKE) install
258 $(SUBDIRS:%=%/__install-lib__): dummy
259         @cd `dirname $@` && $(MAKE) install-lib
261 $(SUBDIRS:%=%/__install-dev__): dummy
262         @cd `dirname $@` && $(MAKE) install-dev
264 $(SUBDIRS:%=%/__uninstall__): dummy
265         @cd `dirname $@` && $(MAKE) uninstall
267 install:: $(INSTALLSUBDIRS:%=%/__install__) dummy
268 install-lib:: $(INSTALLSUBDIRS:%=%/__install-lib__) dummy
269 install-dev:: $(INSTALLSUBDIRS:%=%/__install-dev__) dummy
270 uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__) dummy
272 $(INSTALLDIRS):
273         $(MKINSTALLDIRS) $@
275 .PHONY: install install-lib install-dev uninstall \
276         $(SUBDIRS:%=%/__install__) $(SUBDIRS:%=%/__uninstall__) \
277         $(SUBDIRS:%=%/__install-lib__) $(SUBDIRS:%=%/__install-dev__)
279 # Rules for testing
281 $(TESTSUBDIRS:%=%/__test__): dummy
282         @cd `dirname $@` && $(MAKE) test
284 $(TESTSUBDIRS:%=%/__crosstest__): dummy
285         @cd `dirname $@` && $(MAKE) crosstest
287 $(TESTSUBDIRS:%=%/__testclean__): dummy
288         @cd `dirname $@` && $(MAKE) testclean
290 check test:: $(TESTSUBDIRS:%=%/__test__) dummy
292 crosstest:: $(TESTSUBDIRS:%=%/__crosstest__) dummy
294 testclean:: $(TESTSUBDIRS:%=%/__testclean__) dummy
296 .PHONY: check test testclean crosstest $(TESTSUBDIRS:%=%/__test__) $(TESTSUBDIRS:%=%/__crosstest__) $(TESTSUBDIRS:%=%/__testclean__) 
298 # Rules for auto documentation
300 $(DOCSUBDIRS:%=%/__man__): dummy
301         @cd `dirname $@` && $(MAKE) man
303 $(DOCSUBDIRS:%=%/__doc_html__): dummy
304         @cd `dirname $@` && $(MAKE) doc-html
306 $(DOCSUBDIRS:%=%/__doc_sgml__): dummy
307         @cd `dirname $@` && $(MAKE) doc-sgml
309 $(DOCSUBDIRS:%=%/__doc_xml__): dummy
310         @cd `dirname $@` && $(MAKE) doc-xml
312 man: $(DOCSUBDIRS:%=%/__man__)
313 doc-html: $(DOCSUBDIRS:%=%/__doc_html__)
314 doc-sgml: $(DOCSUBDIRS:%=%/__doc_sgml__)
315 doc-xml: $(DOCSUBDIRS:%=%/__doc_xml__)
317 .PHONY: man doc-html doc-sgml doc-xml $(DOCSUBDIRS:%=%/__man__) $(DOCSUBDIRS:%=%/__doc_html__) $(DOCSUBDIRS:%=%/__doc_sgml__) $(DOCSUBDIRS:%=%/__doc_xml__)
319 # Misc. rules
321 $(MC_SRCS:.mc=.mc.rc): $(WMC)
323 $(IDL_GEN_HEADERS) $(IDL_GEN_C_SRCS) $(IDL_TLB_SRCS:.idl=.tlb): $(WIDL)
325 $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.mc.res): $(WRC)
327 $(SUBDIRS): dummy
328         @cd $@ && $(MAKE)
330 dummy:
332 .PHONY: dummy $(SUBDIRS)
334 # End of global rules