Get rid of wrong/confusing _strdupnA usage.
[wine/multimedia.git] / Make.rules.in
blob351f11e2e950b5252c337d0a575523b31f77c47f
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 # 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
21 # First some useful definitions
23 SHELL     = /bin/sh
24 CC        = @CC@
25 CPP       = @CPP@
26 CFLAGS    = @CFLAGS@
27 CPPFLAGS  = @CPPFLAGS@
28 LIBS      = @LIBS@
29 YACC      = @YACC@
30 LEX       = @LEX@
31 LEXLIB    = @LEXLIB@
32 EXEEXT    = @EXEEXT@
33 OBJEXT    = @OBJEXT@
34 LIBEXT    = @LIBEXT@
35 DLLEXT    = @DLLEXT@
36 IMPLIBEXT = @IMPLIBEXT@
37 LDSHARED  = @LDSHARED@
38 DLLTOOL   = @DLLTOOL@
39 DLLWRAP   = @DLLWRAP@
40 AR        = @AR@ rc
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 LDCOMBINE = $(LD) -r
51 RM        = rm -f
52 MV        = mv
53 LINT      = @LINT@
54 LINTFLAGS = @LINTFLAGS@
55 INCLUDES     = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
56 EXTRACFLAGS  = @EXTRACFLAGS@
57 ALLCFLAGS    = $(INCLUDES) $(DEFS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS)
58 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
59 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
60 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
61 WINEWRAPPER  = $(TOPSRCDIR)/tools/winewrapper
62 C2MAN        = $(TOPSRCDIR)/tools/c2man.pl
63 RUNTEST      = $(TOPSRCDIR)/tools/runtest
64 WINEBUILD    = $(TOOLSDIR)/tools/winebuild/winebuild
65 MAKEDEP      = $(TOOLSDIR)/tools/makedep
66 WRC          = $(TOOLSDIR)/tools/wrc/wrc
67 WMC          = $(TOOLSDIR)/tools/wmc/wmc
68 WIDL         = $(TOOLSDIR)/tools/widl/widl
69 RC           = $(WRC)
70 RC16         = $(WRC)
71 RCFLAGS      = --nostdinc $(INCLUDES) $(EXTRARCFLAGS)
72 RC16FLAGS    = -O res16 $(RCFLAGS)
73 LDPATH       = @LDPATH@
74 DLLDIR       = $(TOPOBJDIR)/dlls
75 LIBDIR       = $(TOPOBJDIR)/libs
76 LIBPORT      = -L$(TOPOBJDIR)/libs/port -lwine_port
77 LIBUNICODE   = -L$(TOPOBJDIR)/libs/unicode -lwine_unicode
78 LIBUUID      = -L$(TOPOBJDIR)/libs/uuid -lwine_uuid
79 LIBWINE      = -L$(TOPOBJDIR)/libs/wine -lwine
81 @SET_MAKE@
83 # Installation infos
85 INSTALL         = @INSTALL@ $(INSTALL_FLAGS)
86 INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(INSTALL_PROGRAM_FLAGS)
87 INSTALL_SCRIPT  = @INSTALL_SCRIPT@ $(INSTALL_SCRIPT_FLAGS)
88 INSTALL_DATA    = @INSTALL_DATA@ $(INSTALL_DATA_FLAGS)
89 prefix          = @prefix@
90 exec_prefix     = @exec_prefix@
91 bindir          = @bindir@
92 libdir          = @libdir@
93 datadir         = @datadir@
94 infodir         = @infodir@
95 mandir          = @mandir@
96 sysconfdir      = @sysconfdir@
97 includedir      = @includedir@/wine
98 dlldir          = @libdir@/wine
99 prog_manext     = 1
100 api_manext      = 3w
101 conf_manext     = 5
102 CLEAN_FILES     = *.o *.a *.so *.ln *.$(LIBEXT) \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
103                   *.flc *.spec.c *.spec.def *.glue.c *.dbg.c y.tab.c y.tab.h @LEX_OUTPUT_ROOT@.c core
105 OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS)
107 RCOBJS = $(RC_SRCS:.rc=.res.o)
108 LINTS  = $(C_SRCS:.c=.ln)
110 # Implicit rules
112 .SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .ok
114 .c.o:
115         $(CC) -c $(ALLCFLAGS) -o $@ $<
117 .s.o:
118         $(AS) -o $@ $<
120 .mc.mc.rc:
121         $(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
123 .rc.res:
124         $(LDPATH) $(RC) $(RCFLAGS) -fo$@ $<
126 .res.res.o:
127         $(WINDRES) -i $< -o $@
129 .spec.spec.c:
130         $(WINEBUILD) $(DEFS) -o $@ --main-module $(MODULE) --spec $<
132 .spec.spec.def:
133         $(WINEBUILD) $(DEFS) -o $@ --def $<
135 .c.ln:
136         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
138 .c.ok:
139         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
141 # 'all' target first in case the enclosing Makefile didn't define any target
143 all: Makefile
145 filter:
146         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
148 .PHONY: all filter
150 # Rule for main module debug channels
152 $(MODULE).dbg.c: $(C_SRCS) $(C_SRCS16) $(WINEBUILD)
153         $(WINEBUILD) $(DEFS) -o $@ --debug -C$(SRCDIR) $(C_SRCS) $(C_SRCS16)
155 # Rule to rebuild the tools
157 $(MAKEDEP):
158         cd $(TOOLSDIR)/tools && $(MAKE) `basename $@`
160 # Rules for makefile
162 Makefile: Makefile.in $(TOPSRCDIR)/configure
163         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
164         @exit 1
166 # Rule for linting
168 $(MODULE).ln : $(LINTS)
169         if test "$(LINTS)" ; \
170         then \
171                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
172                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
173         else \
174                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
175         fi
177 lint:: $(MODULE).ln
179 # Rules for Windows API checking
181 winapi_check:: dummy
182         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
184 .PHONY: winapi_check
186 # Rules for dependencies
188 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
189         cd `dirname $@` && $(MAKE) depend
191 depend: $(MAKEDEP) $(SUBDIRS:%=%/__depend__)
192         $(MAKEDEP) $(INCLUDES) -C$(SRCDIR) $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(EXTRA_SRCS)
194 .PHONY: depend $(SUBDIRS:%=%/__depend__)
196 # Rules for cleaning
198 $(SUBDIRS:%=%/__clean__): dummy
199         cd `dirname $@` && $(MAKE) clean
201 $(SUBDIRS:%=%/__testclean__): dummy
202         cd `dirname $@` && $(MAKE) testclean
204 $(EXTRASUBDIRS:%=%/__clean__): dummy
205         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
207 testclean:: $(SUBDIRS:%=%/__testclean__)
209 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
210         $(RM) $(CLEAN_FILES) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
212 .PHONY: clean testclean $(SUBDIRS:%=%/__clean__) $(SUBDIRS:%=%/__testclean__) $(EXTRASUBDIRS:%=%/__clean__)
214 # Rules for installing
216 $(SUBDIRS:%=%/__install__): dummy
217         cd `dirname $@` && $(MAKE) install
219 $(SUBDIRS:%=%/__install-lib__): dummy
220         cd `dirname $@` && $(MAKE) install-lib
222 $(SUBDIRS:%=%/__install-dev__): dummy
223         cd `dirname $@` && $(MAKE) install-dev
225 $(SUBDIRS:%=%/__uninstall__): dummy
226         cd `dirname $@` && $(MAKE) uninstall
228 install:: $(INSTALLSUBDIRS:%=%/__install__)
230 uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
232 .PHONY: install install-lib install-dev uninstall \
233         $(SUBDIRS:%=%/__install__) $(SUBDIRS:%=%/__uninstall__) \
234         $(SUBDIRS:%=%/__install-lib__) $(SUBDIRS:%=%/__install-dev__)
236 # Rules for checking that no imports are missing
238 $(SUBDIRS:%=%/__checklink__): dummy
239         @cd `dirname $@` && $(MAKE) checklink
241 .PHONY: checklink $(SUBDIRS:%=%/__checklink__)
243 # Rules for testing
245 $(SUBDIRS:%=%/__test__): dummy
246         @cd `dirname $@` && $(MAKE) test
248 $(SUBDIRS:%=%/__crosstest__): dummy
249         @cd `dirname $@` && $(MAKE) crosstest
251 .PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
253 # Misc. rules
255 $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC)
257 $(MC_SRCS:.mc=.mc.rc): $(WMC)
259 $(IDL_SRCS:.idl=.h): $(WIDL)
261 $(SUBDIRS): dummy
262         @cd $@ && $(MAKE)
264 dummy:
266 .PHONY: dummy $(SUBDIRS)
268 # End of global rules