Move some fields (refCount, tls_index and module) from WINE_MODREF to
[wine] / Makefile.in
1 # This Makefile understands the following targets:
2 #
3 # all (default):   build wine
4 # clean:           remove all intermediate files
5 # distclean:       also remove all files created by configure
6 # test:            run tests
7 # testclean:       clean test results to force running all tests again
8 # install-lib:     install libraries needed to run applications
9 # install-dev:     install development environment
10 # install:         install everything
11 # uninstall:       uninstall everything
12 # depend:          create the dependencies
13 # etags:           create a TAGS file for Emacs.
14 # manpages:        compile manpages for Wine API
15 # htmlpages:       compile html pages for Wine API
16 # sgmlpages:       compile sqml source for the Wine API Guide
17
18 # Directories
19
20 TOPSRCDIR = @top_srcdir@
21 TOPOBJDIR = .
22 SRCDIR    = @srcdir@
23 VPATH     = @srcdir@
24 LIBEXT    = @LIBEXT@
25 LDCONFIG  = @LDCONFIG@
26 LDD       = @LDD@
27 MODULE    = none
28
29 # Sub-directories to run make depend/clean into
30 SUBDIRS = \
31         dlls \
32         documentation \
33         include \
34         library \
35         libs \
36         miscemu \
37         programs \
38         server \
39         tools \
40         unicode
41
42 # Sub-directories to install for install-lib
43 INSTALLLIBSUBDIRS = \
44         documentation \
45         library \
46         miscemu \
47         programs \
48         server \
49         unicode
50
51 # Sub-directories to install for install-dev
52 INSTALLDEVSUBDIRS = include tools
53
54 # Sub-directories to install for both install-lib and install-dev
55 INSTALLBOTHSUBDIRS = dlls libs
56
57 INSTALLSUBDIRS = $(INSTALLDEVSUBDIRS) $(INSTALLLIBSUBDIRS)
58
59 # Sub-directories to run make test into
60 TESTSUBDIRS = \
61         dlls \
62         programs
63
64 all: Make.rules wine
65         @echo "Wine build complete."
66
67 WINAPI_CHECK_EXTRA_FLAGS = --global
68
69 @MAKE_RULES@
70
71 Make.rules: Make.rules.in configure
72         @echo $? is newer than 'Make.rules', please rerun ./configure!
73         @exit 1
74
75 wine: $(WINEWRAPPER)
76         $(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
77
78 # Installation rules
79
80 install-aclocal: dummy
81         $(MKINSTALLDIRS) $(datadir)/aclocal
82         $(INSTALL_DATA) $(SRCDIR)/aclocal.m4 $(datadir)/aclocal/wine.m4
83
84 install-lib:: $(INSTALLLIBSUBDIRS:%=%/__install__) $(INSTALLBOTHSUBDIRS:%=%/__install-lib__)
85
86 install-dev:: $(INSTALLDEVSUBDIRS:%=%/__install__) $(INSTALLBOTHSUBDIRS:%=%/__install-dev__) install-aclocal
87
88 install:: install-lib install-dev install-aclocal
89         -$(LDCONFIG)
90         @if test -n "`LANG=C $(LDD) $(bindir)/wine|grep not.found`";    \
91         then                                                            \
92                 echo "*************************************************" ; \
93                 echo "*************************************************" ; \
94                 echo "The installed Wine libraries will not be found!" ; \
95                 echo "You can either:" ;                                \
96                 echo "   Add the line '$(libdir)' to /etc/ld.so.conf" ; \
97                 echo '   export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(libdir)' ; \
98                 echo "*************************************************" ; \
99                 echo "*************************************************" ; \
100         fi
101
102 uninstall:: $(INSTALLBOTHSUBDIRS:%=%/__uninstall__)
103         $(RM) $(datadir)/aclocal/wine.m4
104         -rmdir $(datadir)/aclocal
105
106 $(INSTALLBOTHSUBDIRS:%=%/__install-lib__): dummy
107         cd `dirname $@` && $(MAKE) install-lib
108
109 $(INSTALLBOTHSUBDIRS:%=%/__install-dev__): dummy
110         cd `dirname $@` && $(MAKE) install-dev
111
112 $(INSTALLBOTHSUBDIRS:%=%/__uninstall__): dummy
113         cd `dirname $@` && $(MAKE) uninstall
114
115 .PHONY: install-aclocal $(INSTALLBOTHSUBDIRS:%=%/__install-lib__) $(INSTALLBOTHSUBDIRS:%=%/__install-dev__) $(INSTALLBOTHSUBDIRS:%=%/__uninstall__)
116
117 # Dependencies between directories
118
119 all: $(SUBDIRS)
120 dlls: library libs tools unicode
121 server: library libs tools unicode
122 miscemu programs: dlls library libs tools unicode
123 tools: library libs unicode
124
125 dlls/__install-lib__ dlls/__install-dev__: library libs tools unicode
126 server/__install__: library libs tools unicode
127 miscemu/__install__ programs/__install__: library libs tools unicode dlls/__install-lib__
128 library/__install__: library
129 libs/__install__: libs
130 tools/__install__: tools
131 unicode/__install__: unicode
132
133 # Test rules
134
135 checklink:: $(TESTSUBDIRS:%=%/__checklink__)
136         $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c && $(RM) checklink
137
138 check test:: wine $(TESTSUBDIRS:%=%/__test__)
139
140 crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)
141
142 # Misc rules
143
144 TAGS etags:
145         etags `find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.glue.c' -a -not -name '*.dbg.c' -print`
146
147 tags ctags:
148         ctags --c-types=+px `find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.glue.c' -a -not -name '*.dbg.c' -print`
149
150 manpages:
151         $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/man3w
152         for i in $(SUBDIRS); do (cd $$i && $(MAKE) man); done
153
154 htmlpages:
155         $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/html
156         cd dlls && $(MAKE) doc-html
157
158 sgmlpages:
159         $(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/api-guide
160         cd dlls && $(MAKE) doc-sgml
161
162 clean::
163         $(RM) wine
164
165 distclean: clean
166         $(RM) config.* configure.lineno TAGS tags Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules include/config.h
167         $(RM) -r autom4te.cache
168         $(RM) `find . \( -name Makefile -o -size 0 \) -print`
169
170 .PHONY: manpages htmlpages distclean
171
172 ### Dependencies: