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@
85 graphics/enhmetafiledrv \
86 graphics/metafiledrv \
117 PROGSUBDIRS = libtest programs
119 DOCSUBDIRS = documentation
123 # Sub-directories to run make into
132 # Sub-directories to run make depend into
133 DEPENDSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
135 # Sub-directories to run make install into
136 INSTALLSUBDIRS = $(DOCSUBDIRS) $(INCSUBDIRS)
138 # Sub-directories to run make lint into
139 LINTSUBDIRS = $(LIBSUBDIRS) $(X11SUBDIRS) $(EMUSUBDIRS) $(DOCSUBDIRS)
141 # Extra sub-directories to clean
142 CLEANSUBDIRS = dlls include include/bitmaps include/wine
145 controls/controls.o \
147 dlls/advapi32/advapi32.o \
148 dlls/avifil32/avifil32.o \
149 dlls/comctl32/comctl32.o \
150 dlls/commdlg/commdlg.o \
151 dlls/crtdll/crtdll.o \
152 dlls/dciman32/dciman32.o \
153 dlls/display/display.o \
154 dlls/dplayx/dplayx.o \
155 dlls/dsound/dsound.o \
157 dlls/imagehlp/imagehlp.o \
159 dlls/lzexpand/lzexpand.o \
163 dlls/msacm32/msacm32.o \
164 dlls/msnet32/msnet32.o \
165 dlls/msvideo/msvideo.o \
167 dlls/odbc32/odbc32.o \
169 dlls/oleaut32/oleaut32.o \
170 dlls/olecli/olecli.o \
171 dlls/oledlg/oledlg.o \
172 dlls/olesvr/olesvr.o \
174 dlls/rasapi32/rasapi32.o \
175 dlls/shell32/shell32.o \
177 dlls/stress/stress.o \
178 dlls/tapi32/tapi32.o \
179 dlls/version/version.o \
180 dlls/win32s/win32s.o \
181 dlls/win87em/win87em.o \
182 dlls/winaspi/winaspi.o \
183 dlls/windebug/windebug.o \
186 dlls/winmm/mcianim/mcianim.drv.o \
187 dlls/winmm/mciavi/mciavi.drv.o \
188 dlls/winmm/mcicda/mcicda.drv.o \
189 dlls/winmm/mciseq/mciseq.drv.o \
190 dlls/winmm/mciwave/mciwave.drv.o \
191 dlls/winmm/midimap/midimap.drv.o \
192 dlls/winmm/wavemap/msacm.drv.o \
193 dlls/winmm/wineoss/wineoss.drv.o \
194 dlls/winsock/winsock.o \
195 dlls/winspool/winspool.o \
196 dlls/wnaspi32/wnaspi32.o \
198 graphics/graphics.o \
199 graphics/enhmetafiledrv/enhmetafiledrv.o \
200 graphics/metafiledrv/metafiledrv.o \
201 graphics/psdrv/psdrv.o \
202 graphics/ttydrv/ttydrv.o \
203 graphics/win16drv/win16drv.o \
214 resources/resources.o \
215 scheduler/scheduler.o \
218 windows/ttydrv/ttydrv.o
221 graphics/x11drv/x11drv.o \
223 windows/x11drv/x11drv.o
226 debugger/debugger.o \
229 LIB_TARGET = @LIB_TARGET@
231 ALT_LINK = @ALT_LINK@
233 all: Makefile Make.rules server $(MAIN_TARGET)
234 @echo "Wine build complete."
236 LIBLINTS = $(LIBOBJS:.o=.ln)
237 X11LINTS = $(X11OBJS:.o=.ln)
238 EMULINTS = $(EMUOBJS:.o=.ln)
240 lint:: llib-lwine.ln $(EMULINTS)
241 $(LINT) $(ALLLINTFLAGS) -L. -lwine $(EMULINTS)
243 WINAPI_CHECK_EXTRA_FLAGS = --global
247 Make.rules: Make.rules.in configure
248 @echo $? is newer than 'Make.rules', please rerun ./configure!
251 install:: install_$(MAIN_TARGET)
253 uninstall:: uninstall_$(MAIN_TARGET)
257 lib: $(LIBSUBDIRS) $(X11SUBDIRS) $(LIB_TARGET)
259 wine wine.sym: $(LIB_TARGET) $(EMUOBJS) $(X11OBJS) $(LIBOBJS)
260 $(CC) -o wine $(EMUOBJS) $(ALT_LINK) $(LDOPTIONS) $(X_LIBS) $(XLIB) $(LIBS)
261 nm -n wine | grep -v _compiled >wine.sym
263 libwine.a: $(LIBOBJS) $(X11OBJS)
265 $(AR) $@ $(LIBOBJS) $(X11OBJS)
268 llib-lwine.ln : $(LIBLINTS) $(X11LINTS)
269 $(LINT) $(ALLLINTFLAGS) -owine $(LIBLINTS) $(X11LINTS)
271 libwine.so.1.0: $(LIBOBJS) $(X11OBJS)
272 $(LDSHARED) -o$@ $(LIBOBJS) $(X11OBJS) $(LDOPTIONS)
274 $(LN_S) $@ libwine.so
276 install_emu: install_lib
277 [ -d $(bindir) ] || $(MKDIR) $(bindir)
278 $(INSTALL_PROGRAM) wine $(bindir)/wine
279 $(INSTALL_PROGRAM) loader/dos/dosmod $(bindir)/dosmod
281 uninstall_emu: uninstall_lib
282 $(RM) $(bindir)/wine $(bindir)/dosmod
285 [ -d $(libdir) ] || $(MKDIR) $(libdir)
286 if [ -f wine.sym ]; then $(INSTALL_DATA) wine.sym $(libdir)/wine.sym; fi
287 if [ $(LIB_TARGET) ]; then \
288 if [ $(LIB_TARGET) = libwine.so.1.0 ]; then \
289 $(INSTALL_PROGRAM) $(LIB_TARGET) $(libdir); \
290 $(LDCONFIG) || (cd $(libdir) ; $(RM) libwine.so ; $(LN_S) $(LIB_TARGET) libwine.so) ; \
292 $(INSTALL_DATA) $(LIB_TARGET) $(libdir); \
295 [ -d $(bindir) ] || $(MKDIR) $(bindir)
296 $(INSTALL_PROGRAM) server/wineserver $(bindir)/wineserver
297 $(INSTALL_PROGRAM) windows/x11drv/wineclipsrv $(bindir)/wineclipsrv
300 cd $(libdir) && $(RM) $(LIB_TARGET) libwine.a libwine.so wine.sym
301 $(RM) $(bindir)/wineserver $(bindir)/wineclipsrv
303 $(X11OBJS) $(EMUOBJS) $(LIBOBJS): $(TOOLSUBDIRS) dummy
304 @cd `dirname $@`; $(SUBMAKE)
306 $(BUILDSUBDIRS): dummy
309 $(LIBLINTS) $(X11LINTS) $(EMULINTS): dummy
310 @echo $@ | sed 's%\(.*\)\/[^\/]*%cd \1 \&\& make lint%' | sh
313 install_programs: dummy
314 @cd programs; $(SUBMAKE) install
316 uninstall_programs: dummy
317 @cd programs; $(SUBMAKE) uninstall
320 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) install) || exit 1; done
323 for i in $(INSTALLSUBDIRS); do (cd $$i && $(MAKE) uninstall) || exit 1; done
326 for i in $(DEPENDSUBDIRS); do (cd $$i && $(MAKE) depend) || exit 1; done
329 etags `find $(TOPSRCDIR) -name '*.[chS]' -print | grep -v dbgmain`
332 -$(MKDIR) $(TOPOBJDIR)/documentation/man3w
333 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) man); done
336 -$(MKDIR) $(TOPOBJDIR)/documentation/html
337 for i in $(LIBSUBDIRS); do (cd $$i && $(MAKE) html); done
340 for i in $(BUILDSUBDIRS); do (cd $$i; $(MAKE) clean) || exit 1; done
341 for i in $(CLEANSUBDIRS); do (cd $$i; $(RM) *.o \#*\# .#* *~ *% *.bak *.orig *.rej *.flc); done
342 $(RM) wine wine.sym libwine.a libwine.so.1.0 libwine.so TAGS .#*
345 $(RM) config.* Make.rules include/config.h documentation/wine.man documentation/wine.conf.man
346 $(RM) `find . \( -name Makefile -o -size 0 \) -print`
348 # We depend on configure above for checks, so we better don't use this rule.
349 #configure: configure.in
352 include/config.h.in: configure.in include/acconfig.h
353 autoheader -l include