Moved winsock implementation to dlls/winsock.
[wine] / Makefile.in
1 # This Makefile understands the following targets:
2 #
3 # all (default):        build wine
4 # lib:                  build libwine
5 # clean:                remove all intermediate files
6 # distclean:            also remove all files created by configure
7 # install:              install everything
8 # uninstall:            uninstall everything
9 # depend:               create the dependencies
10 # etags:                create a TAGS file for Emacs.
11 # manpages:             compile manpages for Wine API
12 #
13
14 # Main target to build
15
16 MAIN_TARGET = @MAIN_TARGET@
17
18 # Directories
19
20 TOPSRCDIR = @top_srcdir@
21 TOPOBJDIR = .
22 SRCDIR    = @srcdir@
23 VPATH     = @srcdir@
24 MODULE    = none
25
26 TOOLSUBDIRS = \
27         tools \
28         tools/wrc
29
30 LIBSUBDIRS = \
31         controls \
32         console \
33         dlls/advapi32 \
34         dlls/avifil32 \
35         dlls/comctl32 \
36         dlls/commdlg \
37         dlls/crtdll \
38         dlls/dciman32 \
39         dlls/display \
40         dlls/dplayx \
41         dlls/dsound \
42         dlls/icmp \
43         dlls/imagehlp \
44         dlls/imm32 \
45         dlls/lzexpand \
46         dlls/mouse \
47         dlls/mpr \
48         dlls/msacm \
49         dlls/msacm32 \
50         dlls/msnet32 \
51         dlls/msvideo \
52         dlls/ntdll \
53         dlls/odbc32 \
54         dlls/ole32 \
55         dlls/oleaut32 \
56         dlls/olecli \
57         dlls/oledlg \
58         dlls/olesvr \
59         dlls/psapi \
60         dlls/rasapi32 \
61         dlls/shell32 \
62         dlls/sound \
63         dlls/stress \
64         dlls/tapi32 \
65         dlls/ver \
66         dlls/version \
67         dlls/win32s \
68         dlls/win87em \
69         dlls/winaspi \
70         dlls/windebug \
71         dlls/wing \
72         dlls/winmm \
73         dlls/winmm/mcianim \
74         dlls/winmm/mciavi \
75         dlls/winmm/mcicda \
76         dlls/winmm/mciseq \
77         dlls/winmm/mciwave \
78         dlls/winmm/midimap \
79         dlls/winmm/wavemap \
80         dlls/winmm/wineoss \
81         dlls/winsock \
82         dlls/winspool \
83         dlls/wnaspi32 \
84         files \
85         graphics \
86         graphics/enhmetafiledrv \
87         graphics/metafiledrv \
88         graphics/psdrv \
89         graphics/ttydrv \
90         graphics/win16drv \
91         if1632 \
92         library \
93         loader \
94         loader/ne \
95         loader/dos \
96         memory \
97         misc \
98         msdos \
99         objects \
100         ole \
101         relay32 \
102         resources \
103         scheduler \
104         server \
105         win32 \
106         windows \
107         windows/ttydrv
108
109 X11SUBDIRS = \
110         graphics/x11drv \
111         tsx11 \
112         windows/x11drv
113
114 EMUSUBDIRS = \
115         debugger \
116         miscemu
117
118 PROGSUBDIRS = libtest programs
119
120 DOCSUBDIRS = documentation
121
122 INCSUBDIRS = include
123
124 # Sub-directories to run make into
125 BUILDSUBDIRS = \
126         $(TOOLSUBDIRS) \
127         $(LIBSUBDIRS) \
128         $(X11SUBDIRS) \
129         $(EMUSUBDIRS) \
130         $(PROGSUBDIRS) \
131         $(DOCSUBDIRS)
132
133 # Sub-directories to run make depend into
134 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
135
136 # Sub-directories to run make install into
137 INSTALLSUBDIRS = $(DOCSUBDIRS) $(INCSUBDIRS)
138
139 # Sub-directories to run make lint into
140 LINTSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
141
142 # Extra sub-directories to clean
143 CLEANSUBDIRS = dlls include include/bitmaps include/wine
144
145 LIBOBJS = \
146         controls/controls.o \
147         console/console.o \
148         dlls/advapi32/advapi32.o \
149         dlls/avifil32/avifil32.o \
150         dlls/comctl32/comctl32.o \
151         dlls/commdlg/commdlg.o \
152         dlls/crtdll/crtdll.o \
153         dlls/dciman32/dciman32.o \
154         dlls/display/display.o \
155         dlls/dplayx/dplayx.o \
156         dlls/dsound/dsound.o \
157         dlls/icmp/icmp.o \
158         dlls/imagehlp/imagehlp.o \
159         dlls/imm32/imm32.o \
160         dlls/lzexpand/lzexpand.o \
161         dlls/mouse/mouse.o \
162         dlls/mpr/mpr.o \
163         dlls/msacm/msacm.o \
164         dlls/msacm32/msacm32.o \
165         dlls/msnet32/msnet32.o \
166         dlls/msvideo/msvideo.o \
167         dlls/ntdll/ntdll.o \
168         dlls/odbc32/odbc32.o \
169         dlls/ole32/ole32.o \
170         dlls/oleaut32/oleaut32.o \
171         dlls/olecli/olecli.o \
172         dlls/oledlg/oledlg.o \
173         dlls/olesvr/olesvr.o \
174         dlls/psapi/psapi.o \
175         dlls/rasapi32/rasapi32.o \
176         dlls/shell32/shell32.o \
177         dlls/sound/sound.o \
178         dlls/stress/stress.o \
179         dlls/tapi32/tapi32.o \
180         dlls/ver/ver.o \
181         dlls/version/version.o \
182         dlls/win32s/win32s.o \
183         dlls/win87em/win87em.o \
184         dlls/winaspi/winaspi.o \
185         dlls/windebug/windebug.o \
186         dlls/wing/wing.o \
187         dlls/winmm/winmm.o \
188         dlls/winmm/mcianim/mcianim.drv.o \
189         dlls/winmm/mciavi/mciavi.drv.o \
190         dlls/winmm/mcicda/mcicda.drv.o \
191         dlls/winmm/mciseq/mciseq.drv.o \
192         dlls/winmm/mciwave/mciwave.drv.o \
193         dlls/winmm/midimap/midimap.drv.o \
194         dlls/winmm/wavemap/msacm.drv.o \
195         dlls/winmm/wineoss/wineoss.drv.o \
196         dlls/winsock/winsock.o \
197         dlls/winspool/winspool.o \
198         dlls/wnaspi32/wnaspi32.o \
199         files/files.o \
200         graphics/graphics.o \
201         graphics/enhmetafiledrv/enhmetafiledrv.o \
202         graphics/metafiledrv/metafiledrv.o \
203         graphics/psdrv/psdrv.o \
204         graphics/ttydrv/ttydrv.o \
205         graphics/win16drv/win16drv.o \
206         if1632/if1632.o \
207         loader/loader.o \
208         loader/ne/ne.o \
209         loader/dos/dos.o \
210         memory/memory.o \
211         misc/misc.o \
212         msdos/msdos.o \
213         objects/objects.o \
214         ole/ole.o \
215         relay32/relay32.o \
216         resources/resources.o \
217         scheduler/scheduler.o \
218         server/server.o \
219         win32/win32.o \
220         windows/windows.o \
221         windows/ttydrv/ttydrv.o
222
223 X11OBJS = \
224         graphics/x11drv/x11drv.o \
225         tsx11/tsx11.o \
226         windows/x11drv/x11drv.o
227
228 EMUOBJS = \
229         debugger/debugger.o \
230         miscemu/miscemu.o
231
232 LIB_TARGET  = @LIB_TARGET@
233
234 ALT_LINK    = @ALT_LINK@
235
236 all: Makefile Make.rules $(MAIN_TARGET)
237         @echo "Wine build complete."
238
239 LIBLINTS = $(LIBOBJS:.o=.ln) 
240 X11LINTS = $(X11OBJS:.o=.ln)
241 EMULINTS = $(EMUOBJS:.o=.ln)
242
243 lint:: llib-lwine.ln $(EMULINTS)
244         $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
245
246 WINAPI_CHECK_EXTRA_FLAGS = --global
247
248 @MAKE_RULES@
249
250 Make.rules: Make.rules.in configure
251         @echo $? is newer than 'Make.rules', please rerun ./configure!
252         @exit 1
253
254 install:: install_$(MAIN_TARGET)
255
256 uninstall:: uninstall_$(MAIN_TARGET)
257
258 emu: wine
259
260 lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
261
262 wine wine.sym: $(LIB_TARGET) $(EMUOBJS) $(X11OBJS) $(LIBOBJS)
263         $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
264         nm -n wine | grep -v _compiled >wine.sym
265
266 libwine.a: $(LIBOBJS) $(X11OBJS)
267         $(RM) $@
268         $(AR) $@ $(LIBOBJS) $(X11OBJS)
269         $(RANLIB) $@
270
271 llib-lwine.ln : $(LIBLINTS) $(X11LINTS)
272         $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(X11LINTS)
273
274 libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
275         $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
276         $(RM) libwine.so
277         $(LN_S) $@ libwine.so
278
279 install_emu: install_lib
280         [ -d $(bindir) ] || $(MKDIR) $(bindir)
281         $(INSTALL_PROGRAM) wine $(bindir)/wine
282         $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
283
284 uninstall_emu: uninstall_lib
285         $(RM) $(bindir)/wine $(bindir)/dosmod
286
287 install_lib: dummy
288         [ -d $(libdir) ] || $(MKDIR) $(libdir)
289         if [ -f wine.sym ]; then $(INSTALL_DATA) wine.sym $(libdir)/wine.sym; fi
290         if [ $(LIB_TARGET) ]; then \
291             if [ $(LIB_TARGET) = libwine.so.1.0 ]; then \
292                 $(INSTALL_PROGRAM) $(LIB_TARGET) $(libdir); \
293                 $(LDCONFIG) || (cd $(libdir) ; $(RM) libwine.so ; $(LN_S) $(LIB_TARGET) libwine.so) ; \
294             else \
295                 $(INSTALL_DATA) $(LIB_TARGET) $(libdir); \
296             fi \
297         fi
298         [ -d $(bindir) ] || $(MKDIR) $(bindir)
299         $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
300         $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
301
302 uninstall_lib: dummy
303         cd $(libdir) && $(RM) $(LIB_TARGET) libwine.a libwine.so wine.sym
304         $(RM) $(bindir)/wineserver $(bindir)/wineclipsrv
305
306 $(X11OBJS) $(EMUOBJS) $(LIBOBJS): $(TOOLSUBDIRS) dummy
307         @cd `dirname $@`; $(SUBMAKE)
308
309 $(BUILDSUBDIRS): dummy
310         @cd $@; $(SUBMAKE)
311
312 $(LIBLINTS) $(X11LINTS) $(EMULINTS): dummy
313         @echo $@ | sed 's%\(.*\)\/[^\/]*%cd \1 \&\& make lint%' | sh
314
315
316 install_programs: dummy
317         @cd programs; $(SUBMAKE) install
318
319 uninstall_programs: dummy
320         @cd programs; $(SUBMAKE) uninstall
321
322 install::
323         for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
324
325 uninstall::
326         for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
327
328 depend:: dummy
329         for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
330
331 TAGS etags:
332         etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
333
334 manpages:
335         -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
336         for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
337
338 htmlpages:
339         -$(MKDIR) $(TOPOBJDIR)/documentation/html
340         for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
341
342 clean::
343         for i in $(BUILDSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
344         for i in $(CLEANSUBDIRS); do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
345         $(RM) wine wine.sym libwine.a libwine.so.1.0 libwine.so TAGS .#*
346
347 distclean: clean
348         $(RM) config.* Make.rules include/config.h documentation/wine.man documentation/wine.conf.man
349         $(RM) `find . \( -name Makefile -o -size 0 \) -print`
350
351 # We depend on configure above for checks, so we better don't use this rule.
352 #configure: configure.in
353 #       autoconf
354
355 include/config.h.in: configure.in include/acconfig.h
356         autoheader -l include
357
358 ### Dependencies: