1 # This Makefile understands the following targets:
3 # all (default): build wine
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
14 # Main target to build
16 MAIN_TARGET = @MAIN_TARGET@
20 TOPSRCDIR = @top_srcdir@
86 graphics/enhmetafiledrv \
87 graphics/metafiledrv \
118 PROGSUBDIRS = libtest programs
120 DOCSUBDIRS = documentation
124 # Sub-directories to run make into
133 # Sub-directories to run make depend into
134 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
136 # Sub-directories to run make install into
137 INSTALLSUBDIRS = $(DOCSUBDIRS) $(INCSUBDIRS)
139 # Sub-directories to run make lint into
140 LINTSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
142 # Extra sub-directories to clean
143 CLEANSUBDIRS = dlls include include/bitmaps include/wine
146 controls/controls.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 \
158 dlls/imagehlp/imagehlp.o \
160 dlls/lzexpand/lzexpand.o \
164 dlls/msacm32/msacm32.o \
165 dlls/msnet32/msnet32.o \
166 dlls/msvideo/msvideo.o \
168 dlls/odbc32/odbc32.o \
170 dlls/oleaut32/oleaut32.o \
171 dlls/olecli/olecli.o \
172 dlls/oledlg/oledlg.o \
173 dlls/olesvr/olesvr.o \
175 dlls/rasapi32/rasapi32.o \
176 dlls/shell32/shell32.o \
178 dlls/stress/stress.o \
179 dlls/tapi32/tapi32.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 \
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 \
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 \
216 resources/resources.o \
217 scheduler/scheduler.o \
221 windows/ttydrv/ttydrv.o
224 graphics/x11drv/x11drv.o \
226 windows/x11drv/x11drv.o
229 debugger/debugger.o \
232 LIB_TARGET = @LIB_TARGET@
234 ALT_LINK = @ALT_LINK@
236 all: Makefile Make.rules $(MAIN_TARGET)
237 @echo "Wine build complete."
239 LIBLINTS = $(LIBOBJS:.o=.ln)
240 X11LINTS = $(X11OBJS:.o=.ln)
241 EMULINTS = $(EMUOBJS:.o=.ln)
243 lint:: llib-lwine.ln $(EMULINTS)
244 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
246 WINAPI_CHECK_EXTRA_FLAGS = --global
250 Make.rules: Make.rules.in configure
251 @echo $? is newer than 'Make.rules', please rerun ./configure!
254 install:: install_$(MAIN_TARGET)
256 uninstall:: uninstall_$(MAIN_TARGET)
260 lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
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
266 libwine.a: $(LIBOBJS) $(X11OBJS)
268 $(AR) $@ $(LIBOBJS) $(X11OBJS)
271 llib-lwine.ln : $(LIBLINTS) $(X11LINTS)
272 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(X11LINTS)
274 libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
275 $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
277 $(LN_S) $@ libwine.so
279 install_emu: install_lib
280 [ -d $(bindir) ] || $(MKDIR) $(bindir)
281 $(INSTALL_PROGRAM) wine $(bindir)/wine
282 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
284 uninstall_emu: uninstall_lib
285 $(RM) $(bindir)/wine $(bindir)/dosmod
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) ; \
295 $(INSTALL_DATA) $(LIB_TARGET) $(libdir); \
298 [ -d $(bindir) ] || $(MKDIR) $(bindir)
299 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
300 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
303 cd $(libdir) && $(RM) $(LIB_TARGET) libwine.a libwine.so wine.sym
304 $(RM) $(bindir)/wineserver $(bindir)/wineclipsrv
306 $(X11OBJS) $(EMUOBJS) $(LIBOBJS): $(TOOLSUBDIRS) dummy
307 @cd `dirname $@`; $(SUBMAKE)
309 $(BUILDSUBDIRS): dummy
312 $(LIBLINTS) $(X11LINTS) $(EMULINTS): dummy
313 @echo $@ | sed 's%\(.*\)\/[^\/]*%cd \1 \&\& make lint%' | sh
316 install_programs: dummy
317 @cd programs; $(SUBMAKE) install
319 uninstall_programs: dummy
320 @cd programs; $(SUBMAKE) uninstall
323 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
326 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
329 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
332 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
335 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
336 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
339 -$(MKDIR) $(TOPOBJDIR)/documentation/html
340 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
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 .#*
348 $(RM) config.* Make.rules include/config.h documentation/wine.man documentation/wine.conf.man
349 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
351 # We depend on configure above for checks, so we better don't use this rule.
352 #configure: configure.in
355 include/config.h.in: configure.in include/acconfig.h
356 autoheader -l include