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