1 # This Makefile understands the following targets:
3 # all (default): build wine
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
14 # Main target to build
16 MAIN_TARGET = @MAIN_TARGET@
20 TOPSRCDIR = @top_srcdir@
44 graphics/metafiledrv \
76 PROGSUBDIRS = libtest programs
78 DOCSUBDIRS = documentation
88 # Sub-directories to run make depend into
89 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
91 # Sub-directories to run make install into
92 INSTALLSUBDIRS = $(DOCSUBDIRS)
97 dlls/advapi32/advapi32.o \
98 dlls/comctl32/comctl32.o \
99 dlls/imagehlp/imagehlp.o \
101 dlls/msacm32/msacm32.o \
104 dlls/rasapi32/rasapi32.o \
105 dlls/shell32/shell32.o \
106 dlls/winaspi/winaspi.o \
107 dlls/wnaspi32/wnaspi32.o \
109 graphics/graphics.o \
110 graphics/metafiledrv/metafiledrv.o \
111 graphics/psdrv/psdrv.o \
119 multimedia/multimedia.o \
123 resources/resources.o \
124 scheduler/scheduler.o \
128 windows/ttydrv/ttydrv.o
131 graphics/x11drv/x11drv.o \
133 windows/x11drv/x11drv.o
136 debugger/debugger.o \
137 graphics/win16drv/win16drv.o \
141 LIB_TARGET = @LIB_TARGET@
143 ALT_LINK = @ALT_LINK@
145 all: Makefile Make.rules $(MAIN_TARGET)
149 Make.rules: Make.rules.in configure
150 @echo $? is newer than 'Make.rules', please rerun ./configure!
153 install:: install_$(MAIN_TARGET)
155 uninstall:: uninstall_$(MAIN_TARGET)
159 lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
161 wine wine.sym: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET) $(EMUSUBDIRS) dummy
162 $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
163 nm -n wine | grep -v _compiled >wine.sym
164 @echo "Wine build complete."
166 libwine.a: $(LIBOBJS) $(X11OBJS)
168 $(AR) $@ $(LIBOBJS) $(X11OBJS)
171 libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
172 $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
175 install_emu: install_lib
176 [ -d $(bindir) ] || $(MKDIR) $(bindir)
177 $(INSTALL_PROGRAM) wine $(bindir)/wine
178 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
180 uninstall_emu: uninstall_lib
181 $(RM) $(bindir)/wine $(bindir)/dosmod
183 install_lib: install_includes
184 [ -d $(libdir) ] || $(MKDIR) $(libdir)
185 if [ $(LIB_TARGET) ]; then $(INSTALL_DATA) $(LIB_TARGET) $(libdir); fi
186 $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
188 uninstall_lib: uninstall_includes
189 cd $(libdir); $(RM) $(LIB_TARGET)
190 $(RM) $(libdir)/wine.sym
192 install_includes: dummy
193 [ -d $(includedir) ] || $(MKDIR) $(includedir)
194 cd $(TOPSRCDIR)/include; $(INSTALL_DATA) windows.h wintypes.h $(includedir)
196 # Don't just do a rm -rf on $(includedir) -- don't want to wipe out
197 # anything extra the user may have put there.
198 uninstall_includes: dummy
199 $(RM) $(includedir)/windows.h $(includedir)/wintypes.h
205 install_programs: dummy
206 @cd programs; $(SUBMAKE) install
208 uninstall_programs: dummy
209 @cd programs; $(SUBMAKE) uninstall
212 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
215 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
218 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
221 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
224 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
225 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
228 -$(MKDIR) $(TOPOBJDIR)/documentation/html
229 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
232 for i in $(ALLSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
233 for i in include; do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
234 $(RM) wine wine.sym libwine.a libwine.so.1.0 libwine.so TAGS .#*
237 $(RM) config.* Make.rules include/config.h
238 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
240 # We depend on configure above for checks, so we better don't use this rule.
241 #configure: configure.in
244 include/config.h.in: configure.in include/acconfig.h
245 autoheader -l include