Fixed a couple of file descriptor leaks.
[wine/multimedia.git] / Makefile.in
blob1d865c9133cc008a9fc4ca73de4be085dc19684a
1 # This Makefile understands the following targets:
3 # all (default): build wine
4 # clean: remove all intermediate files
5 # distclean: also remove all files created by configure
6 # install: install everything
7 # uninstall: uninstall everything
8 # depend: create the dependencies
9 # etags: create a TAGS file for Emacs.
10 # manpages: compile manpages for Wine API
13 # Directories
15 TOPSRCDIR = @top_srcdir@
16 TOPOBJDIR = .
17 SRCDIR = @srcdir@
18 VPATH = @srcdir@
19 LIBEXT = @LIBEXT@
20 LDSHARED = @LDSHARED@
21 LDCONFIG = @LDCONFIG@
22 MODULE = wine
23 SOVERSION = 1.0
24 SONAME = libwine.so
26 TOOLSUBDIRS = \
27 tools \
28 tools/wrc
30 LIBSUBDIRS = \
31 controls \
32 console \
33 debugger \
34 dlls/advapi32 \
35 dlls/crtdll \
36 dlls/display \
37 dlls/mouse \
38 dlls/ntdll \
39 files \
40 graphics \
41 graphics/enhmetafiledrv \
42 graphics/metafiledrv \
43 graphics/psdrv \
44 graphics/win16drv \
45 if1632 \
46 library \
47 loader \
48 loader/ne \
49 loader/dos \
50 memory \
51 misc \
52 msdos \
53 objects \
54 ole \
55 relay32 \
56 resources \
57 scheduler \
58 win32 \
59 windows
61 EMUSUBDIRS = \
62 miscemu \
63 server
65 PROGSUBDIRS = libtest programs
67 DOCSUBDIRS = documentation
69 INCSUBDIRS = include
71 PROGRAMS = \
72 loader/dos/dosmod \
73 server/wineserver \
74 windows/x11drv/wineclipsrv
76 # Sub-directories to run make into
77 BUILDSUBDIRS = \
78 $(TOOLSUBDIRS) \
79 $(LIBSUBDIRS) \
80 $(DLLDIR) \
81 $(EMUSUBDIRS) \
82 $(PROGSUBDIRS) \
83 $(DOCSUBDIRS)
85 # Sub-directories to run make depend into
86 DEPENDSUBDIRS = $(LIBSUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
88 # Sub-directories to run make install into
89 INSTALLSUBDIRS = $(DLLDIR) $(DOCSUBDIRS) $(INCSUBDIRS)
91 # Sub-directories to run make lint into
92 LINTSUBDIRS = $(LIBSUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
94 # Extra sub-directories to clean
95 CLEANSUBDIRS = dlls include include/bitmaps include/wine
97 LIBOBJS = \
98 controls/controls.o \
99 console/console.o \
100 debugger/debugger.o \
101 dlls/advapi32/advapi32.o \
102 dlls/crtdll/crtdll.o \
103 dlls/display/display.o \
104 dlls/mouse/mouse.o \
105 dlls/ntdll/ntdll.o \
106 files/files.o \
107 graphics/graphics.o \
108 graphics/enhmetafiledrv/enhmetafiledrv.o \
109 graphics/metafiledrv/metafiledrv.o \
110 graphics/psdrv/psdrv.o \
111 graphics/win16drv/win16drv.o \
112 if1632/if1632.o \
113 loader/loader.o \
114 loader/ne/ne.o \
115 loader/dos/dos.o \
116 memory/memory.o \
117 misc/misc.o \
118 msdos/msdos.o \
119 objects/objects.o \
120 ole/ole.o \
121 relay32/relay32.o \
122 resources/resources.o \
123 scheduler/scheduler.o \
124 win32/win32.o \
125 windows/windows.o
127 EMUOBJS = \
128 miscemu/miscemu.o
130 DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
132 EXTRA_OBJS = $(LIBOBJS)
134 EMU_TARGET = @EMU_TARGET@
136 all: Make.rules $(PROGRAMS) $(EMU_TARGET)
137 @echo "Wine build complete."
139 LIBLINTS = $(LIBOBJS:.o=.ln)
140 EMULINTS = $(EMUOBJS:.o=.ln)
142 lint:: llib-lwine.ln $(EMULINTS)
143 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
145 WINAPI_CHECK_EXTRA_FLAGS = --global
147 @MAKE_RULES@
149 all: lib$(MODULE).$(LIBEXT) $(DLLOBJS)
151 Make.rules: Make.rules.in configure
152 @echo $? is newer than 'Make.rules', please rerun ./configure!
153 @exit 1
155 wine wine.sym: lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(EMUOBJS)
156 $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
157 nm -n wine | grep -v _compiled >wine.sym
159 llib-lwine.ln : $(LIBLINTS)
160 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
162 install_so: lib$(MODULE).so.$(SOVERSION)
163 [ -d $(libdir) ] || $(MKDIR) $(libdir)
164 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
165 cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
167 install_a: lib$(MODULE).a
168 [ -d $(libdir) ] || $(MKDIR) $(libdir)
169 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
171 install_wine: wine
172 [ -d $(bindir) ] || $(MKDIR) $(bindir)
173 [ -d $(libdir) ] || $(MKDIR) $(libdir)
174 [ -f wine.sym ] && $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
175 $(INSTALL_PROGRAM) wine $(bindir)/wine
177 install:: $(PROGRAMS) $(EMU_TARGET:%=install_%) $(LIBEXT:%=install_%)
178 [ -d $(bindir) ] || $(MKDIR) $(bindir)
179 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
180 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
181 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
183 uninstall::
184 cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION) wine.sym
185 cd $(bindir) && $(RM) wine wineserver wineclipsrv dosmod
187 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in
188 $(LDSHARED) $(OBJS) -o $@
190 lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION)
191 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
193 lib$(MODULE).a: $(OBJS) Makefile.in Make.rules.in
194 $(RM) $@
195 $(AR) $@ $(OBJS)
196 $(RANLIB) $@
198 checklink::
199 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink
201 $(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS): $(TOOLSUBDIRS) dummy
202 @cd `dirname $@` && $(MAKE) `basename $@`
204 $(BUILDSUBDIRS): dummy
205 @cd $@ && $(MAKE)
207 $(LIBLINTS) $(EMULINTS): dummy
208 @cd `dirname $@` && $(MAKE) lint
210 install_programs: dummy
211 @cd programs && $(MAKE) install
213 uninstall_programs: dummy
214 @cd programs && $(MAKE) uninstall
216 install::
217 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
218 -$(LDCONFIG)
220 uninstall::
221 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
223 depend::
224 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
226 checklink::
227 @cd dlls && $(MAKE) checklink
229 TAGS etags:
230 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
232 manpages:
233 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
234 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
236 htmlpages:
237 -$(MKDIR) $(TOPOBJDIR)/documentation/html
238 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
240 clean::
241 for i in $(BUILDSUBDIRS); do (cd $$i && $(MAKE) clean) || exit 1; done
242 for i in $(CLEANSUBDIRS); do (cd $$i && $(RM) $(CLEAN_FILES)); done
243 $(RM) wine wine.sym libwine.so.1.0 TAGS
245 distclean: clean
246 $(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man
247 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
249 # We depend on configure above for checks, so we better don't use this rule.
250 #configure: configure.in
251 # autoconf
253 include/config.h.in: configure.in include/acconfig.h
254 autoheader -l include
256 ### Dependencies: