Unified 16-bit and 32-bit scheduling a bit more.
[wine/multimedia.git] / Make.rules.in
blob9e71ac3ccc77aac595f2bef102df513ee9807106
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/comdlg32/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         x11drv
104 DLLS = \
105         @X_DLLS@ \
106         advapi32 \
107         avifil32 \
108         comctl32 \
109         comdlg32 \
110         crtdll \
111         dciman32 \
112         dinput \
113         dplay \
114         dplayx \
115         dsound \
116         gdi32 \
117         icmp \
118         imagehlp \
119         imm32 \
120         joystick.drv \
121         kernel32 \
122         lz32 \
123         mcianim.drv \
124         mciavi.drv \
125         mcicda.drv \
126         mciseq.drv \
127         mciwave.drv \
128         midimap.drv \
129         mpr \
130         msacm.drv \
131         msacm32 \
132         msnet32 \
133         msvcrt \
134         msvfw32 \
135         odbc32 \
136         ole32 \
137         oleaut32 \
138         olecli32 \
139         oledlg \
140         olepro32 \
141         olesvr32 \
142         psapi \
143         rasapi32 \
144         riched32 \
145         rpcrt4 \
146         serialui \
147         setupapi \
148         shdocvw \
149         shell32 \
150         shfolder \
151         shlwapi \
152         tapi32 \
153         ttydrv \
154         urlmon \
155         user32 \
156         version \
157         w32skrnl \
158         winedos \
159         wineoss.drv \
160         wineps \
161         wininet \
162         winmm \
163         winnls32 \
164         winspool.drv \
165         wnaspi32 \
166         wow32 \
167         ws2_32 \
168         wsock32
170 # Implicit rules
172 .SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .glue.c
174 .c.o:
175         $(CC) -c $(ALLCFLAGS) -o $*.o $<
177 .s.o:
178         $(AS) -o $*.o $<  
180 .S.o:
181         $(CC) -c -o $*.o $<  
183 .mc.mc.rc:
184         $(LDPATH) $(WMC) -i -H /dev/null -o $@ $<
186 .rc.res:
187         $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
189 .spec.spec.c:
190         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -spec $<
192 .c.glue.c:
193         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
195 .c.ln:
196         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
198 .PHONY: all install uninstall clean distclean depend dummy
200 # 'all' target first in case the enclosing Makefile didn't define any target
202 all: Makefile
204 # Rule for main module intermediate object
206 $(MODULE).tmp.o: $(OBJS) Makefile.in
207         $(LDCOMBINE) $(OBJS) -o $@
208         -strip --strip-unneeded $@
210 # Rule for main module spec file
212 $(MODULE).spec.c: $(MODULE).spec $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
213         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec
215 # Rule to rebuild the resource compiler
217 $(WRC):
218         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc
220 # Rule to rebuild the message compiler
222 $(WMC):
223         cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc
225 # Rule to rebuild the 'makedep' program
227 $(MAKEDEP):
228         cd $(TOPOBJDIR)/tools && $(MAKE) makedep
230 # Rule to rebuild the 'winebuild' program
232 $(WINEBUILD):
233         cd $(TOPOBJDIR)/tools/winebuild && $(MAKE) winebuild
235 # Rules for makefile
237 Makefile: Makefile.in $(TOPSRCDIR)/configure
238         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
239         @exit 1
241 # Rules for auto documentation
243 man: $(C_SRCS)
244         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
246 doc-html: $(C_SRCS)
247         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
249 # Rule for linting
251 $(MODULE).ln : $(LINTS)
252         if test "$(LINTS)" ; \
253         then \
254                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
255                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
256         else \
257                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
258         fi
260 lint:: $(MODULE).ln
262 # Rules for Windows API checking
264 winapi_check::
265         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
267 # Rules for dependencies
269 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
270         cd `dirname $@` && $(MAKE) depend
272 depend: $(MAKEDEP) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
273         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(MC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
275 # Rules for cleaning
277 $(SUBDIRS:%=%/__clean__): dummy
278         cd `dirname $@` && $(MAKE) clean
280 $(EXTRASUBDIRS:%=%/__clean__): dummy
281         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
283 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
284         $(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
286 # Rules for installing
288 $(SUBDIRS:%=%/__install__): dummy
289         cd `dirname $@` && $(MAKE) install
291 $(SUBDIRS:%=%/__uninstall__): dummy
292         cd `dirname $@` && $(MAKE) uninstall
294 # Misc. rules
296 $(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
298 $(GLUE:.c=.glue.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
300 $(RC_SRCS:.rc=.res): $(WRC)
302 $(MC_SRCS:.mc=.mc.rc): $(WMC)
304 $(SUBDIRS): dummy
305         @cd $@ && $(MAKE)
307 dummy:
309 # End of global rules