Added stubs for mapi32, msimg32, sti and url.
[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 # ASM_SRCS     : assembly sources
12 # GEN_C_SRCS   : generated C files
13 # GEN_ASM_SRCS : generated assembly sources
14 # RC_SRCS      : resource source files
15 # SPEC_SRCS    : interface definition files
16 # GLUE         : C sources for which glue code needs to be generated
17 # EXTRA_SRCS   : extra source files for make depend
18 # EXTRA_OBJS   : extra object files
19 # SUBDIRS      : subdirectories that contain a Makefile
20 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
21
22 # First some useful definitions
23
24 SHELL     = /bin/sh
25 CC        = @CC@
26 CPP       = @CPP@
27 CFLAGS    = @CFLAGS@
28 OPTIONS   = @OPTIONS@ -D_REENTRANT
29 X_CFLAGS  = @X_CFLAGS@
30 X_LIBS    = @X_LIBS@
31 XLIB      = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
32 DLL_LINK  = @DLL_LINK@
33 LIBS      = @LIBS@
34 YACC      = @YACC@
35 LEX       = @LEX@
36 LEXLIB    = @LEXLIB@
37 LIBEXT    = @LIBEXT@
38 LDSHARED  = @LDSHARED@
39 DLLWRAP   = @DLLWRAP@
40 DLLWRAPFLAGS = --add-stdcall-alias
41 RANLIB    = @RANLIB@
42 LN_S      = @LN_S@
43 DIVINCL   = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include $(EXTRAINCL)
44 ALLCFLAGS = $(DIVINCL) $(CFLAGS) $(DEFS) $(OPTIONS) $(X_CFLAGS)
45 LDCOMBINE = @LDCOMBINE@
46 LDFLAGS   = @LDFLAGS@
47 AR        = ar rc
48 RM        = rm -f
49 MV        = mv
50 MKDIR     = mkdir -p
51 C2MAN     = @C2MAN@
52 MANSPECS  = -w $(TOPSRCDIR)/dlls/gdi/gdi32.spec \
53             -w $(TOPSRCDIR)/dlls/user/user32.spec \
54             -w $(TOPSRCDIR)/dlls/comctl32/comctl32.spec \
55             -w $(TOPSRCDIR)/dlls/commdlg/comdlg32.spec \
56             -w $(TOPSRCDIR)/dlls/kernel/kernel32.spec 
57 LINT      = @LINT@
58 LINTFLAGS = @LINTFLAGS@
59 ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
60 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
61 WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
62 MAKEDEP   = $(TOPOBJDIR)/tools/makedep
63 WRC       = $(TOPOBJDIR)/tools/wrc/wrc
64 WMC       = $(TOPOBJDIR)/tools/wmc/wmc
65 LDPATH    = @LDPATH@
66 DLLDIR    = $(TOPOBJDIR)/dlls
67 LIBWINE   = -L$(TOPOBJDIR)/library -lwine
68 LIBTSX11  = -L$(TOPOBJDIR)/tsx11 -lwine_tsx11
69 LIBUNICODE= -L$(TOPOBJDIR)/unicode -lwine_unicode
70 LIBUUID   = -L$(TOPOBJDIR)/ole -lwine_uuid
71
72 @SET_MAKE@
73
74 # Installation infos
75
76 INSTALL         = @INSTALL@
77 INSTALL_PROGRAM = @INSTALL_PROGRAM@
78 INSTALL_SCRIPT  = @INSTALL_SCRIPT@
79 INSTALL_DATA    = @INSTALL_DATA@
80 prefix          = @prefix@
81 exec_prefix     = @exec_prefix@
82 bindir          = @bindir@
83 libdir          = @libdir@
84 infodir         = @infodir@
85 mandir          = @mandir@
86 prog_manext     = 1
87 conf_manext     = 5
88 includedir      = @includedir@/wine
89 CLEAN_FILES     = *.o *.a *.so *.ln \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
90                   *.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core
91
92 OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
93        $(ASM_SRCS:.S=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
94
95 LINTS = $(C_SRCS:.c=.ln)
96
97 # DLL list
98
99 X_DLLS = \
100         ddraw \
101         @OPENGL32_DLL@ \
102         @GLU32_DLL@ \
103         x11drv
104
105 DLLS = \
106         @X_DLLS@ \
107         advapi32 \
108         avifil32 \
109         comctl32 \
110         comdlg32 \
111         crtdll \
112         dciman32 \
113         dinput \
114         dplay \
115         dplayx \
116         dsound \
117         gdi32 \
118         icmp \
119         imagehlp \
120         imm32 \
121         joystick.drv \
122         kernel32 \
123         lz32 \
124         mapi32 \
125         mcianim.drv \
126         mciavi.drv \
127         mcicda.drv \
128         mciseq.drv \
129         mciwave.drv \
130         midimap.drv \
131         mpr \
132         msacm.drv \
133         msacm32 \
134         msimg32 \
135         msnet32 \
136         msvcrt \
137         msvfw32 \
138         odbc32 \
139         ole32 \
140         oleaut32 \
141         olecli32 \
142         oledlg \
143         olepro32 \
144         olesvr32 \
145         psapi \
146         quartz \
147         rasapi32 \
148         riched32 \
149         rpcrt4 \
150         serialui \
151         setupapi \
152         shdocvw \
153         shell32 \
154         shfolder \
155         shlwapi \
156         sti \
157         tapi32 \
158         ttydrv \
159         url \
160         urlmon \
161         user32 \
162         version \
163         w32skrnl \
164         winedos \
165         wineoss.drv \
166         wineps \
167         wininet \
168         winmm \
169         winnls32 \
170         winspool.drv \
171         wintrust \
172         wnaspi32 \
173         wow32 \
174         ws2_32 \
175         wsock32
176
177 # Implicit rules
178
179 .SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .glue.c
180
181 .c.o:
182         $(CC) -c $(ALLCFLAGS) -o $*.o $<
183
184 .s.o:
185         $(AS) -o $*.o $<  
186
187 .S.o:
188         $(CC) -c -o $*.o $<  
189
190 .mc.mc.rc:
191         $(LDPATH) $(WMC) -i -H /dev/null -o $@ $<
192
193 .rc.res:
194         $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
195
196 .spec.spec.c:
197         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -spec $<
198
199 .c.glue.c:
200         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
201
202 .c.ln:
203         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
204
205 .PHONY: all install uninstall clean distclean depend dummy
206
207 # 'all' target first in case the enclosing Makefile didn't define any target
208
209 all: Makefile
210
211 filter:
212         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
213
214 # Rule for main module intermediate object
215
216 $(MODULE).tmp.o: $(OBJS) Makefile.in
217         $(LDCOMBINE) $(OBJS) -o $@
218         -strip --strip-unneeded $@
219
220 # Rule for main module spec file
221
222 $(MODULE).spec.c: $(MODULE).spec $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
223         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec
224
225 # Rule to rebuild the resource compiler
226
227 $(WRC):
228         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc
229
230 # Rule to rebuild the message compiler
231
232 $(WMC):
233         cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc
234
235 # Rule to rebuild the 'makedep' program
236
237 $(MAKEDEP):
238         cd $(TOPOBJDIR)/tools && $(MAKE) makedep
239
240 # Rule to rebuild the 'winebuild' program
241
242 $(WINEBUILD):
243         cd $(TOPOBJDIR)/tools/winebuild && $(MAKE) winebuild
244
245 # Rules for makefile
246
247 Makefile: Makefile.in $(TOPSRCDIR)/configure
248         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
249         @exit 1
250
251 # Rules for auto documentation
252
253 $(SUBDIRS:%=%/__man__): dummy
254         cd `dirname $@` && $(MAKE) man
255
256 man: $(C_SRCS) $(SUBDIRS:%=%/__man__)
257         if [ -n "$(C_SRCS)" ]; then $(MKDIR) $(TOPOBJDIR)/documentation/man3w; for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done; fi
258
259 $(SUBDIRS:%=%/__doc_html__): dummy
260         cd `dirname $@` && $(MAKE) doc-html
261
262 doc-html: $(C_SRCS) $(SUBDIRS:%=%/__doc_html__)
263         if [ -n "$(C_SRCS)" ]; then $(MKDIR) $(TOPOBJDIR)/documentation/html; for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done; fi
264
265 # Rule for linting
266
267 $(MODULE).ln : $(LINTS)
268         if test "$(LINTS)" ; \
269         then \
270                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
271                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
272         else \
273                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
274         fi
275
276 lint:: $(MODULE).ln
277
278 # Rules for Windows API checking
279
280 winapi_check::
281         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
282
283 # Rules for dependencies
284
285 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
286         cd `dirname $@` && $(MAKE) depend
287
288 depend: $(MAKEDEP) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
289         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
290
291 # Rules for cleaning
292
293 $(SUBDIRS:%=%/__clean__): dummy
294         cd `dirname $@` && $(MAKE) clean
295
296 $(EXTRASUBDIRS:%=%/__clean__): dummy
297         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
298
299 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
300         $(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
301
302 # Rules for installing
303
304 $(SUBDIRS:%=%/__install__): dummy
305         cd `dirname $@` && $(MAKE) install
306
307 $(SUBDIRS:%=%/__uninstall__): dummy
308         cd `dirname $@` && $(MAKE) uninstall
309
310 # Misc. rules
311
312 $(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
313
314 $(GLUE:.c=.glue.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
315
316 $(RC_SRCS:.rc=.res): $(WRC)
317
318 $(RC_SRCS16:.rc=.res): $(WRC)
319
320 $(MC_SRCS:.mc=.mc.rc): $(WMC)
321
322 $(SUBDIRS): dummy
323         @cd $@ && $(MAKE)
324
325 dummy:
326
327 # End of global rules