Created a small static library in ole/libuuid.a that contains all the
[wine] / Make.rules.in
1 # Global rules shared by all makefiles     -*-Makefile-*-
2 #
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
8 #
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
21
22 # First some useful definitions
23
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 RANLIB    = @RANLIB@
40 LN_S      = @LN_S@
41 DIVINCL   = -I$(SRCDIR) -I. -I$(TOPSRCDIR)/include -I$(TOPOBJDIR)/include
42 ALLCFLAGS = $(DIVINCL) $(CFLAGS) $(DEFS) $(OPTIONS) $(X_CFLAGS)
43 LDCOMBINE = @LDCOMBINE@
44 LDFLAGS   = @LDFLAGS@
45 AR        = ar rc
46 RM        = rm -f
47 MV        = mv
48 MKDIR     = mkdir -p
49 C2MAN     = @C2MAN@
50 MANSPECS  = -w $(TOPSRCDIR)/dlls/gdi/gdi32.spec \
51             -w $(TOPSRCDIR)/dlls/user/user32.spec \
52             -w $(TOPSRCDIR)/dlls/comctl32/comctl32.spec \
53             -w $(TOPSRCDIR)/dlls/comdlg32/comdlg32.spec \
54             -w $(TOPSRCDIR)/dlls/kernel/kernel32.spec 
55 LINT      = @LINT@
56 LINTFLAGS = @LINTFLAGS@
57 ALLLINTFLAGS = $(LINTFLAGS) $(DEFS) $(OPTIONS) $(DIVINCL)
58 WINAPI_CHECK = $(TOPSRCDIR)/tools/winapi_check/winapi_check
59 WINEBUILD = $(TOPOBJDIR)/tools/winebuild/winebuild
60 MAKEDEP   = $(TOPOBJDIR)/tools/makedep
61 WRC       = $(TOPOBJDIR)/tools/wrc/wrc
62 WMC       = $(TOPOBJDIR)/tools/wmc/wmc
63 LDPATH    = LD_LIBRARY_PATH="$(TOPOBJDIR)/unicode:$$LD_LIBRARY_PATH"
64 DLLDIR    = $(TOPOBJDIR)/dlls
65 LIBWINE   = -L$(TOPOBJDIR)/library -lwine
66 LIBTSX11  = -L$(TOPOBJDIR)/tsx11 -lwine_tsx11
67 LIBUNICODE= -L$(TOPOBJDIR)/unicode -lwine_unicode
68 LIBUUID   = -L$(TOPOBJDIR)/ole -luuid
69
70 @SET_MAKE@
71
72 # Installation infos
73
74 INSTALL         = @INSTALL@
75 INSTALL_PROGRAM = @INSTALL_PROGRAM@
76 INSTALL_DATA    = @INSTALL_DATA@
77 prefix          = @prefix@
78 exec_prefix     = @exec_prefix@
79 bindir          = @bindir@
80 libdir          = @libdir@
81 infodir         = @infodir@
82 mandir          = @mandir@
83 prog_manext     = 1
84 conf_manext     = 5
85 includedir      = @includedir@/wine
86 CLEAN_FILES     = *.o *.a *.so *.ln \\\#*\\\# *~ *% .\\\#* *.bak *.orig *.rej \
87                   *.flc *.spec.c *.glue.c y.tab.c y.tab.h lex.yy.c core
88
89 OBJS = $(SPEC_SRCS:.spec=.spec.o) $(C_SRCS:.c=.o) $(GEN_C_SRCS:.c=.o) $(GEN_ASM_SRCS:.s=.o) \
90        $(ASM_SRCS:.S=.o) $(GLUE:.c=.glue.o) $(EXTRA_OBJS)
91
92 LINTS = $(C_SRCS:.c=.ln)
93
94 # DLL list
95
96 X_DLLS = \
97         ddraw \
98         @OPENGL32_DLL@ \
99         x11drv
100
101 DLLS = \
102         @X_DLLS@ \
103         advapi32 \
104         avifil32 \
105         comctl32 \
106         comdlg32 \
107         crtdll \
108         dciman32 \
109         dinput \
110         dplay \
111         dplayx \
112         dsound \
113         gdi32 \
114         icmp \
115         imagehlp \
116         imm32 \
117         joystick.drv \
118         kernel32 \
119         lz32 \
120         mcianim.drv \
121         mciavi.drv \
122         mcicda.drv \
123         mciseq.drv \
124         mciwave.drv \
125         midimap.drv \
126         mpr \
127         msacm.drv \
128         msacm32 \
129         msnet32 \
130         msvfw32 \
131         odbc32 \
132         ole32 \
133         oleaut32 \
134         olecli32 \
135         oledlg \
136         olepro32 \
137         olesvr32 \
138         psapi \
139         rasapi32 \
140         riched32 \
141         rpcrt4 \
142         serialui \
143         setupapi \
144         shell32 \
145         shfolder \
146         shlwapi \
147         tapi32 \
148         ttydrv \
149         urlmon \
150         user32 \
151         version \
152         w32skrnl \
153         wineoss.drv \
154         wineps \
155         wininet \
156         winmm \
157         winspool.drv \
158         wnaspi32 \
159         wow32 \
160         ws2_32 \
161         wsock32
162
163 # Implicit rules
164
165 .SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .glue.c
166
167 .c.o:
168         $(CC) -c $(ALLCFLAGS) -o $*.o $<
169
170 .s.o:
171         $(AS) -o $*.o $<  
172
173 .S.o:
174         $(CC) -c -o $*.o $<  
175
176 .mc.mc.rc:
177         $(LDPATH) $(WMC) -i -H /dev/null -o $@ $<
178
179 .rc.res:
180         $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
181
182 .spec.spec.c:
183         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -spec $<
184
185 .c.glue.c:
186         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
187
188 .c.ln:
189         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
190
191 .PHONY: all install uninstall clean distclean depend dummy
192
193 # 'all' target first in case the enclosing Makefile didn't define any target
194
195 all: Makefile
196
197 # Rule for main module intermediate object
198
199 $(MODULE).tmp.o: $(OBJS) Makefile.in
200         $(LDCOMBINE) $(OBJS) -o $@
201         -strip --strip-unneeded $@
202
203 # Rule for main module spec file
204
205 $(MODULE).spec.c: $(MODULE).spec $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
206         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec
207
208 # Rule to rebuild the resource compiler
209
210 $(WRC):
211         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc
212
213 # Rule to rebuild the message compiler
214
215 $(WMC):
216         cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc
217
218 # Rule to rebuild the 'makedep' program
219
220 $(MAKEDEP):
221         cd $(TOPOBJDIR)/tools && $(MAKE) makedep
222
223 # Rule to rebuild the 'winebuild' program
224
225 $(WINEBUILD):
226         cd $(TOPOBJDIR)/tools/winebuild && $(MAKE) winebuild
227
228 # Rules for makefile
229
230 Makefile: Makefile.in $(TOPSRCDIR)/configure
231         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
232         @exit 1
233
234 # Rules for auto documentation
235
236 man: $(C_SRCS)
237         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
238
239 doc-html: $(C_SRCS)
240         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
241
242 # Rule for linting
243
244 $(MODULE).ln : $(LINTS)
245         if test "$(LINTS)" ; \
246         then \
247                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
248                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
249         else \
250                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
251         fi
252
253 lint:: $(MODULE).ln
254
255 # Rules for Windows API checking
256
257 winapi_check::
258         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
259
260 # Rules for dependencies
261
262 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
263         cd `dirname $@` && $(MAKE) depend
264
265 depend: $(MAKEDEP) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
266         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(MC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
267
268 # Rules for cleaning
269
270 $(SUBDIRS:%=%/__clean__): dummy
271         cd `dirname $@` && $(MAKE) clean
272
273 $(EXTRASUBDIRS:%=%/__clean__): dummy
274         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
275
276 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
277         $(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
278
279 # Rules for installing
280
281 $(SUBDIRS:%=%/__install__): dummy
282         cd `dirname $@` && $(MAKE) install
283
284 $(SUBDIRS:%=%/__uninstall__): dummy
285         cd `dirname $@` && $(MAKE) uninstall
286
287 # Misc. rules
288
289 $(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
290
291 $(GLUE:.c=.glue.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
292
293 $(RC_SRCS:.rc=.res): $(WRC)
294
295 $(MC_SRCS:.mc=.mc.rc): $(WMC)
296
297 $(SUBDIRS): dummy
298         @cd $@ && $(MAKE)
299
300 dummy:
301
302 # End of global rules