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