Authors: Chris Morgan <cmorgan@wpi.edu>, James Abbatiello <abbeyj@wpi.edu>
[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/avifil32 \
33         dlls/comctl32 \
34         dlls/commdlg \
35         dlls/imagehlp \
36         dlls/msacm \
37         dlls/msacm32 \
38         dlls/ntdll \
39         dlls/psapi \
40         dlls/rasapi32 \
41         dlls/shell32 \
42         dlls/tapi32 \
43         dlls/ver \
44         dlls/version \
45         dlls/winaspi \
46         dlls/winspool \
47         dlls/wnaspi32 \
48         files \
49         graphics \
50         graphics/enhmetafiledrv \
51         graphics/metafiledrv \
52         graphics/psdrv \
53         graphics/ttydrv \
54         ipc \
55         library \
56         loader \
57         loader/ne \
58         loader/dos \
59         memory \
60         misc \
61         msdos \
62         multimedia \
63         objects \
64         ole \
65         relay32 \
66         resources \
67         scheduler \
68         server \
69         win32 \
70         windows \
71         windows/ttydrv
72
73 X11SUBDIRS = \
74         graphics/x11drv \
75         tsx11 \
76         windows/x11drv
77
78 EMUSUBDIRS = \
79         debugger \
80         graphics/win16drv \
81         if1632 \
82         miscemu
83
84 PROGSUBDIRS = libtest programs
85
86 DOCSUBDIRS = documentation
87
88 INCSUBDIRS = include
89
90 # Sub-directories to run make into
91 BUILDSUBDIRS = \
92         $(LIBSUBDIRS) \
93         $(X11SUBDIRS) \
94         $(EMUSUBDIRS) \
95         $(PROGSUBDIRS) \
96         $(DOCSUBDIRS)
97
98 # Sub-directories to run make depend into
99 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
100
101 # Sub-directories to run make install into
102 INSTALLSUBDIRS = $(DOCSUBDIRS) $(INCSUBDIRS)
103
104 LIBOBJS = \
105         controls/controls.o \
106         console/console.o \
107         dlls/advapi32/advapi32.o \
108         dlls/avifil32/avifil32.o \
109         dlls/comctl32/comctl32.o \
110         dlls/commdlg/commdlg.o \
111         dlls/imagehlp/imagehlp.o \
112         dlls/msacm/msacm.o \
113         dlls/msacm32/msacm32.o \
114         dlls/ntdll/ntdll.o \
115         dlls/psapi/psapi.o \
116         dlls/rasapi32/rasapi32.o \
117         dlls/shell32/shell32.o \
118         dlls/tapi32/tapi32.o \
119         dlls/ver/ver.o \
120         dlls/version/version.o \
121         dlls/winaspi/winaspi.o \
122         dlls/winspool/winspool.o \
123         dlls/wnaspi32/wnaspi32.o \
124         files/files.o \
125         graphics/graphics.o \
126         graphics/enhmetafiledrv/enhmetafiledrv.o \
127         graphics/metafiledrv/metafiledrv.o \
128         graphics/psdrv/psdrv.o \
129         graphics/ttydrv/ttydrv.o \
130         ipc/ipc.o \
131         loader/loader.o \
132         loader/ne/ne.o \
133         loader/dos/dos.o \
134         memory/memory.o \
135         misc/misc.o \
136         msdos/msdos.o \
137         multimedia/multimedia.o \
138         objects/objects.o \
139         ole/ole.o \
140         relay32/relay32.o \
141         resources/resources.o \
142         scheduler/scheduler.o \
143         server/server.o \
144         win32/win32.o \
145         windows/windows.o \
146         windows/ttydrv/ttydrv.o
147
148 X11OBJS = \
149         graphics/x11drv/x11drv.o \
150         tsx11/tsx11.o \
151         windows/x11drv/x11drv.o
152
153 EMUOBJS = \
154         debugger/debugger.o \
155         graphics/win16drv/win16drv.o \
156         if1632/if1632.o \
157         miscemu/miscemu.o
158
159 LIB_TARGET  = @LIB_TARGET@
160
161 ALT_LINK    = @ALT_LINK@
162
163 all: Makefile Make.rules $(MAIN_TARGET)
164
165 @MAKE_RULES@
166
167 Make.rules: Make.rules.in configure
168         @echo $? is newer than 'Make.rules', please rerun ./configure!
169         @exit 1
170
171 install:: install_$(MAIN_TARGET)
172
173 uninstall:: uninstall_$(MAIN_TARGET)
174
175 emu: wine
176
177 lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
178
179 wine wine.sym: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
180         $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
181         nm -n wine | grep -v _compiled >wine.sym
182         @echo "Wine build complete."
183
184 libwine.a: $(LIBOBJS) $(X11OBJS)
185         $(RM) $@
186         $(AR) $@ $(LIBOBJS) $(X11OBJS)
187         $(RANLIB) $@
188
189 libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
190         $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
191         ln -sf $@ libwine.so
192
193 install_emu: install_lib
194         [ -d $(bindir) ] || $(MKDIR) $(bindir)
195         $(INSTALL_PROGRAM) wine $(bindir)/wine
196         $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
197
198 uninstall_emu: uninstall_lib
199         $(RM) $(bindir)/wine $(bindir)/dosmod
200
201 install_lib: dummy
202         [ -d $(libdir) ] || $(MKDIR) $(libdir)
203         if [ $(LIB_TARGET) ]; then $(INSTALL_DATA) $(LIB_TARGET) $(libdir); fi
204         if [ -f wine.sym ]; then $(INSTALL_DATA) wine.sym $(libdir)/wine.sym; fi
205         if [ $(LIB_TARGET) = libwine.so.1.0 ]; then ldconfig; fi
206
207 uninstall_lib: dummy
208         cd $(libdir); $(RM) $(LIB_TARGET) libwine.a libwine.so wine.sym
209
210 $(BUILDSUBDIRS): 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 $(BUILDSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
241         for i in include include/bitmaps include/server include/wine; 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: