Implemented glu32.dll as libGLU.so forwarder.
[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 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
71
72 @SET_MAKE@
73
74 # Installation infos
75
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
91
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)
94
95 LINTS = $(C_SRCS:.c=.ln)
96
97 # DLL list
98
99 X_DLLS = \
100         ddraw \
101         @OPENGL32_DLL@ \
102         @GLU32_DLL@ \
103         x11drv
104
105 DLLS = \
106         @X_DLLS@ \
107         advapi32 \
108         avifil32 \
109         comctl32 \
110         comdlg32 \
111         crtdll \
112         dciman32 \
113         dinput \
114         dplay \
115         dplayx \
116         dsound \
117         gdi32 \
118         icmp \
119         imagehlp \
120         imm32 \
121         joystick.drv \
122         kernel32 \
123         lz32 \
124         mcianim.drv \
125         mciavi.drv \
126         mcicda.drv \
127         mciseq.drv \
128         mciwave.drv \
129         midimap.drv \
130         mpr \
131         msacm.drv \
132         msacm32 \
133         msnet32 \
134         msvcrt \
135         msvfw32 \
136         odbc32 \
137         ole32 \
138         oleaut32 \
139         olecli32 \
140         oledlg \
141         olepro32 \
142         olesvr32 \
143         psapi \
144         rasapi32 \
145         riched32 \
146         rpcrt4 \
147         serialui \
148         setupapi \
149         shdocvw \
150         shell32 \
151         shfolder \
152         shlwapi \
153         tapi32 \
154         ttydrv \
155         urlmon \
156         user32 \
157         version \
158         w32skrnl \
159         winedos \
160         wineoss.drv \
161         wineps \
162         wininet \
163         winmm \
164         winnls32 \
165         winspool.drv \
166         wintrust \
167         wnaspi32 \
168         wow32 \
169         ws2_32 \
170         wsock32
171
172 # Implicit rules
173
174 .SUFFIXES: .mc .rc .mc.rc .res .spec .spec.c .glue.c
175
176 .c.o:
177         $(CC) -c $(ALLCFLAGS) -o $*.o $<
178
179 .s.o:
180         $(AS) -o $*.o $<  
181
182 .S.o:
183         $(CC) -c -o $*.o $<  
184
185 .mc.mc.rc:
186         $(LDPATH) $(WMC) -i -H /dev/null -o $@ $<
187
188 .rc.res:
189         $(LDPATH) $(WRC) $(WRCFLAGS) $(DIVINCL) -o $@ -r $<
190
191 .spec.spec.c:
192         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) -o $@ -spec $<
193
194 .c.glue.c:
195         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -o $@ -glue $<
196
197 .c.ln:
198         $(LINT) -c $(ALLLINTFLAGS) $< || ( $(RM) $@ && exit 1 )
199
200 .PHONY: all install uninstall clean distclean depend dummy
201
202 # 'all' target first in case the enclosing Makefile didn't define any target
203
204 all: Makefile
205
206 # Rule for main module intermediate object
207
208 $(MODULE).tmp.o: $(OBJS) Makefile.in
209         $(LDCOMBINE) $(OBJS) -o $@
210         -strip --strip-unneeded $@
211
212 # Rule for main module spec file
213
214 $(MODULE).spec.c: $(MODULE).spec $(RC_SRCS:.rc=.res) $(SYMBOLFILE) $(WINEBUILD)
215         $(LDPATH) $(WINEBUILD) @DLLFLAGS@ -L$(DLLDIR) $(SYMBOLFILE:%=-sym %) -o $@ -spec $(SRCDIR)/$(MODULE).spec
216
217 # Rule to rebuild the resource compiler
218
219 $(WRC):
220         cd $(TOPOBJDIR)/tools/wrc && $(MAKE) wrc
221
222 # Rule to rebuild the message compiler
223
224 $(WMC):
225         cd $(TOPOBJDIR)/tools/wmc && $(MAKE) wmc
226
227 # Rule to rebuild the 'makedep' program
228
229 $(MAKEDEP):
230         cd $(TOPOBJDIR)/tools && $(MAKE) makedep
231
232 # Rule to rebuild the 'winebuild' program
233
234 $(WINEBUILD):
235         cd $(TOPOBJDIR)/tools/winebuild && $(MAKE) winebuild
236
237 # Rules for makefile
238
239 Makefile: Makefile.in $(TOPSRCDIR)/configure
240         @echo Makefile is older than $?, please rerun $(TOPSRCDIR)/configure
241         @exit 1
242
243 # Rules for auto documentation
244
245 man: $(C_SRCS)
246         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/man3w -S3w $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
247
248 doc-html: $(C_SRCS)
249         for i in $(C_SRCS); do $(C2MAN) -L -o $(TOPOBJDIR)/documentation/html -Th -iwindows.h  $(DIVINCL) -D__WINE__ $(MANSPECS) $$i; done
250
251 # Rule for linting
252
253 $(MODULE).ln : $(LINTS)
254         if test "$(LINTS)" ; \
255         then \
256                 $(LINT) $(ALLLINTFLAGS) -o$(MODULE) $(LINTS) ; \
257                 $(MV) llib-l$(MODULE).ln $(MODULE).ln ; \
258         else \
259                 $(LINT) $(ALLLINTFLAGS) -C$(MODULE) /dev/null ; \
260         fi
261
262 lint:: $(MODULE).ln
263
264 # Rules for Windows API checking
265
266 winapi_check::
267         $(WINAPI_CHECK) $(WINAPI_CHECK_FLAGS) $(WINAPI_CHECK_EXTRA_FLAGS) .
268
269 # Rules for dependencies
270
271 $(SUBDIRS:%=%/__depend__): $(MAKEDEP) dummy
272         cd `dirname $@` && $(MAKE) depend
273
274 depend: $(MAKEDEP) $(GEN_C_SRCS) $(SUBDIRS:%=%/__depend__)
275         $(MAKEDEP) $(DIVINCL) -C$(SRCDIR) $(C_SRCS) $(RC_SRCS) $(RC_SRCS16) $(MC_SRCS) $(EXTRA_SRCS) -C. $(GEN_C_SRCS)
276
277 # Rules for cleaning
278
279 $(SUBDIRS:%=%/__clean__): dummy
280         cd `dirname $@` && $(MAKE) clean
281
282 $(EXTRASUBDIRS:%=%/__clean__): dummy
283         -cd `dirname $@` && $(RM) $(CLEAN_FILES)
284
285 clean:: $(SUBDIRS:%=%/__clean__) $(EXTRASUBDIRS:%=%/__clean__)
286         $(RM) $(CLEAN_FILES) $(GEN_C_SRCS) $(GEN_ASM_SRCS) $(RC_SRCS:.rc=.res) $(RC_SRCS16:.rc=.res) $(MC_SRCS:.mc=.mc.rc) $(PROGRAMS)
287
288 # Rules for installing
289
290 $(SUBDIRS:%=%/__install__): dummy
291         cd `dirname $@` && $(MAKE) install
292
293 $(SUBDIRS:%=%/__uninstall__): dummy
294         cd `dirname $@` && $(MAKE) uninstall
295
296 # Misc. rules
297
298 $(SPEC_SRCS:.spec=.spec.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
299
300 $(GLUE:.c=.glue.c): $(WINEBUILD) $(TOPSRCDIR)/include/builtin16.h
301
302 $(RC_SRCS:.rc=.res): $(WRC)
303
304 $(RC_SRCS16:.rc=.res): $(WRC)
305
306 $(MC_SRCS:.mc=.mc.rc): $(WMC)
307
308 $(SUBDIRS): dummy
309         @cd $@ && $(MAKE)
310
311 dummy:
312
313 # End of global rules