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@
39 graphics/enhmetafiledrv \
40 graphics/metafiledrv \
63 PROGSUBDIRS = libtest programs
65 DOCSUBDIRS = documentation
72 windows/x11drv/wineclipsrv
74 # Sub-directories to run make into
84 # Sub-directories to run make install into
85 INSTALLSUBDIRS = $(DLLDIR) $(DOCSUBDIRS) $(INCSUBDIRS)
87 # Sub-directories to run make lint into
88 LINTSUBDIRS = $(LIBSUBDIRS) $(DLLDIR) $(EMUSUBDIRS) $(DOCSUBDIRS)
94 dlls/advapi32/advapi32.o \
95 dlls/crtdll/crtdll.o \
96 dlls/display/display.o \
100 graphics/graphics.o \
101 graphics/enhmetafiledrv/enhmetafiledrv.o \
102 graphics/metafiledrv/metafiledrv.o \
103 graphics/psdrv/psdrv.o \
104 graphics/win16drv/win16drv.o \
115 resources/resources.o \
116 scheduler/scheduler.o \
123 DLLOBJS = $(DLLS:%=dlls/lib%.@LIBEXT@)
125 EXTRA_OBJS = $(LIBOBJS)
127 EMU_TARGET = @EMU_TARGET@
129 all: Make.rules $(PROGRAMS) $(EMU_TARGET)
130 @echo "Wine build complete."
132 LIBLINTS = $(LIBOBJS:.o=.ln)
133 EMULINTS = $(EMUOBJS:.o=.ln)
135 lint:: llib-lwine.ln $(EMULINTS)
136 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
138 WINAPI_CHECK_EXTRA_FLAGS = --global
142 all: lib$(MODULE).$(LIBEXT) $(DLLOBJS)
144 Make.rules: Make.rules.in configure
145 @echo $? is newer than 'Make.rules', please rerun ./configure!
148 wine wine.sym: lib$(MODULE).$(LIBEXT) $(DLLOBJS) $(EMUOBJS)
149 $(CC) -o wine $(EMUOBJS) $(DLL_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
150 nm -n wine | grep -v _compiled >wine.sym
152 llib-lwine.ln : $(LIBLINTS)
153 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS)
155 install_so: lib$(MODULE).so.$(SOVERSION)
156 [ -d $(libdir) ] || $(MKDIR) $(libdir)
157 $(INSTALL_PROGRAM) lib$(MODULE).so.$(SOVERSION) $(libdir)/lib$(MODULE).so.$(SOVERSION)
158 cd $(libdir) && $(RM) lib$(MODULE).so && $(LN_S) lib$(MODULE).so.$(SOVERSION) lib$(MODULE).so
160 install_a: lib$(MODULE).a
161 [ -d $(libdir) ] || $(MKDIR) $(libdir)
162 $(INSTALL_DATA) lib$(MODULE).a $(libdir)/lib$(MODULE).a
165 [ -d $(bindir) ] || $(MKDIR) $(bindir)
166 [ -d $(libdir) ] || $(MKDIR) $(libdir)
167 [ -f wine.sym ] && $(INSTALL_DATA) wine.sym $(libdir)/wine.sym
168 $(INSTALL_PROGRAM) wine $(bindir)/wine
170 install:: $(PROGRAMS) $(EMU_TARGET:%=install_%) $(LIBEXT:%=install_%)
171 [ -d $(bindir) ] || $(MKDIR) $(bindir)
172 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
173 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
174 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
177 cd $(libdir) && $(RM) libwine.a libwine.so libwine.so.$(SOVERSION) wine.sym
178 cd $(bindir) && $(RM) wine wineserver wineclipsrv dosmod
180 lib$(MODULE).so.$(SOVERSION): $(OBJS) Makefile.in Make.rules.in
181 $(LDSHARED) $(OBJS) -o $@
183 lib$(MODULE).so: lib$(MODULE).so.$(SOVERSION)
184 $(RM) $@ && $(LN_S) lib$(MODULE).so.$(SOVERSION) $@
186 lib$(MODULE).a: $(OBJS) Makefile.in Make.rules.in
192 $(CC) -o checklink $(TOPSRCDIR)/library/checklink.c -L. -lwine $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS) && $(RM) checklink
194 $(EMUOBJS) $(LIBOBJS) $(DLLOBJS) $(PROGRAMS): $(TOOLSUBDIRS) dummy
195 @cd `dirname $@` && $(MAKE) `basename $@`
197 $(LIBLINTS) $(EMULINTS): dummy
198 @cd `dirname $@` && $(MAKE) lint
200 install_programs: dummy
201 @cd programs && $(MAKE) install
203 uninstall_programs: dummy
204 @cd programs && $(MAKE) uninstall
207 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
211 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
214 @cd dlls && $(MAKE) checklink
217 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
220 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
221 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
224 -$(MKDIR) $(TOPOBJDIR)/documentation/html
225 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
228 $(RM) wine wine.sym libwine.so.1.0 TAGS
231 $(RM) config.* Make.rules dlls/Makedll.rules include/config.h documentation/wine.man documentation/wine.conf.man
232 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
234 # We depend on configure above for checks, so we better don't use this rule.
235 #configure: configure.in
238 include/config.h.in: configure.in include/acconfig.h
239 autoheader -l include