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