Merge branch 'glsl-to-tgsi'
[mesa.git] / Makefile
1 # Top-level Mesa makefile
2
3 TOP = .
4
5 SUBDIRS = src
6
7
8 # The git command below generates an empty string when we're not
9 # building in a GIT tree (i.e., building from a release tarball).
10 default: $(TOP)/configs/current
11 @$(TOP)/bin/extract_git_sha1
12 @for dir in $(SUBDIRS) ; do \
13 if [ -d $$dir ] ; then \
14 (cd $$dir && $(MAKE)) || exit 1 ; \
15 fi \
16 done
17
18 all: default
19
20
21 doxygen:
22 cd doxygen && $(MAKE)
23
24 check:
25 cd src/glsl/tests/ && ./optimization-test
26 @echo "All tests passed."
27
28 clean:
29 -@touch $(TOP)/configs/current
30 -@for dir in $(SUBDIRS) ; do \
31 if [ -d $$dir ] ; then \
32 (cd $$dir && $(MAKE) clean) ; \
33 fi \
34 done
35 -@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
36
37
38 realclean: clean
39 -rm -rf lib*
40 -rm -f $(TOP)/configs/current
41 -rm -f $(TOP)/configs/autoconf
42 -rm -rf autom4te.cache
43 -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
44 -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
45
46
47 distclean: realclean
48
49
50 install:
51 @for dir in $(SUBDIRS) ; do \
52 if [ -d $$dir ] ; then \
53 (cd $$dir && $(MAKE) install) || exit 1 ; \
54 fi \
55 done
56
57
58 .PHONY: default doxygen clean realclean distclean install check
59
60 # If there's no current configuration file
61 $(TOP)/configs/current:
62 @echo
63 @echo
64 @echo "Please choose a configuration from the following list:"
65 @ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
66 @echo
67 @echo "Then type 'make <config>' (ex: 'make linux-x86')"
68 @echo
69 @echo "Or, run './configure' then 'make'"
70 @echo "See './configure --help' for details"
71 @echo
72 @echo "(ignore the following error message)"
73 @exit 1
74
75
76 # Rules to set/install a specific build configuration
77 aix \
78 aix-64 \
79 aix-64-static \
80 aix-gcc \
81 aix-static \
82 autoconf \
83 bluegene-osmesa \
84 bluegene-xlc-osmesa \
85 beos \
86 catamount-osmesa-pgi \
87 darwin \
88 darwin-fat-32bit \
89 darwin-fat-all \
90 freebsd \
91 freebsd-dri \
92 freebsd-dri-amd64 \
93 freebsd-dri-x86 \
94 hpux10 \
95 hpux10-gcc \
96 hpux10-static \
97 hpux11-32 \
98 hpux11-32-static \
99 hpux11-32-static-nothreads \
100 hpux11-64 \
101 hpux11-64-static \
102 hpux11-ia64 \
103 hpux11-ia64-static \
104 hpux9 \
105 hpux9-gcc \
106 irix6-64 \
107 irix6-64-static \
108 irix6-n32 \
109 irix6-n32-static \
110 irix6-o32 \
111 irix6-o32-static \
112 linux \
113 linux-i965 \
114 linux-alpha \
115 linux-alpha-static \
116 linux-cell \
117 linux-cell-debug \
118 linux-debug \
119 linux-dri \
120 linux-dri-debug \
121 linux-dri-x86 \
122 linux-dri-x86-64 \
123 linux-dri-ppc \
124 linux-dri-xcb \
125 linux-egl \
126 linux-indirect \
127 linux-fbdev \
128 linux-ia64-icc \
129 linux-ia64-icc-static \
130 linux-icc \
131 linux-icc-static \
132 linux-llvm \
133 linux-llvm-debug \
134 linux-opengl-es \
135 linux-osmesa \
136 linux-osmesa-static \
137 linux-osmesa16 \
138 linux-osmesa16-static \
139 linux-osmesa32 \
140 linux-ppc \
141 linux-ppc-static \
142 linux-profile \
143 linux-sparc \
144 linux-sparc5 \
145 linux-static \
146 linux-ultrasparc \
147 linux-tcc \
148 linux-x86 \
149 linux-x86-debug \
150 linux-x86-32 \
151 linux-x86-64 \
152 linux-x86-64-debug \
153 linux-x86-64-profile \
154 linux-x86-64-static \
155 linux-x86-profile \
156 linux-x86-static \
157 netbsd \
158 openbsd \
159 osf1 \
160 osf1-static \
161 solaris-x86 \
162 solaris-x86-gcc \
163 solaris-x86-gcc-static \
164 sunos4 \
165 sunos4-gcc \
166 sunos4-static \
167 sunos5 \
168 sunos5-gcc \
169 sunos5-64-gcc \
170 sunos5-smp \
171 sunos5-v8 \
172 sunos5-v8-static \
173 sunos5-v9 \
174 sunos5-v9-static \
175 sunos5-v9-cc-g++ \
176 ultrix-gcc:
177 @ if test -f configs/current -o -L configs/current; then \
178 if ! cmp configs/$@ configs/current > /dev/null; then \
179 echo "Please run 'make realclean' before changing configs" ; \
180 exit 1 ; \
181 fi ; \
182 else \
183 cd configs && rm -f current && ln -s $@ current ; \
184 fi
185 $(MAKE) default
186
187
188 # Rules for making release tarballs
189
190 PACKAGE_VERSION=7.12-devel
191 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
192 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
193
194 EXTRA_FILES = \
195 aclocal.m4 \
196 configure \
197 src/glsl/glsl_parser.cpp \
198 src/glsl/glsl_parser.h \
199 src/glsl/glsl_lexer.cpp \
200 src/glsl/glcpp/glcpp-lex.c \
201 src/glsl/glcpp/glcpp-parse.c \
202 src/glsl/glcpp/glcpp-parse.h \
203 src/mesa/program/lex.yy.c \
204 src/mesa/program/program_parse.tab.c \
205 src/mesa/program/program_parse.tab.h
206
207 IGNORE_FILES = \
208 -x autogen.sh
209
210
211 parsers: configure
212 -@touch $(TOP)/configs/current
213 $(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
214 $(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
215 $(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
216
217 # Everything for new a Mesa release:
218 ARCHIVES = $(PACKAGE_NAME).tar.gz \
219 $(PACKAGE_NAME).tar.bz2 \
220 $(PACKAGE_NAME).zip \
221
222 tarballs: md5
223 rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
224
225 # Helper for autoconf builds
226 ACLOCAL = aclocal
227 ACLOCAL_FLAGS =
228 AUTOCONF = autoconf
229 AC_FLAGS =
230 aclocal.m4: configure.ac acinclude.m4
231 $(ACLOCAL) $(ACLOCAL_FLAGS)
232 configure: configure.ac aclocal.m4 acinclude.m4
233 $(AUTOCONF) $(AC_FLAGS)
234
235 manifest.txt: .git
236 ( \
237 ls -1 $(EXTRA_FILES) ; \
238 git ls-files $(IGNORE_FILES) \
239 ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
240
241 ../$(PACKAGE_DIR):
242 ln -s $(PWD) $@
243
244 $(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
245 cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
246
247 $(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
248 gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
249
250 $(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
251 bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
252
253 $(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
254 rm -f $(PACKAGE_NAME).zip ; \
255 cd .. ; \
256 zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
257 mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
258
259 md5: $(ARCHIVES)
260 @-md5sum $(PACKAGE_NAME).tar.gz
261 @-md5sum $(PACKAGE_NAME).tar.bz2
262 @-md5sum $(PACKAGE_NAME).zip
263
264 .PHONY: tarballs md5