Made server launching somewhat cleaner and faster.
[wine/multimedia.git] / Make.rules.in
blob6dd52f181c9d85c3998154efe9bc31a82052f4eb
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_ASM_SRCS : generated assembly sources
13 # RC_SRCS      : resource source files
14 # SPEC_SRCS    : interface definition files
15 # GLUE         : C sources for which glue code needs to be generated
16 # EXTRA_SRCS   : extra source files for make depend
17 # EXTRA_OBJS   : extra object files
18 # WRCEXTRA     : extra wrc flags (e.g. '-p _SysRes')
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 WINELIB   = $(WINESTUB) $(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@PROGEXT@
58 MAKEDEP   = $(TOPOBJDIR)/tools/makedep@PROGEXT@
59 WRC       = $(TOPOBJDIR)/tools/wrc/wrc@PROGEXT@
60 WRCFLAGS  = -c
61 WINESTUB  = $(TOPOBJDIR)/library/winestub.o
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 *.flc \
80                   *.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_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 DLLS = \
90         avifil32 \
91         comctl32 \
92         comdlg32 \
93         dciman32 \
94         ddraw \
95         dinput \
96         dplayx \
97         dsound \
98         gdi32 \
99         icmp \
100         imagehlp \
101         imm32 \
102         joystick.drv \
103         lz32 \
104         mcianim.drv \
105         mciavi.drv \
106         mcicda.drv \
107         mciseq.drv \
108         mciwave.drv \
109         midimap.drv \
110         mpr \
111         msacm \
112         msacm.drv \
113         msacm32 \
114         msnet32 \
115         msvfw32 \
116         odbc32 \
117         ole32 \
118         oleaut32 \
119         olecli32 \
120         oledlg \
121         olepro32 \
122         olesvr32 \
123         psapi \
124         rasapi32 \
125         setupx \
126         shell32 \
127         sound \
128         stress \
129         tapi32 \
130         ttydrv \
131         urlmon \
132         user32 \
133         version \
134         w32skrnl \
135         win87em \
136         windebug \
137         wineoss.drv \
138         wing \
139         wininet \
140         winmm \
141         winspool \
142         wnaspi32 \
143         wsock32 \
144         x11drv
146 # Implicit rules
148 .SUFFIXES:
149 .SUFFIXES: .rc .res .spec .spec.c .spec.o .glue.c $(SUFFIXES)
151 .c.o:
152         $(CC) -c $(ALLCFLAGS) -o $*.o $<
154 .spec.c.spec.o:
155         $(CC) -c $(ALLCFLAGS) @GCC_NO_BUILTIN@ -o $*.spec.o $<
157 .s.o:
158         $(AS) -o $*.o $<  
160 .S.o:
161         $(CC) -c -o $*.o $<  
163 .rc.s:
164         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) $<
166 .rc.h:
167         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -nh $<
169 .rc.res:
170         $(WRC) $(WRCFLAGS) $(WRCEXTRA) $(DIVINCL) -r $<
172 .res.s:
173         $(WRC) $(WRCFLAGS) $(WRCEXTRA) -b $<
175 .res.h:
176         $(WRC) $(WRCFLAGS) $(WRCEXTRA) -bnh $<
178 .spec.spec.c:
179         $(BUILD) @BUILDFLAGS@ -o $@ -spec $<
181 .c.glue.c:
182         $(BUILD) @BUILDFLAGS@ -o $@ -glue $<
184 .c.ln:
185         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
187 .PHONY: all install uninstall clean distclean depend dummy
189 # 'all' target first in case the enclosing Makefile didn't define any target
191 all: Makefile
193 # Rule to rebuild the resource compiler
195 $(WRC) check_wrc:
196         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc@PROGEXT@
198 # Rule to rebuild the 'makedep' program
200 $(MAKEDEP) check_makedep:
201         cd $(TOPOBJDIR)/tools && $(MAKE) makedep@PROGEXT@
203 # Rule to rebuild the 'build' program
205 $(BUILD) checkbuild:
206         cd $(TOPOBJDIR)/tools && $(MAKE) build@PROGEXT@
208 # Rule to rebuild winestub.o
210 $(WINESTUB) check_winestub:
211         cd $(TOPOBJDIR)/library && $(MAKE) winestub.o
213 # Rule for main module
215 $(MODULE).o: $(OBJS) Makefile.in $(TOPSRCDIR)/Make.rules.in
216         $(LDCOMBINE) $(OBJS) -o $(MODULE).o
218 # Rules for makefile
220 Makefile: Makefile.in $(TOPSRCDIR)/configure
221         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
222         @exit 1
224 # Rules for auto documentation
226 man: $(C_SRCS)
227         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
229 html: $(C_SRCS)
230         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
232 # Rule for linting
234 $(MODULE).ln : $(LINTS)
235         if test "$(LINTS)" ; \
236         then \
237                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
238                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
239         else \
240                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
241         fi
243 lint:: $(MODULE).ln
245 # Rules for Windows API checking
247 winapi_check::
248         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
250 # Rules for dependencies
252 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
253         cd `dirname $@` && $(MAKE) depend
255 depend: $(MAKEDEP) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS) $(SUBDIRS:%=%/__depend__)
256         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(EXTRA_SRCS)
258 # Rules for cleaning
260 $(SUBDIRS:%=%/__clean__): dummy
261         cd `dirname $@` && $(MAKE) clean
263 $(EXTRASUBDIRS:%=%/__clean__): dummy
264         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
266 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
267         $(RM) $(CLEAN_FILES) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.s) $(RC_SRCS:.rc=.h) $(PROGRAMS)
269 # Misc. rules
271 $(SPEC_SRCS:.spec=.spec.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
273 $(GLUE:.c=.glue.c): $(BUILD) $(TOPSRCDIR)/include/builtin16.h $(TOPSRCDIR)/include/builtin32.h
275 $(RC_SRCS:.rc=.s): $(WRC)
277 $(SUBDIRS): dummy
278         @cd $@ && $(MAKE)
280 dummy:
282 # End of global rules