Made ddraw and dinput separate dlls.
[wine/multimedia.git] / Make.rules.in
blob0fdd73494365d37590030fbe67e83f5bea1b0c1a
1 # Global rules shared by all makefiles     -*-Makefile-*-
3 # Each individual makefile should 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 # C_SRCS       : C sources for the module (optional)
9 # ASM_SRCS     : assembly sources (optional)
10 # GEN_ASM_SRCS : generated assembly sources (optional)
11 # RC_SRCS      : resource source files (optional)
12 # SPEC_SRCS    : interface definition files (optional)
13 # GLUE         : C sources for which glue code needs to be generated (optional)
14 # EXTRA_SRCS   : extra source files for make depend (optional)
15 # EXTRA_OBJS   : extra object files (optional)
16 # WRCEXTRA     : extra wrc flags (e.g. '-p _SysRes') (optional)
18 # First some useful definitions
20 SHELL     = /bin/sh
21 CC        = @CC@
22 CPP       = @CPP@
23 CFLAGS    = @CFLAGS@
24 OPTIONS   = @OPTIONS@ -D_REENTRANT
25 X_CFLAGS  = @X_CFLAGS@
26 X_LIBS    = @X_LIBS@
27 XLIB      = @X_PRE_LIBS@ @XLIB@ @X_EXTRA_LIBS@
28 DLL_LINK  = @DLL_LINK@
29 WINELIB   = $(WINESTUB) $(DLL_LINK)
30 LIBS      = @LIBS@
31 YACC      = @YACC@
32 LEX       = @LEX@
33 LEXLIB    = @LEXLIB@
34 RANLIB    = @RANLIB@
35 LN_S      = @LN_S@
36 DIVINCL   = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include
37 ALLCFLAGS = $(DIVINCL) $(CFLAGS) $(DEFS) $(OPTIONS) $(X_CFLAGS)
38 LDCOMBINE = ld -r
39 AR        = ar rc
40 RM        = rm -f
41 MV        = mv
42 MKDIR     = mkdir -p
43 C2MAN     = @C2MAN@
44 MANSPECS  = -w $(TOPSRCDIR)/relay32/gdi32.spec \
45             -w $(TOPSRCDIR)/relay32/user32.spec \
46             -w $(TOPSRCDIR)/relay32/comctl32.spec \
47             -w $(TOPSRCDIR)/relay32/comdlg32.spec \
48             -w $(TOPSRCDIR)/relay32/kernel32.spec 
49 LINT      = @LINT@
50 LINTFLAGS = @LINTFLAGS@
51 ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
52 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
53 BUILD     = $(TOPOBJDIR)/tools/build@PROGEXT@
54 MAKEDEP   = $(TOPOBJDIR)/tools/makedep@PROGEXT@
55 WRC       = $(TOPOBJDIR)/tools/wrc/wrc@PROGEXT@
56 WRCFLAGS  = -c
57 WINESTUB  = $(TOPOBJDIR)/library/winestub.o
58 DLLDIR    = $(TOPOBJDIR)/dlls
59 @SET_MAKE@
61 # Installation infos
63 INSTALL         = @INSTALL@
64 INSTALL_PROGRAM = @INSTALL_PROGRAM@
65 INSTALL_DATA    = @INSTALL_DATA@
66 prefix          = @prefix@
67 exec_prefix     = @exec_prefix@
68 bindir          = @bindir@
69 libdir          = @libdir@
70 infodir         = @infodir@
71 mandir          = @mandir@
72 prog_manext     = 1
73 conf_manext     = 5
74 includedir      = @includedir@/wine
76 OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
77        $(ASM_SRCS:.S=.o) $(RC_SRCS:.rc=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
79 LINTS = $(C_SRCS:.c=.ln)
81 # DLL list
83 DLLS = \
84         avifil32 \
85         comctl32 \
86         comdlg32 \
87         dciman32 \
88         ddraw \
89         dinput \
90         dplayx \
91         dsound \
92         icmp \
93         imagehlp \
94         imm32 \
95         joystick.drv \
96         lz32 \
97         mcianim.drv \
98         mciavi.drv \
99         mcicda.drv \
100         mciseq.drv \
101         mciwave.drv \
102         midimap.drv \
103         mpr \
104         msacm \
105         msacm.drv \
106         msacm32 \
107         msnet32 \
108         msvfw32 \
109         odbc32 \
110         ole32 \
111         oleaut32 \
112         olecli32 \
113         oledlg \
114         olepro32 \
115         olesvr32 \
116         psapi \
117         rasapi32 \
118         setupx \
119         shell32 \
120         sound \
121         stress \
122         tapi32 \
123         version \
124         w32skrnl \
125         win87em \
126         windebug \
127         wineoss.drv \
128         wing \
129         winmm \
130         winspool \
131         wnaspi32 \
132         wsock32
134 # Implicit rules
136 .SUFFIXES:
137 .SUFFIXES: .rc .res .spec .spec.c .spec.o .glue.c $(SUFFIXES)
139 .c.o:
140         $(CC) -c $(ALLCFLAGS) -o $*.o $<
142 .spec.c.spec.o:
143         $(CC) -c $(ALLCFLAGS) @GCC_NO_BUILTIN@ -o $*.spec.o $<
145 .s.o:
146         $(AS) -o $*.o $<  
148 .S.o:
149         $(CC) -c -o $*.o $<  
151 .rc.s:
152         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
154 .rc.h:
155         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -nh $<
157 .rc.res:
158         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r $<
160 .res.s:
161         $(WRC) $(WRCFLAGS) $(WRCEXTRA) -b $<
163 .res.h:
164         $(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
166 .spec.spec.c:
167         $(BUILD) @BUILDFLAGS@ -o $@ -spec $<
169 .c.glue.c:
170         $(BUILD) @BUILDFLAGS@ -o $@ -glue $<
172 .c.ln:
173         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
175 .PHONY: all install uninstall clean distclean depend dummy
177 # 'all' target first in case the enclosing Makefile didn't define any target
179 all: Makefile
181 # Rule to rebuild the resource compiler
183 $(WRC) check_wrc:
184         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc@PROGEXT@
186 # Rule to rebuild the 'makedep' program
188 $(MAKEDEP) check_makedep:
189         cd $(TOPOBJDIR)/tools && $(MAKE) makedep@PROGEXT@
191 # Rule to rebuild the 'build' program
193 $(BUILD) checkbuild:
194         cd $(TOPOBJDIR)/tools && $(MAKE) build@PROGEXT@
196 # Rule to rebuild winestub.o
198 $(WINESTUB) check_winestub:
199         cd $(TOPOBJDIR)/library && $(MAKE) winestub.o
201 # Rule for main module
203 $(MODULE).o: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
204         $(LDCOMBINE) $(OBJS) -o $(MODULE).o
206 # Rules for makefile
208 Makefile: Makefile.in $(TOPSRCDIR)/configure
209         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
210         @exit 1
212 # Rules for auto documentation
214 man: $(C_SRCS)
215         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
217 html: $(C_SRCS)
218         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
220 # Rule for linting
222 $(MODULE).ln : $(LINTS)
223         if test "$(LINTS)" ; \
224         then \
225                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
226                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
227         else \
228                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
229         fi
231 lint:: $(MODULE).ln
233 # Rules for Windows API checking
235 winapi_check::
236         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
238 # Misc. rules
240 $(SPEC_SRCS:.spec=.spec.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
242 $(GLUE:.c=.glue.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
244 $(RC_SRCS:.rc=.s): $(WRC)
246 depend:: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
247         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
249 clean::
250         $(RM) *.o *.a *.so *.ln \#*\# *~ *% .\#* *.bak *.orig *.rej *.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(PROGRAMS)
252 dummy:
254 # End of global rules