Makefile.in 7.32 KB
Newer Older
Alexandre Julliard's avatar
Alexandre Julliard committed
1 2
# This Makefile understands the following targets:
#
3 4 5 6 7
# all (default):   build wine
# clean:           remove all intermediate files
# distclean:       also remove all files created by configure
# test:            run tests
# testclean:       clean test results to force running all tests again
8
# crosstest:       build tests as native windows applications (requires MinGW)
9 10
# install-lib:     install libraries needed to run applications
# install-dev:     install development environment
11 12 13
# install:         install everything
# uninstall:       uninstall everything
# depend:          create the dependencies
14
# ctags:           create a tags file for vim and others.
15 16
# etags:           create a TAGS file for Emacs.
# manpages:        compile manpages for Wine API
17
# htmlpages:       compile html pages for Wine API
Hans Leidekker's avatar
Hans Leidekker committed
18
# sgmlpages:       compile sgml source for the Wine API Guide
19
# xmlpages:        compile xml source for the Wine API Guide
Alexandre Julliard's avatar
Alexandre Julliard committed
20

Alexandre Julliard's avatar
Alexandre Julliard committed
21 22 23 24 25 26
# Directories

TOPSRCDIR = @top_srcdir@
TOPOBJDIR = .
SRCDIR    = @srcdir@
VPATH     = @srcdir@
27
LIBEXT    = @LIBEXT@
28
MODULE    = none
Alexandre Julliard's avatar
Alexandre Julliard committed
29

30
ALL_DIRS           = @ALL_DIRS@
31
ALL_DLL_DIRS       = @ALL_DLL_DIRS@
32 33
ALL_INSTALL_DIRS   = @ALL_INSTALL_DIRS@
ALL_PROGRAM_DIRS   = @ALL_PROGRAM_DIRS@
34
ALL_STATICLIB_DIRS = @ALL_STATICLIB_DIRS@
35
ALL_TEST_DIRS      = @ALL_TEST_DIRS@
36
ALL_TOOL_DIRS      = @ALL_TOOL_DIRS@
37
ALL_TOP_DIRS       = @ALL_TOP_DIRS@
38

39 40 41 42 43 44
# Sub-directories to run make all into
BUILDSUBDIRS = \
	libs/wine \
	$(ALL_TOOL_DIRS) \
	$(ALL_TOP_DIRS) \
	$(ALL_STATICLIB_DIRS) \
45
	$(ALL_DLL_DIRS) \
46
	$(ALL_PROGRAM_DIRS) \
47
	$(ALL_TEST_DIRS)
48

49
# Sub-directories to run make install/uninstall into
50
INSTALLSUBDIRS = \
51 52
	libs/wine \
	$(ALL_TOOL_DIRS) \
53
	$(ALL_TOP_DIRS) \
54
	$(ALL_STATICLIB_DIRS) \
55 56
	$(ALL_DLL_DIRS) \
	$(ALL_INSTALL_DIRS)
57

58
# Sub-directories that don't have a makefile
59
EXTRASUBDIRS = dlls libs
60

61
all: wine
62
	@echo "Wine build complete."
Alexandre Julliard's avatar
Alexandre Julliard committed
63

64 65
WINAPI_CHECK_EXTRA_FLAGS = --global

Alexandre Julliard's avatar
Alexandre Julliard committed
66 67
@MAKE_RULES@

68 69 70 71
# Rules for re-running configure

ALL_CONFIGS = Makefile $(ALL_DIRS:%=%/Makefile) @ALL_MAKERULES@ @ALL_SYMLINKS@

72 73 74 75 76 77 78 79
$(SRCDIR)/configure: @MAINTAINER_MODE@ configure.ac aclocal.m4
	cd $(SRCDIR) && autoconf --warnings=all

$(SRCDIR)/include/config.h.in: @MAINTAINER_MODE@ include/stamp-h.in
$(SRCDIR)/include/stamp-h.in: configure.ac aclocal.m4
	cd $(SRCDIR) && autoheader --warnings=all
	@echo timestamp > $@

80
config.status: configure
81
	@./config.status --recheck
82

83 84 85 86
include/config.h: include/stamp-h
include/stamp-h: include/config.h.in config.status
	@./config.status include/config.h include/stamp-h

87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140
$(ALL_CONFIGS):
	@./config.status $@

# Rules for building

all: $(BUILDSUBDIRS)

$(ALL_DIRS): dummy
	@cd $@ && $(MAKE)

.PHONY: $(ALL_DIRS)

# Rules for dependencies

$(ALL_DIRS:%=%/__depend__): dummy
	@cd `dirname $@` && $(MAKE) depend

depend: $(MAKEDEP) $(ALL_DIRS:%=%/__depend__) dummy
.PHONY: $(ALL_DIRS:%=%/__depend__)

# Rules for cleaning

$(ALL_DIRS:%=%/__clean__): dummy
	@cd `dirname $@` && $(MAKE) clean

clean:: $(ALL_DIRS:%=%/__clean__)

distclean:: clean
	$(RM) config.* configure.lineno TAGS tags include/config.h include/stamp-h $(ALL_CONFIGS)
	$(RM) -r autom4te.cache

.PHONY: distclean $(ALL_DIRS:%=%/__clean__)

# Rules for installing

$(INSTALLSUBDIRS:%=%/__install__): dummy
	@cd `dirname $@` && $(MAKE) install

$(INSTALLSUBDIRS:%=%/__install-lib__): dummy
	@cd `dirname $@` && $(MAKE) install-lib

$(INSTALLSUBDIRS:%=%/__install-dev__): dummy
	@cd `dirname $@` && $(MAKE) install-dev

$(INSTALLSUBDIRS:%=%/__uninstall__): dummy
	@cd `dirname $@` && $(MAKE) uninstall

install:: $(INSTALLSUBDIRS:%=%/__install__) dummy
install-lib:: $(INSTALLSUBDIRS:%=%/__install-lib__) dummy
install-dev:: $(INSTALLSUBDIRS:%=%/__install-dev__) dummy
uninstall:: $(INSTALLSUBDIRS:%=%/__uninstall__) dummy

.PHONY: $(INSTALLSUBDIRS:%=%/__install__) $(INSTALLSUBDIRS:%=%/__uninstall__) \
	$(INSTALLSUBDIRS:%=%/__install-lib__) $(INSTALLSUBDIRS:%=%/__install-dev__)
141

142
uninstall::
143
	-rmdir $(DESTDIR)$(datadir)/wine $(DESTDIR)$(fakedlldir) $(DESTDIR)$(dlldir)
144

145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190
# Rules for testing

$(ALL_TEST_DIRS:%=%/__test__): dummy
	@cd `dirname $@` && $(MAKE) test

$(ALL_TEST_DIRS:%=%/__crosstest__): dummy
	@cd `dirname $@` && $(MAKE) crosstest

$(ALL_TEST_DIRS:%=%/__testclean__): dummy
	@cd `dirname $@` && $(MAKE) testclean

check test:: $(ALL_TEST_DIRS:%=%/__test__)
crosstest:: $(ALL_TEST_DIRS:%=%/__crosstest__)
testclean:: $(ALL_TEST_DIRS:%=%/__testclean__)

.PHONY: check test testclean crosstest $(ALL_TEST_DIRS:%=%/__test__) \
	$(ALL_TEST_DIRS:%=%/__crosstest__) $(ALL_TEST_DIRS:%=%/__testclean__)

# Rules for auto documentation

DOCSUBDIRS = $(ALL_DLL_DIRS)

$(DOCSUBDIRS:%=%/__man__): dummy
	@cd `dirname $@` && $(MAKE) man

$(DOCSUBDIRS:%=%/__doc_html__): dummy
	@cd `dirname $@` && $(MAKE) doc-html

$(DOCSUBDIRS:%=%/__doc_sgml__): dummy
	@cd `dirname $@` && $(MAKE) doc-sgml

$(DOCSUBDIRS:%=%/__doc_xml__): dummy
	@cd `dirname $@` && $(MAKE) doc-xml

man: $(DOCSUBDIRS:%=%/__man__)
doc-html: $(DOCSUBDIRS:%=%/__doc_html__)
doc-sgml: $(DOCSUBDIRS:%=%/__doc_sgml__)
doc-xml: $(DOCSUBDIRS:%=%/__doc_xml__)

manpages htmlpages sgmlpages xmlpages: dummy
	@cd documentation && $(MAKE) $@

.PHONY: man doc-html doc-sgml doc-xml manpages htmlpages sgmlpages xmlpages \
	$(DOCSUBDIRS:%=%/__man__) $(DOCSUBDIRS:%=%/__doc_html__) $(DOCSUBDIRS:%=%/__doc_sgml__) $(DOCSUBDIRS:%=%/__doc_xml__)

# Rules for import libraries
191 192

STATIC_LIBS = @ALL_STATIC_LIBS@
193
IMPORT_LIBS = @ALL_IMPORT_LIBS@
194

195
implib: $(ALL_STATICLIB_DIRS) $(IMPORT_LIBS)
196 197
.PHONY: implib

198 199
# Dependencies between directories

200
# dependencies needed to build any dll or program
201 202 203 204
__tooldeps__: libs/port libs/wine libs/wpp $(ALL_TOOL_DIRS)
__builddeps__: __tooldeps__ include $(ALL_STATICLIB_DIRS) $(IMPORT_LIBS)
__buildcrossdeps__: __tooldeps__ include $(STATIC_LIBS:.a=.cross.a) $(IMPORT_LIBS:.def=.cross.a)
.PHONY: __tooldeps__ __builddeps__ __buildcrossdeps__
205

206
loader server: libs/port libs/wine tools
207 208
fonts: tools
include: tools/widl
209
programs/winetest: $(ALL_TEST_DIRS)
210 211 212 213
libs/wine $(ALL_TOOL_DIRS): libs/port
tools/wmc tools/wrc: tools
tools tools/wmc tools/wrc: libs/wine
tools/widl tools/wmc tools/wrc: libs/wpp
214 215 216 217 218 219

fonts/__install__ fonts/__install-lib__: tools
include/__install__ include/__install-dev__: include
libs/wine/__install__ libs/wine/__install-lib__ libs/wine/__install-dev__: libs/wine
loader/__install__ loader/__install-lib__: libs/port libs/wine tools
server/__install__ server/__install-lib__: libs/port libs/wine tools
220
tools/__install__ tools/__install-lib__ tools/__install-dev__: tools
221 222 223 224 225 226
tools/widl/__install__ tools/widl/__install-dev__: tools/widl
tools/winebuild/__install__ tools/winebuild/__install-dev__: tools/winebuild
tools/winedump/__install__ tools/winedump/__install-dev__: tools/winedump
tools/winegcc/__install__ tools/winegcc/__install-dev__: tools/winegcc
tools/wmc/__install__ tools/wmc/__install-dev__: tools/wmc
tools/wrc/__install__ tools/wrc/__install-dev__: tools/wrc
227

228
RECURSE_TARGETS = \
229 230 231 232 233 234 235 236 237
	__clean__ \
	__depend__ \
	__install__ \
	__instal-dev__ \
	__install-lib__ \
	__uninstall__ \
	__crosstest__

$(MAKEDEP): include/config.h tools/Makefile
238
	@cd $(TOOLSDIR)/tools && $(MAKE) makedep$(TOOLSEXT)
239

240 241
# Misc rules

Alexandre Julliard's avatar
Alexandre Julliard committed
242
TAGS etags:
243
	$(RM) TAGS
244
	(test -d .git && git ls-files '*.[chly]' '*.idl' || find -L $(TOPSRCDIR) -name '*.[ch]' -print) | xargs etags -a
Alexandre Julliard's avatar
Alexandre Julliard committed
245

246
tags ctags:
247
	$(RM) tags
248
	(test -d .git && git ls-files '*.[chly]' '*.idl' || find -L $(TOPSRCDIR) -name '*.[ch]' -print) | xargs ctags -a
249

250 251
# Makefile rules

252 253
.INIT: Makefile
.BEGIN: Makefile
254
.MAKEFILEDEPS:
255

256
@ALL_MAKEFILE_DEPENDS@