Makefile.in 4.18 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 9
# install-lib:     install libraries needed to run applications
# install-dev:     install development environment
10 11 12 13 14
# install:         install everything
# uninstall:       uninstall everything
# depend:          create the dependencies
# etags:           create a TAGS file for Emacs.
# manpages:        compile manpages for Wine API
15
# htmlpages:       compile html pages for Wine API
Hans Leidekker's avatar
Hans Leidekker committed
16
# sgmlpages:       compile sgml source for the Wine API Guide
Alexandre Julliard's avatar
Alexandre Julliard committed
17

Alexandre Julliard's avatar
Alexandre Julliard committed
18 19 20 21 22 23
# Directories

TOPSRCDIR = @top_srcdir@
TOPOBJDIR = .
SRCDIR    = @srcdir@
VPATH     = @srcdir@
24
LIBEXT    = @LIBEXT@
25
LDCONFIG  = @LDCONFIG@
26
LDD       = @LDD@
27
MODULE    = none
Alexandre Julliard's avatar
Alexandre Julliard committed
28

29 30 31 32 33
# Sub-directories to run make depend/clean into
SUBDIRS = \
	dlls \
	documentation \
	include \
34
	libs \
35
	loader \
36 37
	programs \
	server \
38
	tools
39

40 41
# Sub-directories to install for install-lib
INSTALLLIBSUBDIRS = \
42
	documentation \
43
	loader \
44
	programs \
45
	server
46 47

# Sub-directories to install for install-dev
48
INSTALLDEVSUBDIRS = include tools
49

50
# Sub-directories to install for both install-lib and install-dev
51
INSTALLBOTHSUBDIRS = dlls libs
52

53 54
INSTALLSUBDIRS = $(INSTALLDEVSUBDIRS) $(INSTALLLIBSUBDIRS)

55 56
# Sub-directories to run make test into
TESTSUBDIRS = \
57 58
	dlls \
	programs
59

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

63 64
WINAPI_CHECK_EXTRA_FLAGS = --global

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

67 68 69 70
Make.rules: Make.rules.in configure
	@echo $? is newer than 'Make.rules', please rerun ./configure!
	@exit 1

71 72
wine: $(WINEWRAPPER)
	$(RM) $@ && $(LN_S) $(WINEWRAPPER) $@
73

74 75
# Installation rules

76 77 78 79
install-aclocal: dummy
	$(MKINSTALLDIRS) $(datadir)/aclocal
	$(INSTALL_DATA) $(SRCDIR)/aclocal.m4 $(datadir)/aclocal/wine.m4

80
install-lib:: $(INSTALLLIBSUBDIRS:%=%/__install__) $(INSTALLBOTHSUBDIRS:%=%/__install-lib__)
81

82
install-dev:: $(INSTALLDEVSUBDIRS:%=%/__install__) $(INSTALLBOTHSUBDIRS:%=%/__install-dev__) install-aclocal
83

84
install:: install-lib install-dev install-aclocal
85
	-$(LDCONFIG)
86 87 88 89 90 91
	@if test -n "`LANG=C $(LDD) $(bindir)/wine|grep not.found`";	\
	then								\
		echo "*************************************************" ; \
		echo "*************************************************" ; \
		echo "The installed Wine libraries will not be found!" ; \
		echo "You can either:" ; 				\
92
		echo "   Add the line '$(libdir)' to /etc/ld.so.conf and run /sbin/ldconfig" ;	\
93 94 95 96
		echo '   export LD_LIBRARY_PATH=$$LD_LIBRARY_PATH:$(libdir)' ; \
		echo "*************************************************" ; \
		echo "*************************************************" ; \
	fi
97

98
uninstall:: $(INSTALLBOTHSUBDIRS:%=%/__uninstall__)
99 100 101
	$(RM) $(datadir)/aclocal/wine.m4
	-rmdir $(datadir)/aclocal

102
.PHONY: install-aclocal
103

104 105
# Dependencies between directories

106
all: $(SUBDIRS)
107
dlls: libs tools
108
loader server: libs tools
109
programs: dlls libs tools
110 111 112 113
tools: libs

dlls/__install-lib__ dlls/__install-dev__: libs tools
libs/__install-lib__ libs/__install-dev__: libs
114
loader/__install__ server/__install__: libs tools
115
programs/__install__: libs tools dlls/__install-lib__
116
tools/__install__: tools
117

118
# Test rules
119

120
checklink:: $(TESTSUBDIRS:%=%/__checklink__)
121

Alexandre Julliard's avatar
Alexandre Julliard committed
122
check test:: wine $(TESTSUBDIRS:%=%/__test__)
123

124 125
crosstest:: $(TESTSUBDIRS:%=%/__crosstest__)

126 127
# Misc rules

Alexandre Julliard's avatar
Alexandre Julliard committed
128
TAGS etags:
129
	find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.dbg.c' -print | etags -
Alexandre Julliard's avatar
Alexandre Julliard committed
130

131
tags ctags:
132
	find $(TOPSRCDIR) -name '*.[ch]' -a -not -name '*.spec.c' -a -not -name '*.dbg.c' -print | ctags --c-types=+px -L -
133

Alexandre Julliard's avatar
Alexandre Julliard committed
134
manpages:
135
	$(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/man3w
136
	cd dlls && $(MAKE) man
Alexandre Julliard's avatar
Alexandre Julliard committed
137

Alexandre Julliard's avatar
Alexandre Julliard committed
138
htmlpages:
139
	$(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/html
140 141 142 143 144
	cd dlls && $(MAKE) doc-html

sgmlpages:
	$(MKINSTALLDIRS) $(TOPOBJDIR)/documentation/api-guide
	cd dlls && $(MAKE) doc-sgml
Alexandre Julliard's avatar
Alexandre Julliard committed
145

Alexandre Julliard's avatar
Alexandre Julliard committed
146
clean::
147
	$(RM) wine
Alexandre Julliard's avatar
Alexandre Julliard committed
148 149

distclean: clean
150
	$(RM) config.* configure.lineno TAGS tags Make.rules dlls/Makedll.rules dlls/Maketest.rules programs/Makeprog.rules libs/Makelib.rules include/config.h
151
	$(RM) -r autom4te.cache
Alexandre Julliard's avatar
Alexandre Julliard committed
152
	$(RM) `find . \( -name Makefile -o -size 0 \) -print`
Alexandre Julliard's avatar
Alexandre Julliard committed
153

154 155
.PHONY: manpages htmlpages distclean

Alexandre Julliard's avatar
Alexandre Julliard committed
156
### Dependencies: