OSDN Git Service

r600g: precalculate semantic indices for SPI setup
[android-x86/external-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 catamount-osmesa-pgi \
86 darwin \
87 darwin-fat-32bit \
88 darwin-fat-all \
89 freebsd \
90 freebsd-dri \
91 freebsd-dri-amd64 \
92 freebsd-dri-x86 \
93 hpux10 \
94 hpux10-gcc \
95 hpux10-static \
96 hpux11-32 \
97 hpux11-32-static \
98 hpux11-32-static-nothreads \
99 hpux11-64 \
100 hpux11-64-static \
101 hpux11-ia64 \
102 hpux11-ia64-static \
103 hpux9 \
104 hpux9-gcc \
105 irix6-64 \
106 irix6-64-static \
107 irix6-n32 \
108 irix6-n32-static \
109 irix6-o32 \
110 irix6-o32-static \
111 linux \
112 linux-i965 \
113 linux-alpha \
114 linux-alpha-static \
115 linux-cell \
116 linux-cell-debug \
117 linux-debug \
118 linux-dri \
119 linux-dri-debug \
120 linux-dri-x86 \
121 linux-dri-x86-64 \
122 linux-dri-ppc \
123 linux-dri-xcb \
124 linux-egl \
125 linux-indirect \
126 linux-fbdev \
127 linux-ia64-icc \
128 linux-ia64-icc-static \
129 linux-icc \
130 linux-icc-static \
131 linux-llvm \
132 linux-llvm-debug \
133 linux-opengl-es \
134 linux-osmesa \
135 linux-osmesa-static \
136 linux-osmesa16 \
137 linux-osmesa16-static \
138 linux-osmesa32 \
139 linux-ppc \
140 linux-ppc-static \
141 linux-profile \
142 linux-sparc \
143 linux-sparc5 \
144 linux-static \
145 linux-ultrasparc \
146 linux-tcc \
147 linux-x86 \
148 linux-x86-debug \
149 linux-x86-32 \
150 linux-x86-64 \
151 linux-x86-64-debug \
152 linux-x86-64-profile \
153 linux-x86-64-static \
154 linux-x86-profile \
155 linux-x86-static \
156 netbsd \
157 openbsd \
158 osf1 \
159 osf1-static \
160 solaris-x86 \
161 solaris-x86-gcc \
162 solaris-x86-gcc-static \
163 sunos4 \
164 sunos4-gcc \
165 sunos4-static \
166 sunos5 \
167 sunos5-gcc \
168 sunos5-64-gcc \
169 sunos5-smp \
170 sunos5-v8 \
171 sunos5-v8-static \
172 sunos5-v9 \
173 sunos5-v9-static \
174 sunos5-v9-cc-g++ \
175 ultrix-gcc:
176         @ if test -f configs/current -o -L configs/current; then \
177                 if ! cmp configs/$@ configs/current > /dev/null; then \
178                         echo "Please run 'make realclean' before changing configs" ; \
179                         exit 1 ; \
180                 fi ; \
181         else \
182                 cd configs && rm -f current && ln -s $@ current ; \
183         fi
184         $(MAKE) default
185
186
187 # Rules for making release tarballs
188
189 PACKAGE_VERSION=7.12-devel
190 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
191 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
192
193 EXTRA_FILES = \
194         aclocal.m4                                      \
195         configure                                       \
196         src/glsl/glsl_parser.cpp                        \
197         src/glsl/glsl_parser.h                          \
198         src/glsl/glsl_lexer.cpp                         \
199         src/glsl/glcpp/glcpp-lex.c                      \
200         src/glsl/glcpp/glcpp-parse.c                    \
201         src/glsl/glcpp/glcpp-parse.h                    \
202         src/mesa/program/lex.yy.c                       \
203         src/mesa/program/program_parse.tab.c            \
204         src/mesa/program/program_parse.tab.h
205
206 IGNORE_FILES = \
207         -x autogen.sh
208
209
210 parsers: configure
211         -@touch $(TOP)/configs/current
212         $(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
213         $(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
214         $(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
215
216 # Everything for new a Mesa release:
217 ARCHIVES = $(PACKAGE_NAME).tar.gz \
218         $(PACKAGE_NAME).tar.bz2 \
219         $(PACKAGE_NAME).zip \
220
221 tarballs: md5
222         rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
223
224 # Helper for autoconf builds
225 ACLOCAL = aclocal
226 ACLOCAL_FLAGS =
227 AUTOCONF = autoconf
228 AC_FLAGS =
229 aclocal.m4: configure.ac acinclude.m4
230         $(ACLOCAL) $(ACLOCAL_FLAGS)
231 configure: configure.ac aclocal.m4 acinclude.m4
232         $(AUTOCONF) $(AC_FLAGS)
233
234 manifest.txt: .git
235         ( \
236                 ls -1 $(EXTRA_FILES) ; \
237                 git ls-files $(IGNORE_FILES) \
238         ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
239
240 ../$(PACKAGE_DIR):
241         ln -s $(PWD) $@
242
243 $(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
244         cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
245
246 $(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
247         gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
248
249 $(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
250         bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
251
252 $(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
253         rm -f $(PACKAGE_NAME).zip ; \
254         cd .. ; \
255         zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
256         mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
257
258 md5: $(ARCHIVES)
259         @-md5sum $(PACKAGE_NAME).tar.gz
260         @-md5sum $(PACKAGE_NAME).tar.bz2
261         @-md5sum $(PACKAGE_NAME).zip
262
263 .PHONY: tarballs md5