# This Makefile understands the following targets:
#
-# all (default): build wine
-# lib: build libwine
-# clean: remove all intermediate files
-# distclean: also remove all files created by configure
-# install: install everything
-# uninstall: uninstall everything
-# depend: create the dependencies
-# etags: create a TAGS file for Emacs.
-# manpages: compile manpages for Wine API
-#
-
-# Main target to build
-
-MAIN_TARGET = @MAIN_TARGET@
+# all (default): build wine
+# clean: remove all intermediate files
+# distclean: also remove all files created by configure
+# test: run tests
+# testclean: clean test results to force running all tests again
+# install-lib: install libraries needed to run applications
+# install-dev: install development environment
+# install: install everything
+# uninstall: uninstall everything
+# depend: create the dependencies
+# etags: create a TAGS file for Emacs.
+# manpages: compile manpages for Wine API
+# htmlpages: compile html pages for Wine API
+# sgmlpages: compile sgml source for the Wine API Guide
# Directories
TOPOBJDIR = .
SRCDIR = @srcdir@
VPATH = @srcdir@
+LIBEXT = @LIBEXT@
+LDCONFIG = @LDCONFIG@
+LDD = @LDD@
MODULE = none
-LIBSUBDIRS = \
- tools \
- tools/wrc \
- controls \
- dlls/comctl32 \
- dlls/psapi \
- dlls/shell32 \
- dlls/winaspi \
- dlls/wnaspi32 \
- files \
- graphics \
- graphics/metafiledrv \
- graphics/x11drv \
- ipc \
- library \
- loader \
- loader/ne \
- loader/dos \
- memory \
- misc \
- msdos \
- multimedia \
- objects \
- ole \
- relay32 \
- resources \
- scheduler \
+# Sub-directories to run make depend/clean into
+SUBDIRS = \
+ dlls \
+ documentation \
+ include \
+ libs \
+ miscemu \
+ programs \
server \
- tsx11 \
- win32 \
- windows
-
-EMUSUBDIRS = \
- debugger \
- graphics/psdrv \
- graphics/win16drv \
- if1632 \
- miscemu
-
-PROGSUBDIRS = libtest programs
-
-DOCSUBDIRS = documentation
-
-# All sub-directories
-ALLSUBDIRS = \
- $(LIBSUBDIRS) \
- $(EMUSUBDIRS) \
- $(PROGSUBDIRS) \
- $(DOCSUBDIRS)
-
-# Sub-directories to run make depend into
-DEPENDSUBDIRS = $(LIBSUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
-
-# Sub-directories to run make install into
-INSTALLSUBDIRS = $(DOCSUBDIRS)
-
-LIBOBJS = \
- controls/controls.o \
- dlls/comctl32/comctl32.o \
- dlls/psapi/psapi.o \
- dlls/shell32/shell32.o \
- dlls/winaspi/winaspi.o \
- dlls/wnaspi32/wnaspi32.o \
- files/files.o \
- graphics/graphics.o \
- graphics/metafiledrv/metafiledrv.o \
- graphics/x11drv/x11drv.o \
- ipc/ipc.o \
- loader/loader.o \
- loader/ne/ne.o \
- loader/dos/dos.o \
- memory/memory.o \
- misc/misc.o \
- msdos/msdos.o \
- multimedia/multimedia.o \
- objects/objects.o \
- ole/ole.o \
- relay32/relay32.o \
- resources/resources.o \
- scheduler/scheduler.o \
- server/server.o \
- tsx11/tsx11.o \
- win32/win32.o \
- windows/windows.o
-
-EMUOBJS = \
- debugger/debugger.o \
- graphics/psdrv/psdrv.o \
- graphics/win16drv/win16drv.o \
- if1632/if1632.o \
- miscemu/miscemu.o
-
-LIB_TARGET = @LIB_TARGET@
-
-ALT_LINK = @ALT_LINK@
-
-all: $(MAIN_TARGET)
+ tools
-@MAKE_RULES@
+# Sub-directories to install for install-lib
+INSTALLLIBSUBDIRS = \
+ documentation \
+ miscemu \
+ programs \
+ server
-install:: install_$(MAIN_TARGET)
+# Sub-directories to install for install-dev
+INSTALLDEVSUBDIRS = include tools
-uninstall:: uninstall_$(MAIN_TARGET)
+# Sub-directories to install for both install-lib and install-dev
+INSTALLBOTHSUBDIRS = dlls libs
-emu: wine
+INSTALLSUBDIRS = $(INSTALLDEVSUBDIRS) $(INSTALLLIBSUBDIRS)
-lib: $(LIBSUBDIRS) $(LIB_TARGET)
+# Sub-directories to run make test into
+TESTSUBDIRS = \
+ dlls \
+ programs
-wine wine.sym: $(LIBSUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
- $(CC) -o wine $(EMUOBJS) $(LIB_TARGET) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS)
- nm -n wine | grep -v _compiled >wine.sym
+all: Make.rules wine
+ @echo "Wine build complete."
+
+WINAPI_CHECK_EXTRA_FLAGS = --global
+
+@MAKE_RULES@
-libwine.a: $(LIBOBJS)
- $(RM) $@
- $(AR) $@ $(LIBOBJS)
- $(RANLIB) $@
+Make.rules: Make.rules.in configure
+ @echo $? is newer than 'Make.rules', please rerun ./configure!
+ @exit 1
-libwine.so.1.0: $(LIBOBJS)
- $(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS)
+wine: $(WINEWRAPPER)
+ $(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
-install_emu: install_lib
- [ -d $(bindir) ] || $(MKDIR) $(bindir)
- $(INSTALL_PROGRAM) wine $(bindir)/wine
- $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
+# Installation rules
-uninstall_emu: uninstall_lib
- $(RM) $(bindir)/wine $(bindir)/dosmod
+install-aclocal: dummy
+ $(MKINSTALLDIRS) $(datadir)/aclocal
+ $(INSTALL_DATA) $(SRCDIR)/aclocal.m4 $(datadir)/aclocal/wine.m4
-install_lib: install_includes
- [ -d $(libdir) ] || $(MKDIR) $(libdir)
- if [ $(LIB_TARGET) ]; then $(INSTALL_DATA) $(LIB_TARGET) $(libdir); fi
- $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
+install-lib:: $(INSTALLLIBSUBDIRS:%=%/__install__) $(INSTALLBOTHSUBDIRS:%=%/__install-lib__)
-uninstall_lib: uninstall_includes
- cd $(libdir); $(RM) $(LIB_TARGET)
- $(RM) $(libdir)/wine.sym
+install-dev:: $(INSTALLDEVSUBDIRS:%=%/__install__) $(INSTALLBOTHSUBDIRS:%=%/__install-dev__) install-aclocal
-install_includes: dummy
- [ -d $(includedir) ] || $(MKDIR) $(includedir)
- cd $(TOPSRCDIR)/include; $(INSTALL_DATA) windows.h wintypes.h $(includedir)
+install:: install-lib install-dev install-aclocal
+ -$(LDCONFIG)
+ @if test -n "`LANG=C $(LDD) $(bindir)/wine|grep not.found`"; \
+ then \
+ echo "*************************************************" ; \
+ echo "*************************************************" ; \
+ echo "The installed Wine libraries will not be found!" ; \
+ echo "You can either:" ; \
+ echo " Add the line '$(libdir)' to /etc/ld.so.conf and run /sbin/ldconfig" ; \
+ echo ' export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(libdir)' ; \
+ echo "*************************************************" ; \
+ echo "*************************************************" ; \
+ fi
-# Don't just do a rm -rf on $(includedir) -- don't want to wipe out
-# anything extra the user may have put there.
-uninstall_includes: dummy
- $(RM) $(includedir)/windows.h $(includedir)/wintypes.h
- -rmdir $(includedir)
+uninstall:: $(INSTALLBOTHSUBDIRS:%=%/__uninstall__)
+ $(RM) $(datadir)/aclocal/wine.m4
+ -rmdir $(datadir)/aclocal
-$(ALLSUBDIRS): dummy
- @cd $@; $(SUBMAKE)
+.PHONY: install-aclocal
-install_programs: dummy
- @cd programs; $(SUBMAKE) install
+# Dependencies between directories
-uninstall_programs: dummy
- @cd programs; $(SUBMAKE) uninstall
+all: $(SUBDIRS)
+dlls: libs tools
+server: libs tools
+miscemu programs: dlls libs tools
+tools: libs
-install::
- for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
+dlls/__install-lib__ dlls/__install-dev__: libs tools
+libs/__install-lib__ libs/__install-dev__: libs
+server/__install__: libs tools
+miscemu/__install__ programs/__install__: libs tools dlls/__install-lib__
+tools/__install__: tools
-uninstall::
- for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
+# Test rules
-depend:: dummy
- for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
+checklink:: $(TESTSUBDIRS:%=%/__checklink__)
+
+check test:: wine $(TESTSUBDIRS:%=%/__test__)
+
+crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
+
+# Misc rules
TAGS etags:
- etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
+ etags `find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.glue.c' -a -not -name '*.dbg.c' -print`
+
+tags ctags:
+ ctags --c-types=+px `find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.glue.c' -a -not -name '*.dbg.c' -print`
manpages:
- -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
- for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
+ $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/man3w
+ cd dlls && $(MAKE) man
htmlpages:
- -$(MKDIR) $(TOPOBJDIR)/documentation/html
- for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
+ $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/html
+ cd dlls && $(MAKE) doc-html
+
+sgmlpages:
+ $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/api-guide
+ cd dlls && $(MAKE) doc-sgml
clean::
- for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
- for i in include; do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
- $(RM) wine wine.sym libwine.a libwine.so.1.0 TAGS .#*
+ $(RM) wine
distclean: clean
- $(RM) config.* Make.rules include/config.h
+ $(RM) config.* configure.lineno TAGS tags Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules libs/Makelib.rules include/config.h
+ $(RM) -r autom4te.cache
$(RM) `find . \( -name Makefile -o -size 0 \) -print`
-configure: configure.in
- autoconf
-
-include/config.h.in: configure.in include/acconfig.h
- autoheader -l include
+.PHONY: manpages htmlpages distclean
### Dependencies: