Fixed some warnings.
[wine/multimedia.git] / Make.rules.in
blob3167b89f1843215dda34b42f09f59cf751969ce6
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 # WRCEXTRA     : extra wrc flags (e.g. '-p _SysRes')
20 # SUBDIRS      : subdirectories that contain a Makefile
21 # EXTRASUBDIRS : subdirectories that do not contain a Makefile
23 # First some useful definitions
25 SHELL     = /bin/sh
26 CC        = @CC@
27 CPP       = @CPP@
28 CFLAGS    = @CFLAGS@
29 OPTIONS   = @OPTIONS@ -D_REENTRANT
30 X_CFLAGS  = @X_CFLAGS@
31 X_LIBS    = @X_LIBS@
32 XLIB      = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
33 DLL_LINK  = @DLL_LINK@
34 LIBS      = @LIBS@
35 YACC      = @YACC@
36 LEX       = @LEX@
37 LEXLIB    = @LEXLIB@
38 RANLIB    = @RANLIB@
39 LN_S      = @LN_S@
40 DIVINCL   = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include
41 ALLCFLAGS = $(DIVINCL) $(CFLAGS) $(DEFS) $(OPTIONS) $(X_CFLAGS)
42 LDCOMBINE = ld -r
43 AR        = ar rc
44 RM        = rm -f
45 MV        = mv
46 MKDIR     = mkdir -p
47 C2MAN     = @C2MAN@
48 MANSPECS  = -w $(TOPSRCDIR)/relay32/gdi32.spec \
49             -w $(TOPSRCDIR)/relay32/user32.spec \
50             -w $(TOPSRCDIR)/relay32/comctl32.spec \
51             -w $(TOPSRCDIR)/relay32/comdlg32.spec \
52             -w $(TOPSRCDIR)/relay32/kernel32.spec 
53 LINT      = @LINT@
54 LINTFLAGS = @LINTFLAGS@
55 ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
56 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
57 BUILD     = $(TOPOBJDIR)/tools/build
58 MAKEDEP   = $(TOPOBJDIR)/tools/makedep
59 WRC       = $(TOPOBJDIR)/tools/wrc/wrc
60 WRCFLAGS  = -c -s -p $*
61 WMC       = $(TOPOBJDIR)/tools/wmc/wmc
62 DLLDIR    = $(TOPOBJDIR)/dlls
63 @SET_MAKE@
65 # Installation infos
67 INSTALL         = @INSTALL@
68 INSTALL_PROGRAM = @INSTALL_PROGRAM@
69 INSTALL_DATA    = @INSTALL_DATA@
70 prefix          = @prefix@
71 exec_prefix     = @exec_prefix@
72 bindir          = @bindir@
73 libdir          = @libdir@
74 infodir         = @infodir@
75 mandir          = @mandir@
76 prog_manext     = 1
77 conf_manext     = 5
78 includedir      = @includedir@/wine
79 CLEAN_FILES     = *.o *.a *.so *.ln \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
80                   *.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core
82 OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
83        $(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
85 LINTS = $(C_SRCS:.c=.ln)
87 # DLL list
89 X_DLLS = \
90         ddraw \
91         @OPENGL32_DLL@ \
92         x11drv
94 DLLS = \
95         @X_DLLS@ \
96         avifil32 \
97         comctl32 \
98         comdlg32 \
99         dciman32 \
100         dinput \
101         dplayx \
102         dsound \
103         gdi32 \
104         icmp \
105         imagehlp \
106         imm32 \
107         joystick.drv \
108         kernel32 \
109         lz32 \
110         mcianim.drv \
111         mciavi.drv \
112         mcicda.drv \
113         mciseq.drv \
114         mciwave.drv \
115         midimap.drv \
116         mpr \
117         msacm \
118         msacm.drv \
119         msacm32 \
120         msnet32 \
121         msvfw32 \
122         odbc32 \
123         ole32 \
124         oleaut32 \
125         olecli32 \
126         oledlg \
127         olepro32 \
128         olesvr32 \
129         psapi \
130         rasapi32 \
131         riched32 \
132         setupx \
133         shell32 \
134         sound \
135         stress \
136         tapi32 \
137         ttydrv \
138         urlmon \
139         user32 \
140         version \
141         w32skrnl \
142         win87em \
143         windebug \
144         wineoss.drv \
145         wineps \
146         wing \
147         wininet \
148         winmm \
149         winspool.drv \
150         wnaspi32 \
151         wsock32
153 # Implicit rules
155 .SUFFIXES: .rc .res .spec .spec.c .spec.o .glue.c
157 .c.o:
158         $(CC) -c $(ALLCFLAGS) -o $*.o $<
160 .spec.c.spec.o:
161         $(CC) -c $(ALLCFLAGS) @GCC_NO_BUILTIN@ -o $*.spec.o $<
163 .s.o:
164         $(AS) -o $*.o $<  
166 .S.o:
167         $(CC) -c -o $*.o $<  
169 .rc.s:
170         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
172 .rc.h:
173         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -nh $<
175 .rc.res:
176         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r $<
178 .res.s:
179         $(WRC) $(WRCFLAGS) $(WRCEXTRA) -b $<
181 .res.h:
182         $(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
184 .spec.spec.c:
185         $(BUILD) @BUILDFLAGS@ -o $@ -spec $<
187 .c.glue.c:
188         $(BUILD) @BUILDFLAGS@ -o $@ -glue $<
190 .c.ln:
191         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
193 .PHONY: all install uninstall clean distclean depend dummy
195 # 'all' target first in case the enclosing Makefile didn't define any target
197 all: Makefile
199 # Rule to rebuild the resource compiler
201 $(WRC) check_wrc:
202         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc
204 # Rule to rebuild the message compiler
206 $(WMC) check_wmc:
207         cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc
209 # Rule to rebuild the 'makedep' program
211 $(MAKEDEP) check_makedep:
212         cd $(TOPOBJDIR)/tools && $(MAKE) makedep
214 # Rule to rebuild the 'build' program
216 $(BUILD) checkbuild:
217         cd $(TOPOBJDIR)/tools && $(MAKE) build
219 # Rule for main module
221 $(MODULE).o: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
222         $(LDCOMBINE) $(OBJS) -o $(MODULE).o
224 # Rules for makefile
226 Makefile: Makefile.in $(TOPSRCDIR)/configure
227         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
228         @exit 1
230 # Rules for auto documentation
232 man: $(C_SRCS)
233         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
235 html: $(C_SRCS)
236         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
238 # Rule for linting
240 $(MODULE).ln : $(LINTS)
241         if test "$(LINTS)" ; \
242         then \
243                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
244                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
245         else \
246                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
247         fi
249 lint:: $(MODULE).ln
251 # Rules for Windows API checking
253 winapi_check::
254         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
256 # Rules for dependencies
258 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
259         cd `dirname $@` && $(MAKE) depend
261 depend: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
262         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
264 # Rules for cleaning
266 $(SUBDIRS:%=%/__clean__): dummy
267         cd `dirname $@` && $(MAKE) clean
269 $(EXTRASUBDIRS:%=%/__clean__): dummy
270         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
272 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
273         $(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(PROGRAMS)
275 # Rules for installing
277 $(SUBDIRS:%=%/__install__): dummy
278         cd `dirname $@` && $(MAKE) install
280 $(SUBDIRS:%=%/__uninstall__): dummy
281         cd `dirname $@` && $(MAKE) uninstall
283 # Misc. rules
285 $(SPEC_SRCS:.spec=.spec.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
287 $(GLUE:.c=.glue.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
289 $(RC_SRCS:.rc=.s): $(WRC)
291 $(SUBDIRS): dummy
292         @cd $@ && $(MAKE)
294 dummy:
296 # End of global rules