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@
38 graphics/enhmetafiledrv \
39 graphics/metafiledrv \
67 DOCSUBDIRS = documentation
71 # Stand-alone programs
75 windows/x11drv/wineclipsrv
77 # Programs that link with libwine
81 # Sub-directories to run make into
91 # Sub-directories to run make install into
92 INSTALLSUBDIRS = $(DLLDIR) $(DOCSUBDIRS) $(INCSUBDIRS)
94 # Sub-directories to run make lint into
95 LINTSUBDIRS = $(LIBSUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
100 dlls/advapi32/advapi32.o \
101 dlls/crtdll/crtdll.o \
102 dlls/display/display.o \
106 graphics/graphics.o \
107 graphics/enhmetafiledrv/enhmetafiledrv.o \
108 graphics/metafiledrv/metafiledrv.o \
109 graphics/psdrv/psdrv.o \
110 graphics/win16drv/win16drv.o \
121 resources/resources.o \
122 scheduler/scheduler.o \
129 DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
131 EXTRA_OBJS = $(LIBOBJS)
133 EMU_TARGET = @EMU_TARGET@
135 all: Make.rules $(PROGRAMS) $(LIBPROGRAMS) $(EMU_TARGET)
136 @echo "Wine build complete."
138 LIBLINTS = $(LIBOBJS:.o=.ln)
139 EMULINTS = $(EMUOBJS:.o=.ln)
141 lint:: llib-lwine.ln $(EMULINTS)
142 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
144 WINAPI_CHECK_EXTRA_FLAGS = --global
148 all: lib$(MODULE).$(LIBEXT) $(DLLOBJS)
150 Make.rules: Make.rules.in configure
151 @echo $? is newer than 'Make.rules', please rerun ./configure!
154 wine wine.sym: lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(EMUOBJS)
155 $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
156 nm -n wine | grep -v _compiled >wine.sym
158 llib-lwine.ln : $(LIBLINTS)
159 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
161 install_so: lib$(MODULE).so.$(SOVERSION)
162 [ -d $(libdir) ] || $(MKDIR) $(libdir)
163 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
164 cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
166 install_a: lib$(MODULE).a
167 [ -d $(libdir) ] || $(MKDIR) $(libdir)
168 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
171 [ -d $(bindir) ] || $(MKDIR) $(bindir)
172 [ -d $(libdir) ] || $(MKDIR) $(libdir)
173 [ -f wine.sym ] && $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
174 $(INSTALL_PROGRAM) wine $(bindir)/wine
176 install:: $(PROGRAMS) $(LIBPROGRAMS) $(EMU_TARGET:%=install_%) $(LIBEXT:%=install_%)
177 [ -d $(bindir) ] || $(MKDIR) $(bindir)
178 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
179 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
180 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
181 $(INSTALL_PROGRAM) debugger/winedbg $(bindir)/winedbg
184 cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION) wine.sym
185 cd $(bindir) && $(RM) wine wineserver wineclipsrv dosmod winedbg
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) $(LIBPROGRAMS): $(TOOLSUBDIRS) dummy
202 @cd `dirname $@` && $(MAKE) `basename $@`
204 $(LIBPROGRAMS): lib$(MODULE).$(LIBEXT) $(DLLOBJS)
206 $(LIBLINTS) $(EMULINTS): dummy
207 @cd `dirname $@` && $(MAKE) lint
209 install_programs: dummy
210 @cd programs && $(MAKE) install
212 uninstall_programs: dummy
213 @cd programs && $(MAKE) uninstall
216 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
220 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || 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 $(RM) wine wine.sym libwine.so.1.0 TAGS
240 $(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man
241 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
243 # We depend on configure above for checks, so we better don't use this rule.
244 #configure: configure.in
247 include/config.h.in: configure.in include/acconfig.h
248 autoheader -l include