Fixed formatting of code
[wine] / Makefile.in
1 # This Makefile understands the following targets:
2 #
3 # all (default):        build wine
4 # lib:                  build libwine
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
12 #
13
14 # Main target to build
15
16 MAIN_TARGET = @MAIN_TARGET@
17
18 # Directories
19
20 TOPSRCDIR = @top_srcdir@
21 TOPOBJDIR = .
22 SRCDIR    = @srcdir@
23 VPATH     = @srcdir@
24 MODULE    = none
25
26 LIBSUBDIRS = \
27         tools \
28         tools/wrc \
29         controls \
30         console \
31         dlls/advapi32 \
32         dlls/comctl32 \
33         dlls/imagehlp \
34         dlls/msacm \
35         dlls/msacm32 \
36         dlls/ntdll \
37         dlls/psapi \
38         dlls/rasapi32 \
39         dlls/shell32 \
40         dlls/ver \
41         dlls/version \
42         dlls/winaspi \
43         dlls/wnaspi32 \
44         files \
45         graphics \
46         graphics/metafiledrv \
47         graphics/psdrv \
48         graphics/ttydrv \
49         ipc \
50         library \
51         loader \
52         loader/ne \
53         loader/dos \
54         memory \
55         misc \
56         msdos \
57         multimedia \
58         objects \
59         ole \
60         relay32 \
61         resources \
62         scheduler \
63         server \
64         win32 \
65         windows \
66         windows/ttydrv
67
68 X11SUBDIRS = \
69         graphics/x11drv \
70         tsx11 \
71         windows/x11drv
72
73 EMUSUBDIRS = \
74         debugger \
75         graphics/win16drv \
76         if1632 \
77         miscemu
78
79 PROGSUBDIRS = libtest programs
80
81 DOCSUBDIRS = documentation
82
83 # All sub-directories
84 ALLSUBDIRS = \
85         $(LIBSUBDIRS) \
86         $(X11SUBDIRS) \
87         $(EMUSUBDIRS) \
88         $(PROGSUBDIRS) \
89         $(DOCSUBDIRS)
90
91 # Sub-directories to run make depend into
92 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
93
94 # Sub-directories to run make install into
95 INSTALLSUBDIRS = $(DOCSUBDIRS)
96
97 LIBOBJS = \
98         controls/controls.o \
99         console/console.o \
100         dlls/advapi32/advapi32.o \
101         dlls/comctl32/comctl32.o \
102         dlls/imagehlp/imagehlp.o \
103         dlls/msacm/msacm.o \
104         dlls/msacm32/msacm32.o \
105         dlls/ntdll/ntdll.o \
106         dlls/psapi/psapi.o \
107         dlls/rasapi32/rasapi32.o \
108         dlls/shell32/shell32.o \
109         dlls/ver/ver.o \
110         dlls/version/version.o \
111         dlls/winaspi/winaspi.o \
112         dlls/wnaspi32/wnaspi32.o \
113         files/files.o \
114         graphics/graphics.o \
115         graphics/metafiledrv/metafiledrv.o \
116         graphics/psdrv/psdrv.o \
117         graphics/ttydrv/ttydrv.o \
118         ipc/ipc.o \
119         loader/loader.o \
120         loader/ne/ne.o \
121         loader/dos/dos.o \
122         memory/memory.o \
123         misc/misc.o \
124         msdos/msdos.o \
125         multimedia/multimedia.o \
126         objects/objects.o \
127         ole/ole.o \
128         relay32/relay32.o \
129         resources/resources.o \
130         scheduler/scheduler.o \
131         server/server.o \
132         win32/win32.o \
133         windows/windows.o \
134         windows/ttydrv/ttydrv.o
135
136 X11OBJS = \
137         graphics/x11drv/x11drv.o \
138         tsx11/tsx11.o \
139         windows/x11drv/x11drv.o
140
141 EMUOBJS = \
142         debugger/debugger.o \
143         graphics/win16drv/win16drv.o \
144         if1632/if1632.o \
145         miscemu/miscemu.o
146
147 LIB_TARGET  = @LIB_TARGET@
148
149 ALT_LINK    = @ALT_LINK@
150
151 all: Makefile Make.rules $(MAIN_TARGET)
152
153 @MAKE_RULES@
154
155 Make.rules: Make.rules.in configure
156         @echo $? is newer than 'Make.rules', please rerun ./configure!
157         @exit 1
158
159 install:: install_$(MAIN_TARGET)
160
161 uninstall:: uninstall_$(MAIN_TARGET)
162
163 emu: wine
164
165 lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
166
167 wine wine.sym: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
168         $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
169         nm -n wine | grep -v _compiled >wine.sym
170         @echo "Wine build complete."
171
172 libwine.a: $(LIBOBJS) $(X11OBJS)
173         $(RM) $@
174         $(AR) $@ $(LIBOBJS) $(X11OBJS)
175         $(RANLIB) $@
176
177 libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
178         $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
179         ln -sf $@ libwine.so
180
181 install_emu: install_lib
182         [ -d $(bindir) ] || $(MKDIR) $(bindir)
183         $(INSTALL_PROGRAM) wine $(bindir)/wine
184         $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
185
186 uninstall_emu: uninstall_lib
187         $(RM) $(bindir)/wine $(bindir)/dosmod
188
189 install_lib: install_includes
190         [ -d $(libdir) ] || $(MKDIR) $(libdir)
191         if [ $(LIB_TARGET) ]; then $(INSTALL_DATA) $(LIB_TARGET) $(libdir); fi
192         $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
193
194 uninstall_lib: uninstall_includes
195         cd $(libdir); $(RM) $(LIB_TARGET)
196         $(RM) $(libdir)/wine.sym
197
198 install_includes: dummy
199 # Testing LIB_TARGET prevents installing header files
200 # when --disable-lib is used.
201         if [ $(LIB_TARGET) ]; then [ -d $(includedir) ] || $(MKDIR) $(includedir); \
202         cd $(TOPSRCDIR)/include; $(INSTALL_DATA) windows.h wintypes.h $(includedir); fi
203
204 # Don't just do a rm -rf on $(includedir) -- don't want to wipe out 
205 # anything extra the user may have put there.
206 uninstall_includes: dummy
207         $(RM) $(includedir)/windows.h $(includedir)/wintypes.h
208         -rmdir $(includedir)
209
210 $(ALLSUBDIRS): dummy
211         @cd $@; $(SUBMAKE)
212
213 install_programs: dummy
214         @cd programs; $(SUBMAKE) install
215
216 uninstall_programs: dummy
217         @cd programs; $(SUBMAKE) uninstall
218
219 install::
220         for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
221
222 uninstall::
223         for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
224
225 depend:: dummy
226         for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
227
228 TAGS etags:
229         etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
230
231 manpages:
232         -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
233         for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
234
235 htmlpages:
236         -$(MKDIR) $(TOPOBJDIR)/documentation/html
237         for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
238
239 clean::
240         for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
241         for i in include; do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
242         $(RM) wine wine.sym libwine.a libwine.so.1.0 libwine.so TAGS .#*
243
244 distclean: clean
245         $(RM) config.* Make.rules include/config.h
246         $(RM) `find . \( -name Makefile -o -size 0 \) -print`
247
248 # We depend on configure above for checks, so we better don't use this rule.
249 #configure: configure.in
250 #       autoconf
251
252 include/config.h.in: configure.in include/acconfig.h
253         autoheader -l include
254
255 ### Dependencies: