Added d3d9 dll.
[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
21 # First some useful definitions
22
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 C2MAN     = @C2MAN@
54 LINT      = @LINT@
55 LINTFLAGS = @LINTFLAGS@
56 INCLUDES     = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
57 EXTRACFLAGS  = @EXTRACFLAGS@
58 ALLCFLAGS    = $(INCLUDES) $(DEFS) $(EXTRACFLAGS) $(CPPFLAGS) $(CFLAGS)
59 ALLLINTFLAGS = $(INCLUDES) $(DEFS) $(LINTFLAGS)
60 MKINSTALLDIRS= $(TOPSRCDIR)/tools/mkinstalldirs -m 755
61 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
62 WINEWRAPPER  = $(TOPSRCDIR)/tools/winewrapper
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
80
81 @SET_MAKE@
82
83 # Installation infos
84
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
104
105 OBJS = $(C_SRCS:.c=.o) $(EXTRA_OBJS)
106
107 RCOBJS = $(RC_SRCS:.rc=.res.o)
108 LINTS  = $(C_SRCS:.c=.ln)
109
110 # Implicit rules
111
112 .SUFFIXES: .mc .rc .mc.rc .res .res.o .spec .spec.c .spec.def .ok
113
114 .c.o:
115         $(CC) -c $(ALLCFLAGS) -o $@ $<
116
117 .s.o:
118         $(AS) -o $@ $<
119
120 .mc.mc.rc:
121         $(LDPATH) $(WMC) -i -U -H /dev/null -o $@ $<
122
123 .rc.res:
124         $(LDPATH) $(RC) $(RCFLAGS) -fo$@ $<
125
126 .res.res.o:
127         $(WINDRES) -i $< -o $@
128
129 .spec.spec.c:
130         $(WINEBUILD) $(DEFS) -o $@ --main-module $(MODULE) --spec $<
131
132 .spec.spec.def:
133         $(WINEBUILD) $(DEFS) -o $@ --def $<
134
135 .c.ln:
136         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
137
138 .c.ok:
139         $(RUNTEST) $(RUNTESTFLAGS) $< && touch $@
140
141 # 'all' target first in case the enclosing Makefile didn't define any target
142
143 all: Makefile
144
145 filter:
146         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
147
148 .PHONY: all filter
149
150 # Rule for main module debug channels
151
152 $(MODULE).dbg.c: $(C_SRCS) $(C_SRCS16) $(WINEBUILD)
153         $(WINEBUILD) $(DEFS) -o $@ --debug -C$(SRCDIR) $(C_SRCS) $(C_SRCS16)
154
155 # Rule to rebuild the tools
156
157 $(MAKEDEP):
158         cd $(TOOLSDIR)/tools && $(MAKE) `basename $@`
159
160 # Rules for makefile
161
162 Makefile: Makefile.in $(TOPSRCDIR)/configure
163         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
164         @exit 1
165
166 # Rule for linting
167
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
176
177 lint:: $(MODULE).ln
178
179 # Rules for Windows API checking
180
181 winapi_check:: dummy
182         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
183
184 .PHONY: winapi_check
185
186 # Rules for dependencies
187
188 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
189         cd `dirname $@` && $(MAKE) depend
190
191 depend: $(MAKEDEP) $(SUBDIRS:%=%/__depend__)
192         $(MAKEDEP) $(INCLUDES) -C$(SRCDIR) $(C_SRCS) $(C_SRCS16) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(IDL_SRCS) $(EXTRA_SRCS)
193
194 .PHONY: depend $(SUBDIRS:%=%/__depend__)
195
196 # Rules for cleaning
197
198 $(SUBDIRS:%=%/__clean__): dummy
199         cd `dirname $@` && $(MAKE) clean
200
201 $(SUBDIRS:%=%/__testclean__): dummy
202         cd `dirname $@` && $(MAKE) testclean
203
204 $(EXTRASUBDIRS:%=%/__clean__): dummy
205         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
206
207 testclean:: $(SUBDIRS:%=%/__testclean__)
208
209 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
210         $(RM) $(CLEAN_FILES) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
211
212 .PHONY: clean testclean $(SUBDIRS:%=%/__clean__) $(SUBDIRS:%=%/__testclean__) $(EXTRASUBDIRS:%=%/__clean__)
213
214 # Rules for installing
215
216 $(SUBDIRS:%=%/__install__): dummy
217         cd `dirname $@` && $(MAKE) install
218
219 $(SUBDIRS:%=%/__install-lib__): dummy
220         cd `dirname $@` && $(MAKE) install-lib
221
222 $(SUBDIRS:%=%/__install-dev__): dummy
223         cd `dirname $@` && $(MAKE) install-dev
224
225 $(SUBDIRS:%=%/__uninstall__): dummy
226         cd `dirname $@` && $(MAKE) uninstall
227
228 install:: $(INSTALLSUBDIRS:%=%/__install__)
229
230 uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
231
232 .PHONY: install install-lib install-dev uninstall \
233         $(SUBDIRS:%=%/__install__) $(SUBDIRS:%=%/__uninstall__) \
234         $(SUBDIRS:%=%/__install-lib__) $(SUBDIRS:%=%/__install-dev__)
235
236 # Rules for checking that no imports are missing
237
238 $(SUBDIRS:%=%/__checklink__): dummy
239         @cd `dirname $@` && $(MAKE) checklink
240
241 .PHONY: checklink $(SUBDIRS:%=%/__checklink__)
242
243 # Rules for testing
244
245 $(SUBDIRS:%=%/__test__): dummy
246         @cd `dirname $@` && $(MAKE) test
247
248 $(SUBDIRS:%=%/__crosstest__): dummy
249         @cd `dirname $@` && $(MAKE) crosstest
250
251 .PHONY: check test crosstest $(SUBDIRS:%=%/__test__) $(SUBDIRS:%=%/__crosstest__)
252
253 # Misc. rules
254
255 $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res): $(WRC)
256
257 $(MC_SRCS:.mc=.mc.rc): $(WMC)
258
259 $(IDL_SRCS:.idl=.h): $(WIDL)
260
261 $(SUBDIRS): dummy
262         @cd $@ && $(MAKE)
263
264 dummy:
265
266 .PHONY: dummy $(SUBDIRS)
267
268 # End of global rules