Moved undocshell.h to dlls/shell32. Removed shell16.h.
[wine/multimedia.git] / Make.rules.in
bloba168fc4f7f50c2cb25ff00b2f9d714136aab11b4
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 # 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
22 # First some useful definitions
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
72 @SET_MAKE@
74 # Installation infos
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
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)
95 LINTS = $(C_SRCS:.c=.ln)
97 # DLL list
99 X_DLLS = \
100         ddraw \
101         @OPENGL32_DLL@ \
102         @GLU32_DLL@ \
103         x11drv
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         mcianim.drv \
125         mciavi.drv \
126         mcicda.drv \
127         mciseq.drv \
128         mciwave.drv \
129         midimap.drv \
130         mpr \
131         msacm.drv \
132         msacm32 \
133         msnet32 \
134         msvcrt \
135         msvfw32 \
136         odbc32 \
137         ole32 \
138         oleaut32 \
139         olecli32 \
140         oledlg \
141         olepro32 \
142         olesvr32 \
143         psapi \
144         quartz \
145         rasapi32 \
146         riched32 \
147         rpcrt4 \
148         serialui \
149         setupapi \
150         shdocvw \
151         shell32 \
152         shfolder \
153         shlwapi \
154         tapi32 \
155         ttydrv \
156         urlmon \
157         user32 \
158         version \
159         w32skrnl \
160         winedos \
161         wineoss.drv \
162         wineps \
163         wininet \
164         winmm \
165         winnls32 \
166         winspool.drv \
167         wintrust \
168         wnaspi32 \
169         wow32 \
170         ws2_32 \
171         wsock32
173 # Implicit rules
175 .SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .glue.c
177 .c.o:
178         $(CC) -c $(ALLCFLAGS) -o $*.o $<
180 .s.o:
181         $(AS) -o $*.o $<  
183 .S.o:
184         $(CC) -c -o $*.o $<  
186 .mc.mc.rc:
187         $(LDPATH) $(WMC) -i -H /dev/null -o $@ $<
189 .rc.res:
190         $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
192 .spec.spec.c:
193         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -spec $<
195 .c.glue.c:
196         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
198 .c.ln:
199         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
201 .PHONY: all install uninstall clean distclean depend dummy
203 # 'all' target first in case the enclosing Makefile didn't define any target
205 all: Makefile
207 filter:
208         @$(TOPSRCDIR)/tools/winapi/make_filter --make $(MAKE) all
210 # Rule for main module intermediate object
212 $(MODULE).tmp.o: $(OBJS) Makefile.in
213         $(LDCOMBINE) $(OBJS) -o $@
214         -strip --strip-unneeded $@
216 # Rule for main module spec file
218 $(MODULE).spec.c: $(MODULE).spec $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
219         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec
221 # Rule to rebuild the resource compiler
223 $(WRC):
224         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc
226 # Rule to rebuild the message compiler
228 $(WMC):
229         cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc
231 # Rule to rebuild the 'makedep' program
233 $(MAKEDEP):
234         cd $(TOPOBJDIR)/tools && $(MAKE) makedep
236 # Rule to rebuild the 'winebuild' program
238 $(WINEBUILD):
239         cd $(TOPOBJDIR)/tools/winebuild && $(MAKE) winebuild
241 # Rules for makefile
243 Makefile: Makefile.in $(TOPSRCDIR)/configure
244         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
245         @exit 1
247 # Rules for auto documentation
249 man: $(C_SRCS)
250         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
252 doc-html: $(C_SRCS)
253         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
255 # Rule for linting
257 $(MODULE).ln : $(LINTS)
258         if test "$(LINTS)" ; \
259         then \
260                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
261                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
262         else \
263                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
264         fi
266 lint:: $(MODULE).ln
268 # Rules for Windows API checking
270 winapi_check::
271         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
273 # Rules for dependencies
275 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
276         cd `dirname $@` && $(MAKE) depend
278 depend: $(MAKEDEP) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
279         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
281 # Rules for cleaning
283 $(SUBDIRS:%=%/__clean__): dummy
284         cd `dirname $@` && $(MAKE) clean
286 $(EXTRASUBDIRS:%=%/__clean__): dummy
287         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
289 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
290         $(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
292 # Rules for installing
294 $(SUBDIRS:%=%/__install__): dummy
295         cd `dirname $@` && $(MAKE) install
297 $(SUBDIRS:%=%/__uninstall__): dummy
298         cd `dirname $@` && $(MAKE) uninstall
300 # Misc. rules
302 $(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
304 $(GLUE:.c=.glue.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
306 $(RC_SRCS:.rc=.res): $(WRC)
308 $(RC_SRCS16:.rc=.res): $(WRC)
310 $(MC_SRCS:.mc=.mc.rc): $(WMC)
312 $(SUBDIRS): dummy
313         @cd $@ && $(MAKE)
315 dummy:
317 # End of global rules