Release 980118
[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 # depend:               create the dependencies
9 # etags:                create a TAGS file for Emacs.
10 # manpages:             compile manpages for Wine API
11 #
12
13 # Main target to build
14
15 MAIN_TARGET = @MAIN_TARGET@
16 LIB_TARGET  = @LIB_TARGET@
17
18 # Directories
19
20 TOPSRCDIR = @top_srcdir@
21 TOPOBJDIR = .
22 SRCDIR    = @srcdir@
23 VPATH     = @srcdir@
24 MODULE    = none
25
26 LIBSUBDIRS = \
27         rc \
28         tools \
29         controls \
30         files \
31         graphics \
32         graphics/metafiledrv \
33         graphics/x11drv \
34         ipc \
35         library \
36         loader \
37         memory \
38         misc \
39         msdos \
40         multimedia \
41         objects \
42         ole \
43         resources \
44         scheduler \
45         win32 \
46         windows
47
48 EMUSUBDIRS = \
49         debugger \
50         graphics/win16drv \
51         if1632 \
52         miscemu \
53         relay32
54
55 PROGSUBDIRS = libtest programs
56
57 DOCSUBDIRS = documentation
58
59 # All sub-directories
60 ALLSUBDIRS = \
61         $(LIBSUBDIRS) \
62         $(EMUSUBDIRS) \
63         $(PROGSUBDIRS) \
64         $(DOCSUBDIRS)
65
66 # Sub-directories to run make depend into
67 DEPENDSUBDIRS = $(LIBSUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
68
69 # Sub-directories to run make install into
70 INSTALLSUBDIRS = $(DOCSUBDIRS)
71
72 LIBOBJS = \
73         controls/controls.o \
74         files/files.o \
75         graphics/graphics.o \
76         graphics/metafiledrv/metafiledrv.o \
77         graphics/x11drv/x11drv.o \
78         ipc/ipc.o \
79         loader/loader.o \
80         memory/memory.o \
81         misc/misc.o \
82         msdos/msdos.o \
83         multimedia/multimedia.o \
84         objects/objects.o \
85         ole/ole.o \
86         resources/resources.o \
87         scheduler/scheduler.o \
88         win32/win32.o \
89         windows/windows.o
90
91 EMUOBJS = \
92         debugger/debugger.o \
93         graphics/win16drv/win16drv.o \
94         if1632/if1632.o \
95         miscemu/miscemu.o \
96         relay32/relay32.o
97
98 all: $(MAIN_TARGET)
99
100 @MAKE_RULES@
101
102 install:: install_$(MAIN_TARGET)
103
104 emu: wine
105
106 lib: $(LIBSUBDIRS) $(LIB_TARGET)
107
108 wine wine.sym: $(LIBSUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
109         $(CC) -o wine $(EMUOBJS) $(LIB_TARGET) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS)
110         nm -n wine | grep -v _compiled >wine.sym
111
112 libwine.a: $(LIBOBJS)
113         $(RM) $@
114         $(AR) $@ $(LIBOBJS)
115         $(RANLIB) $@
116
117 libwine.so.1.0: $(LIBOBJS)
118         $(CC) -shared -Wl,-soname,libwine.so -o$@ $(LIBOBJS) $(LDOPTIONS) $(X_LIBS) $(XPM_LIB) $(XLIB) $(LIBS)
119
120 install_emu: dummy
121         $(INSTALL_PROGRAM) wine $(bindir)/wine
122
123 install_lib: install_includes
124         $(INSTALL_DATA) $(LIB_TARGET) $(libdir)
125
126 install_includes: dummy
127         if [ -d $(includedir) ]; then : ; else $(MKDIR) $(includedir); fi 
128         cd include; $(INSTALL_DATA) windows.h wintypes.h $(includedir)
129
130 $(ALLSUBDIRS): dummy
131         @cd $@; $(SUBMAKE)
132
133 install_programs: dummy
134         @cd programs; $(SUBMAKE) install
135
136 install::
137         for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
138
139 depend:: dummy
140         for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
141
142 TAGS etags:
143         etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
144
145 manpages:
146         -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
147         for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
148
149 clean::
150         for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
151         for i in include; do (cd $$i; $(RM) *.o \#*\# *~ *.bak *.orig *.rej *.flc); done
152         $(RM) wine wine.sym libwine.a libwine.so.1.0 TAGS
153
154 distclean: clean
155         $(RM) config.* Make.rules include/config.h
156         $(RM) `find . \( -name Makefile -o -size 0 \) -print`
157
158 configure: configure.in
159         autoconf
160
161 include/config.h.in: configure.in include/acconfig.h
162         autoheader -l include
163
164 ### Dependencies: