1 # This Makefile understands the following targets:
3 # all (default): build wine
4 # clean: remove all intermediate files
5 # distclean: also remove all files created by configure
6 # install: install everything
7 # uninstall: uninstall everything
8 # depend: create the dependencies
9 # etags: create a TAGS file for Emacs.
10 # manpages: compile manpages for Wine API
15 TOPSRCDIR = @top_srcdir@
41 graphics/enhmetafiledrv \
42 graphics/metafiledrv \
72 PROGSUBDIRS = libtest programs
74 DOCSUBDIRS = documentation
81 windows/x11drv/wineclipsrv
83 # Sub-directories to run make into
93 # Sub-directories to run make depend into
94 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
96 # Sub-directories to run make install into
97 INSTALLSUBDIRS = $(DLLDIR) $(DOCSUBDIRS) $(INCSUBDIRS)
99 # Sub-directories to run make lint into
100 LINTSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
102 # Extra sub-directories to clean
103 CLEANSUBDIRS = dlls include include/bitmaps include/wine
106 controls/controls.o \
108 debugger/debugger.o \
109 dlls/advapi32/advapi32.o \
110 dlls/crtdll/crtdll.o \
111 dlls/display/display.o \
115 dlls/winaspi/winaspi.o \
118 graphics/graphics.o \
119 graphics/enhmetafiledrv/enhmetafiledrv.o \
120 graphics/metafiledrv/metafiledrv.o \
121 graphics/psdrv/psdrv.o \
122 graphics/ttydrv/ttydrv.o \
123 graphics/win16drv/win16drv.o \
134 resources/resources.o \
135 scheduler/scheduler.o \
138 windows/ttydrv/ttydrv.o
141 graphics/x11drv/x11drv.o \
143 windows/x11drv/x11drv.o
148 DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
150 EXTRA_OBJS = $(LIBOBJS) $(X11OBJS)
152 EMU_TARGET = @EMU_TARGET@
154 all: Make.rules $(PROGRAMS) $(EMU_TARGET)
155 @echo "Wine build complete."
157 LIBLINTS = $(LIBOBJS:.o=.ln)
158 X11LINTS = $(X11OBJS:.o=.ln)
159 EMULINTS = $(EMUOBJS:.o=.ln)
161 lint:: llib-lwine.ln $(EMULINTS)
162 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
164 WINAPI_CHECK_EXTRA_FLAGS = --global
168 all: lib$(MODULE).$(LIBEXT) $(DLLOBJS)
170 Make.rules: Make.rules.in configure
171 @echo $? is newer than 'Make.rules', please rerun ./configure!
174 wine wine.sym: lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(EMUOBJS)
175 $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
176 nm -n wine | grep -v _compiled >wine.sym
178 llib-lwine.ln : $(LIBLINTS) $(X11LINTS)
179 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(X11LINTS)
182 [ -d $(bindir) ] || $(MKDIR) $(bindir)
183 [ -d $(libdir) ] || $(MKDIR) $(libdir)
184 [ -f wine.sym ] && $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
185 $(INSTALL_PROGRAM) wine $(bindir)/wine
187 install:: $(PROGRAMS) $(EMU_TARGET:%=install_%)
188 [ -d $(bindir) ] || $(MKDIR) $(bindir)
189 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
190 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
191 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
194 cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION) wine.sym
195 cd $(bindir) && $(RM) wine wineserver wineclipsrv dosmod
197 $(X11OBJS) $(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS): $(TOOLSUBDIRS) dummy
198 @cd `dirname $@` && $(MAKE) `basename $@`
200 $(BUILDSUBDIRS): dummy
203 $(LIBLINTS) $(X11LINTS) $(EMULINTS): dummy
204 @echo $@ | sed 's%\(.*\)\/[^\/]*%cd \1 \&\& make lint%' | sh
206 install_programs: dummy
207 @cd programs && $(MAKE) install
209 uninstall_programs: dummy
210 @cd programs && $(MAKE) uninstall
213 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
217 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
220 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
223 @cd dlls && $(MAKE) checklink
226 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
229 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
230 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
233 -$(MKDIR) $(TOPOBJDIR)/documentation/html
234 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
237 for i in $(BUILDSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
238 for i in $(CLEANSUBDIRS); do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
239 $(RM) wine wine.sym libwine.so.1.0 TAGS .#*
242 $(RM) config.* Make.rules include/config.h documentation/wine.man documentation/wine.conf.man
243 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
245 # We depend on configure above for checks, so we better don't use this rule.
246 #configure: configure.in
249 include/config.h.in: configure.in include/acconfig.h
250 autoheader -l include