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 \
65 PROGSUBDIRS = libtest programs
67 DOCSUBDIRS = documentation
74 windows/x11drv/wineclipsrv
76 # Sub-directories to run make into
85 # Sub-directories to run make depend into
86 DEPENDSUBDIRS = $(LIBSUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
88 # Sub-directories to run make install into
89 INSTALLSUBDIRS = $(DLLDIR) $(DOCSUBDIRS) $(INCSUBDIRS)
91 # Sub-directories to run make lint into
92 LINTSUBDIRS = $(LIBSUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
94 # Extra sub-directories to clean
95 CLEANSUBDIRS = dlls include include/bitmaps include/wine tools/cvdump
100 debugger/debugger.o \
101 dlls/advapi32/advapi32.o \
102 dlls/crtdll/crtdll.o \
103 dlls/display/display.o \
107 graphics/graphics.o \
108 graphics/enhmetafiledrv/enhmetafiledrv.o \
109 graphics/metafiledrv/metafiledrv.o \
110 graphics/psdrv/psdrv.o \
111 graphics/win16drv/win16drv.o \
122 resources/resources.o \
123 scheduler/scheduler.o \
130 DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
132 EXTRA_OBJS = $(LIBOBJS)
134 EMU_TARGET = @EMU_TARGET@
136 all: Make.rules $(PROGRAMS) $(EMU_TARGET)
137 @echo "Wine build complete."
139 LIBLINTS = $(LIBOBJS:.o=.ln)
140 EMULINTS = $(EMUOBJS:.o=.ln)
142 lint:: llib-lwine.ln $(EMULINTS)
143 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
145 WINAPI_CHECK_EXTRA_FLAGS = --global
149 all: lib$(MODULE).$(LIBEXT) $(DLLOBJS)
151 Make.rules: Make.rules.in configure
152 @echo $? is newer than 'Make.rules', please rerun ./configure!
155 wine wine.sym: lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(EMUOBJS)
156 $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
157 nm -n wine | grep -v _compiled >wine.sym
159 llib-lwine.ln : $(LIBLINTS)
160 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
162 install_so: lib$(MODULE).so.$(SOVERSION)
163 [ -d $(libdir) ] || $(MKDIR) $(libdir)
164 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
165 cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
167 install_a: lib$(MODULE).a
168 [ -d $(libdir) ] || $(MKDIR) $(libdir)
169 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
172 [ -d $(bindir) ] || $(MKDIR) $(bindir)
173 [ -d $(libdir) ] || $(MKDIR) $(libdir)
174 [ -f wine.sym ] && $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
175 $(INSTALL_PROGRAM) wine $(bindir)/wine
177 install:: $(PROGRAMS) $(EMU_TARGET:%=install_%) $(LIBEXT:%=install_%)
178 [ -d $(bindir) ] || $(MKDIR) $(bindir)
179 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
180 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
181 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
184 cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION) wine.sym
185 cd $(bindir) && $(RM) wine wineserver wineclipsrv dosmod
187 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in
188 $(LDSHARED) $(OBJS) -o $@
190 lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION)
191 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
193 lib$(MODULE).a: $(OBJS) Makefile.in Make.rules.in
199 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink
201 $(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS): $(TOOLSUBDIRS) dummy
202 @cd `dirname $@` && $(MAKE) `basename $@`
204 $(BUILDSUBDIRS): dummy
207 $(LIBLINTS) $(EMULINTS): dummy
208 @cd `dirname $@` && $(MAKE) lint
210 install_programs: dummy
211 @cd programs && $(MAKE) install
213 uninstall_programs: dummy
214 @cd programs && $(MAKE) uninstall
217 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
221 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
224 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
227 @cd dlls && $(MAKE) checklink
230 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
233 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
234 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
237 -$(MKDIR) $(TOPOBJDIR)/documentation/html
238 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
241 for i in $(BUILDSUBDIRS); do (cd $$i && $(MAKE) clean) || exit 1; done
242 for i in $(CLEANSUBDIRS); do (cd $$i && $(RM) $(CLEAN_FILES)); done
243 $(RM) wine wine.sym libwine.so.1.0 TAGS
246 $(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man
247 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
249 # We depend on configure above for checks, so we better don't use this rule.
250 #configure: configure.in
253 include/config.h.in: configure.in include/acconfig.h
254 autoheader -l include