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@
84 graphics/enhmetafiledrv \
85 graphics/metafiledrv \
116 PROGSUBDIRS = libtest programs
118 DOCSUBDIRS = documentation
122 # Sub-directories to run make into
131 # Sub-directories to run make depend into
132 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
134 # Sub-directories to run make install into
135 INSTALLSUBDIRS = $(DOCSUBDIRS) $(INCSUBDIRS)
137 # Sub-directories to run make lint into
138 LINTSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
140 # Extra sub-directories to clean
141 CLEANSUBDIRS = dlls include include/bitmaps include/wine
144 controls/controls.o \
146 dlls/advapi32/advapi32.o \
147 dlls/avifil32/avifil32.o \
148 dlls/comctl32/comctl32.o \
149 dlls/commdlg/commdlg.o \
150 dlls/crtdll/crtdll.o \
151 dlls/dciman32/dciman32.o \
152 dlls/display/display.o \
153 dlls/dplayx/dplayx.o \
154 dlls/dsound/dsound.o \
156 dlls/imagehlp/imagehlp.o \
158 dlls/lzexpand/lzexpand.o \
162 dlls/msacm32/msacm32.o \
163 dlls/msnet32/msnet32.o \
164 dlls/msvideo/msvideo.o \
167 dlls/oleaut32/oleaut32.o \
168 dlls/olecli/olecli.o \
169 dlls/oledlg/oledlg.o \
170 dlls/olesvr/olesvr.o \
172 dlls/rasapi32/rasapi32.o \
173 dlls/shell32/shell32.o \
175 dlls/stress/stress.o \
176 dlls/tapi32/tapi32.o \
178 dlls/version/version.o \
179 dlls/win32s/win32s.o \
180 dlls/win87em/win87em.o \
181 dlls/winaspi/winaspi.o \
182 dlls/windebug/windebug.o \
185 dlls/winmm/mcianim/mcianim.drv.o \
186 dlls/winmm/mciavi/mciavi.drv.o \
187 dlls/winmm/mcicda/mcicda.drv.o \
188 dlls/winmm/mciseq/mciseq.drv.o \
189 dlls/winmm/mciwave/mciwave.drv.o \
190 dlls/winmm/midimap/midimap.drv.o \
191 dlls/winmm/wavemap/msacm.drv.o \
192 dlls/winmm/wineoss/wineoss.o \
193 dlls/winspool/winspool.o \
194 dlls/wnaspi32/wnaspi32.o \
196 graphics/graphics.o \
197 graphics/enhmetafiledrv/enhmetafiledrv.o \
198 graphics/metafiledrv/metafiledrv.o \
199 graphics/psdrv/psdrv.o \
200 graphics/ttydrv/ttydrv.o \
201 graphics/win16drv/win16drv.o \
212 resources/resources.o \
213 scheduler/scheduler.o \
217 windows/ttydrv/ttydrv.o
220 graphics/x11drv/x11drv.o \
222 windows/x11drv/x11drv.o
225 debugger/debugger.o \
228 LIB_TARGET = @LIB_TARGET@
230 ALT_LINK = @ALT_LINK@
232 all: Makefile Make.rules $(MAIN_TARGET)
233 @echo "Wine build complete."
235 LIBLINTS = $(LIBOBJS:.o=.ln)
236 X11LINTS = $(X11OBJS:.o=.ln)
237 EMULINTS = $(EMUOBJS:.o=.ln)
239 lint:: llib-lwine.ln $(EMULINTS)
240 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
242 WINAPI_CHECK_EXTRA_FLAGS = --global
246 Make.rules: Make.rules.in configure
247 @echo $? is newer than 'Make.rules', please rerun ./configure!
250 install:: install_$(MAIN_TARGET)
252 uninstall:: uninstall_$(MAIN_TARGET)
256 lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
258 wine wine.sym: $(LIB_TARGET) $(EMUOBJS) $(X11OBJS) $(LIBOBJS)
259 $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
260 nm -n wine | grep -v _compiled >wine.sym
262 libwine.a: $(LIBOBJS) $(X11OBJS)
264 $(AR) $@ $(LIBOBJS) $(X11OBJS)
267 llib-lwine.ln : $(LIBLINTS) $(X11LINTS)
268 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(X11LINTS)
270 libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
271 $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
274 install_emu: install_lib
275 [ -d $(bindir) ] || $(MKDIR) $(bindir)
276 $(INSTALL_PROGRAM) wine $(bindir)/wine
277 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
279 uninstall_emu: uninstall_lib
280 $(RM) $(bindir)/wine $(bindir)/dosmod
283 [ -d $(libdir) ] || $(MKDIR) $(libdir)
284 if [ -f wine.sym ]; then $(INSTALL_DATA) wine.sym $(libdir)/wine.sym; fi
285 if [ $(LIB_TARGET) ]; then \
286 $(INSTALL_DATA) $(LIB_TARGET) $(libdir); \
287 if [ $(LIB_TARGET) = libwine.so.1.0 ]; then $(LDCONFIG); fi \
289 [ -d $(bindir) ] || $(MKDIR) $(bindir)
290 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
291 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
294 cd $(libdir) && $(RM) $(LIB_TARGET) libwine.a libwine.so wine.sym
295 $(RM) $(bindir)/wineserver $(bindir)/wineclipsrv
297 $(X11OBJS) $(EMUOBJS) $(LIBOBJS): $(TOOLSUBDIRS) dummy
298 @cd `dirname $@`; $(SUBMAKE)
300 $(BUILDSUBDIRS): dummy
303 $(LIBLINTS) $(X11LINTS) $(EMULINTS): dummy
304 @echo $@ | sed 's%\(.*\)\/[^\/]*%cd \1 \&\& make lint%' | sh
307 install_programs: dummy
308 @cd programs; $(SUBMAKE) install
310 uninstall_programs: dummy
311 @cd programs; $(SUBMAKE) uninstall
314 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
317 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
320 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
323 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
326 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
327 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
330 -$(MKDIR) $(TOPOBJDIR)/documentation/html
331 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
334 for i in $(BUILDSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
335 for i in $(CLEANSUBDIRS); do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
336 $(RM) wine wine.sym libwine.a libwine.so.1.0 libwine.so TAGS .#*
339 $(RM) config.* Make.rules include/config.h documentation/wine.man documentation/wine.conf.man
340 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
342 # We depend on configure above for checks, so we better don't use this rule.
343 #configure: configure.in
346 include/config.h.in: configure.in include/acconfig.h
347 autoheader -l include