HICON and HCURSOR should be interchangeable.
[wine] / Makefile.in
index cc871c4..e483b92 100644 (file)
@@ -1,7 +1,6 @@
 # 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
 # manpages:            compile manpages for Wine API
 #
 
-# Main target to build
-
-MAIN_TARGET = @MAIN_TARGET@
-
 # Directories
 
 TOPSRCDIR = @top_srcdir@
 TOPOBJDIR = .
 SRCDIR    = @srcdir@
 VPATH     = @srcdir@
-MODULE    = none
-
-LIBSUBDIRS = \
-       tools \
-       tools/wrc \
-       controls \
-       dlls/comctl32 \
-       dlls/imagehlp \
-       dlls/msacm \
-       dlls/msacm32 \
-       dlls/ntdll \
-       dlls/psapi \
-       dlls/shell32 \
-       dlls/winaspi \
-       dlls/wnaspi32 \
-       files \
-       graphics \
-       graphics/metafiledrv \
-       ipc \
+LIBEXT    = @LIBEXT@
+LDCONFIG  = @LDCONFIG@
+MODULE    = wine
+IMPORTS   = ntdll
+
+# Stand-alone programs
+PROGRAMS = \
+       loader/dos/dosmod \
+       server/wineserver
+
+# Programs that link with libwine
+LIBPROGRAMS = \
+       debugger/winedbg
+
+# Libraries (not dlls) to build
+LIBRARIES = \
+       library/libwine.$(LIBEXT) \
+       unicode/libwine_unicode.$(LIBEXT)
+
+# Sub-directories to run make depend/clean into
+SUBDIRS = \
+       debugger \
+       dlls \
+       documentation \
+       include \
        library \
-       loader \
-       loader/ne \
-       loader/dos \
-       memory \
-       misc \
-       msdos \
-       multimedia \
-       objects \
-       ole \
-       relay32 \
-       resources \
-       scheduler \
+       libtest \
+       miscemu \
+       programs \
        server \
-       win32 \
-       windows
-
-X11SUBDIRS = \
-       graphics/x11drv \
-       tsx11 \
-       windows/x11drv
-
-EMUSUBDIRS = \
-       debugger \
-       graphics/psdrv \
-       graphics/win16drv \
-       if1632 \
-       miscemu
-
-PROGSUBDIRS = libtest programs
-
-DOCSUBDIRS = documentation
-
-# All sub-directories
-ALLSUBDIRS = \
-       $(LIBSUBDIRS) \
-       $(X11SUBDIRS) \
-       $(EMUSUBDIRS) \
-       $(PROGSUBDIRS) \
-       $(DOCSUBDIRS)
-
-# Sub-directories to run make depend into
-DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
+       tools \
+       unicode
 
 # Sub-directories to run make install into
-INSTALLSUBDIRS = $(DOCSUBDIRS)
-
-LIBOBJS = \
-       controls/controls.o \
-       dlls/comctl32/comctl32.o \
-       dlls/imagehlp/imagehlp.o \
-       dlls/msacm/msacm.o \
-       dlls/msacm32/msacm32.o \
-       dlls/ntdll/ntdll.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 \
-       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 \
-       win32/win32.o \
-       windows/windows.o
-
-X11OBJS = \
-       graphics/x11drv/x11drv.o \
-       tsx11/tsx11.o \
-       windows/x11drv/x11drv.o
+INSTALLSUBDIRS = \
+       debugger \
+       dlls \
+       documentation \
+       include \
+       library \
+       server \
+       tools \
+       unicode
 
 EMUOBJS = \
-       debugger/debugger.o \
-       graphics/psdrv/psdrv.o \
-       graphics/win16drv/win16drv.o \
-       if1632/if1632.o \
        miscemu/miscemu.o
 
-LIB_TARGET  = @LIB_TARGET@
+DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
 
-ALT_LINK    = @ALT_LINK@
+all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) wine
+       @echo "Wine build complete."
 
-all: $(MAIN_TARGET)
+WINAPI_CHECK_EXTRA_FLAGS = --global
 
 @MAKE_RULES@
 
-install:: install_$(MAIN_TARGET)
+Make.rules: Make.rules.in configure
+       @echo $? is newer than 'Make.rules', please rerun ./configure!
+       @exit 1
 
-uninstall:: uninstall_$(MAIN_TARGET)
+wine: libwine.$(LIBEXT) libwine_unicode.$(LIBEXT) dlls $(EMUOBJS)
+       $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LIBS) $(LDFLAGS)
 
-emu: wine
+install:: all $(INSTALLSUBDIRS:%=%/__install__)
+       [ -d $(bindir) ] || $(MKDIR) $(bindir)
+       $(INSTALL_PROGRAM) wine $(bindir)/wine
+       $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
+       -$(LDCONFIG)
 
-lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
+uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__)
+       cd $(bindir) && $(RM) wine dosmod
 
-wine wine.sym: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
-       $(CC) -o wine $(EMUOBJS) $(LIB_TARGET) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
-       nm -n wine | grep -v _compiled >wine.sym
-       @echo "Wine build complete."
+$(EMUOBJS) $(DLLOBJS) $(PROGRAMS) $(LIBPROGRAMS) $(LIBRARIES): dummy
+       @cd `dirname $@` && $(MAKE) `basename $@`
 
-libwine.a: $(LIBOBJS) $(X11OBJS)
-       $(RM) $@
-       $(AR) $@ $(LIBOBJS) $(X11OBJS)
-       $(RANLIB) $@
+libwine.$(LIBEXT): library/libwine.$(LIBEXT)
+       $(RM) $@ && $(LN_S) library/libwine.$(LIBEXT) $@
 
-libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
-       $(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
+libwine_unicode.$(LIBEXT): unicode/libwine_unicode.$(LIBEXT)
+       $(RM) $@ && $(LN_S) unicode/libwine_unicode.$(LIBEXT) $@
 
-install_emu: install_lib
-       [ -d $(bindir) ] || $(MKDIR) $(bindir)
-       $(INSTALL_PROGRAM) wine $(bindir)/wine
-       $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
+# Dependencies between directories
 
-uninstall_emu: uninstall_lib
-       $(RM) $(bindir)/wine $(bindir)/dosmod
+$(DLLOBJS) $(PROGRAMS): tools
 
-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
+$(EMUOBJS): tools dlls
 
-uninstall_lib: uninstall_includes
-       cd $(libdir); $(RM) $(LIB_TARGET)
-       $(RM) $(libdir)/wine.sym
+$(LIBPROGRAMS): tools dlls libwine.$(LIBEXT) libwine_unicode.$(LIBEXT)
 
-install_includes: dummy
-       [ -d $(includedir) ] || $(MKDIR) $(includedir)
-       cd $(TOPSRCDIR)/include; $(INSTALL_DATA) windows.h wintypes.h $(includedir)
+server tools: libwine_unicode.$(LIBEXT)
 
-# 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)
+dlls: tools libwine.$(LIBEXT) libwine_unicode.$(LIBEXT)
 
-$(ALLSUBDIRS): dummy
-       @cd $@; $(SUBMAKE)
+checklink::
+       $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine -lwine_unicode $(LIBS) && $(RM) checklink
 
 install_programs: dummy
-       @cd programs; $(SUBMAKE) install
+       @cd programs && $(MAKE) install
 
 uninstall_programs: dummy
-       @cd programs; $(SUBMAKE) uninstall
-
-install::
-       for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
-
-uninstall::
-       for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
+       @cd programs && $(MAKE) uninstall
 
-depend:: dummy
-       for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
+checklink::
+       @cd dlls && $(MAKE) checklink
 
 TAGS etags:
        etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
 
 manpages:
        -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
-       for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
+       for i in $(SUBDIRS); do (cd $$i && $(MAKE) man); done
 
 htmlpages:
        -$(MKDIR) $(TOPOBJDIR)/documentation/html
-       for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
+       for i in $(SUBDIRS); do (cd $$i && $(MAKE) html); done
 
 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.* TAGS Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man tools/winelauncher
        $(RM) `find . \( -name Makefile -o -size 0 \) -print`
 
-configure: configure.in
-       autoconf
+# We depend on configure above for checks, so we better don't use this rule.
+#configure: configure.in
+#      autoconf
 
 include/config.h.in: configure.in include/acconfig.h
        autoheader -l include