blob: 1368b44ea020a5d49c7e034aab40cd244745fb98 [file] [log] [blame]
Brian Paulde0ee312004-03-26 15:19:11 +00001# Top-level Mesa makefile
2
3TOP = .
4
Brian Paul0a401b52010-06-04 17:36:17 -06005SUBDIRS = src
Brian Paulde0ee312004-03-26 15:19:11 +00006
7
Ian Romanickde579a12011-03-31 11:42:01 -07008# 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).
Brian Paulde0ee312004-03-26 15:19:11 +000010default: $(TOP)/configs/current
Ian Romanickde579a12011-03-31 11:42:01 -070011 @$(TOP)/bin/extract_git_sha1
Brian Paulde0ee312004-03-26 15:19:11 +000012 @for dir in $(SUBDIRS) ; do \
Brian16c503f2007-05-09 16:22:53 -060013 if [ -d $$dir ] ; then \
14 (cd $$dir && $(MAKE)) || exit 1 ; \
15 fi \
Brian Paulde0ee312004-03-26 15:19:11 +000016 done
17
José Fonseca9df478d2008-02-18 16:47:35 +090018all: default
19
Brian Paulde0ee312004-03-26 15:19:11 +000020
Brian Paul6d50d912004-07-01 15:32:51 +000021doxygen:
Dan Nicholsoncba14d82008-05-06 12:29:53 -070022 cd doxygen && $(MAKE)
Brian Paul6d50d912004-07-01 15:32:51 +000023
Paul Berry659cded2011-07-05 11:52:06 -070024check:
25 cd src/glsl/tests/ && ./optimization-test
Ian Romanick3ef3ba42011-12-15 18:45:27 -080026 make -C tests check
Paul Berry659cded2011-07-05 11:52:06 -070027
Brian Paulde0ee312004-03-26 15:19:11 +000028clean:
Dan Nicholsona6464b32008-05-07 11:35:23 -070029 -@touch $(TOP)/configs/current
30 -@for dir in $(SUBDIRS) ; do \
Brian16c503f2007-05-09 16:22:53 -060031 if [ -d $$dir ] ; then \
32 (cd $$dir && $(MAKE) clean) ; \
33 fi \
Brian Paulde0ee312004-03-26 15:19:11 +000034 done
Dan Nicholsona6464b32008-05-07 11:35:23 -070035 -@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
Brian Paulde0ee312004-03-26 15:19:11 +000036
37
Dan Nicholsona6464b32008-05-07 11:35:23 -070038realclean: clean
Brian Paulde0ee312004-03-26 15:19:11 +000039 -rm -rf lib*
40 -rm -f $(TOP)/configs/current
Dan Nicholsondca1b792007-10-23 09:25:58 -070041 -rm -f $(TOP)/configs/autoconf
42 -rm -rf autom4te.cache
Dan Nicholsonc5e2b852008-05-06 14:00:43 -070043 -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
44 -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
Keith Whitwellae68c322004-12-15 11:03:41 +000045
Brian Paulde0ee312004-03-26 15:19:11 +000046
Brian Paul666702b2009-04-16 09:31:45 -060047distclean: realclean
48
49
Brian Paulde0ee312004-03-26 15:19:11 +000050install:
Brian Paul0e794a12006-06-22 22:50:48 +000051 @for dir in $(SUBDIRS) ; do \
Brian16c503f2007-05-09 16:22:53 -060052 if [ -d $$dir ] ; then \
53 (cd $$dir && $(MAKE) install) || exit 1 ; \
54 fi \
Brian Paul0e794a12006-06-22 22:50:48 +000055 done
Brian Paul81ca6162005-01-03 15:35:00 +000056
Brian16c503f2007-05-09 16:22:53 -060057
Paul Berry659cded2011-07-05 11:52:06 -070058.PHONY: default doxygen clean realclean distclean install check
Dan Nicholson50f7e6f2008-05-06 11:52:34 -070059
Brian Paulde0ee312004-03-26 15:19:11 +000060# 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:"
Dan Nicholson38c5b142008-05-06 15:46:40 -070065 @ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
Brian Paulde0ee312004-03-26 15:19:11 +000066 @echo
67 @echo "Then type 'make <config>' (ex: 'make linux-x86')"
Dan Nicholson38c5b142008-05-06 15:46:40 -070068 @echo
69 @echo "Or, run './configure' then 'make'"
70 @echo "See './configure --help' for details"
71 @echo
Brian Paulde0ee312004-03-26 15:19:11 +000072 @echo "(ignore the following error message)"
73 @exit 1
74
75
76# Rules to set/install a specific build configuration
77aix \
Karl Schultza16bdb52004-10-01 13:33:26 +000078aix-64 \
Brian Paul294d9ab2006-04-13 03:00:14 +000079aix-64-static \
Brian Paulde0ee312004-03-26 15:19:11 +000080aix-gcc \
Brian Paul6d50d912004-07-01 15:32:51 +000081aix-static \
Dan Nicholsondca1b792007-10-23 09:25:58 -070082autoconf \
Brian792b8822007-08-02 20:26:49 -060083bluegene-osmesa \
Briana5467fb2007-09-20 15:11:14 -060084bluegene-xlc-osmesa \
Alex Neundorfcae5b7f2007-10-24 16:31:22 -060085catamount-osmesa-pgi \
Brian Paulde0ee312004-03-26 15:19:11 +000086darwin \
Jeremy Huddleston7c7fece2008-03-10 15:13:28 -070087darwin-fat-32bit \
88darwin-fat-all \
Brian Paulde0ee312004-03-26 15:19:11 +000089freebsd \
Eric Anholtcc182212004-10-28 00:19:21 +000090freebsd-dri \
Eric Anholtf054fa82005-05-28 20:17:06 +000091freebsd-dri-amd64 \
Eric Anholtcc182212004-10-28 00:19:21 +000092freebsd-dri-x86 \
Brian Paulde0ee312004-03-26 15:19:11 +000093hpux10 \
94hpux10-gcc \
Brian Paulff7d3bb2004-03-30 14:56:47 +000095hpux10-static \
Karl Schultz786eef22004-10-01 20:19:16 +000096hpux11-32 \
Brian Paulde0ee312004-03-26 15:19:11 +000097hpux11-32-static \
98hpux11-32-static-nothreads \
Karl Schultz786eef22004-10-01 20:19:16 +000099hpux11-64 \
Brian Paulde0ee312004-03-26 15:19:11 +0000100hpux11-64-static \
Brian Paul294d9ab2006-04-13 03:00:14 +0000101hpux11-ia64 \
102hpux11-ia64-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000103hpux9 \
104hpux9-gcc \
105irix6-64 \
106irix6-64-static \
107irix6-n32 \
108irix6-n32-static \
109irix6-o32 \
110irix6-o32-static \
111linux \
Keith Whitwell211d7ab2009-11-04 13:03:35 +0000112linux-i965 \
Brian Paulde0ee312004-03-26 15:19:11 +0000113linux-alpha \
114linux-alpha-static \
115linux-debug \
Keith Whitwelle61df582004-04-14 12:44:07 +0000116linux-dri \
Brian15b3bd12007-02-23 11:58:46 -0700117linux-dri-debug \
Dave Airlie898c03a2004-05-03 11:30:37 +0000118linux-dri-x86 \
Keith Whitwell69ab4fe2004-04-30 08:29:04 +0000119linux-dri-x86-64 \
Ian Romanick447cdd52004-10-13 19:56:15 +0000120linux-dri-ppc \
Jeremy Kolb97a30232006-02-19 22:30:46 +0000121linux-dri-xcb \
Jakob Bornecrantz9395fb62008-05-22 16:24:51 +0200122linux-egl \
Ian Romanickdc6e2c72005-07-29 17:25:50 +0000123linux-indirect \
Keith Whitwella5cb1aa2005-04-29 17:31:10 +0000124linux-fbdev \
Brian Paul294d9ab2006-04-13 03:00:14 +0000125linux-ia64-icc \
126linux-ia64-icc-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000127linux-icc \
128linux-icc-static \
Zack Rusinb04430e2007-10-22 11:00:28 -0400129linux-llvm \
Brian Paul6a7b6a52009-12-18 11:17:06 -0700130linux-llvm-debug \
Chia-I Wu97ea8e92009-11-06 16:27:19 +0800131linux-opengl-es \
Brian Paul525eb0b2006-07-04 16:49:58 +0000132linux-osmesa \
Brian Pauldf37cde2009-05-18 08:46:17 -0600133linux-osmesa-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000134linux-osmesa16 \
135linux-osmesa16-static \
136linux-osmesa32 \
137linux-ppc \
138linux-ppc-static \
José Fonseca83a674a2007-09-19 23:43:36 +0100139linux-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000140linux-sparc \
141linux-sparc5 \
142linux-static \
143linux-ultrasparc \
Keith Whitwell6fb23562004-04-14 21:19:34 +0000144linux-tcc \
Brian Paulde0ee312004-03-26 15:19:11 +0000145linux-x86 \
Keith Whitwelle61df582004-04-14 12:44:07 +0000146linux-x86-debug \
Brian Paul7644bfb2005-03-03 01:44:42 +0000147linux-x86-32 \
Brian Paulde0ee312004-03-26 15:19:11 +0000148linux-x86-64 \
Brian Paul42fa8122005-05-07 16:59:58 +0000149linux-x86-64-debug \
José Fonseca59424e22007-09-28 17:17:11 +0000150linux-x86-64-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000151linux-x86-64-static \
José Fonseca59424e22007-09-28 17:17:11 +0000152linux-x86-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000153linux-x86-static \
154netbsd \
155openbsd \
156osf1 \
Brian Paul294d9ab2006-04-13 03:00:14 +0000157osf1-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000158solaris-x86 \
159solaris-x86-gcc \
Brian Paulc717ffa2006-05-17 22:51:44 +0000160solaris-x86-gcc-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000161sunos4 \
162sunos4-gcc \
163sunos4-static \
164sunos5 \
165sunos5-gcc \
Brian Paul9073c402006-04-07 15:16:46 +0000166sunos5-64-gcc \
Brian Paulde0ee312004-03-26 15:19:11 +0000167sunos5-smp \
Brian Paul294d9ab2006-04-13 03:00:14 +0000168sunos5-v8 \
169sunos5-v8-static \
170sunos5-v9 \
171sunos5-v9-static \
Brian2c0b3d82007-07-31 09:32:10 -0600172sunos5-v9-cc-g++ \
Brian Paulde0ee312004-03-26 15:19:11 +0000173ultrix-gcc:
José Fonsecac3168e02010-02-14 13:15:49 +0000174 @ if test -f configs/current -o -L configs/current; then \
175 if ! cmp configs/$@ configs/current > /dev/null; then \
176 echo "Please run 'make realclean' before changing configs" ; \
177 exit 1 ; \
178 fi ; \
179 else \
180 cd configs && rm -f current && ln -s $@ current ; \
Brian Paul31635422006-08-03 16:58:06 +0000181 fi
Eric Anholt2fb5d152004-06-01 00:06:14 +0000182 $(MAKE) default
Brian Paulde0ee312004-03-26 15:19:11 +0000183
184
185# Rules for making release tarballs
186
Ian Romanick46883e02012-02-10 15:34:08 -0800187PACKAGE_VERSION=8.1-devel
José Fonseca9a7f84d2011-07-14 17:28:52 +0100188PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
189PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
Brian Paulde0ee312004-03-26 15:19:11 +0000190
José Fonseca9a7f84d2011-07-14 17:28:52 +0100191EXTRA_FILES = \
192 aclocal.m4 \
193 configure \
Jakob Bornecrantz6fe42b62012-01-12 00:36:23 +0100194 tests/Makefile.in \
195 tests/glx/Makefile.in \
José Fonseca9a7f84d2011-07-14 17:28:52 +0100196 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 \
Jakob Bornecrantz56d05a82012-03-20 13:24:50 +0000202 src/mesa/main/api_exec_es1.c \
203 src/mesa/main/api_exec_es1_dispatch.h \
204 src/mesa/main/api_exec_es1_remap_helper.h \
205 src/mesa/main/api_exec_es2.c \
206 src/mesa/main/api_exec_es2_dispatch.h \
207 src/mesa/main/api_exec_es2_remap_helper.h \
José Fonseca9a7f84d2011-07-14 17:28:52 +0100208 src/mesa/program/lex.yy.c \
209 src/mesa/program/program_parse.tab.c \
210 src/mesa/program/program_parse.tab.h
Chia-I Wu238f7822010-05-07 22:09:45 +0800211
José Fonseca9a7f84d2011-07-14 17:28:52 +0100212IGNORE_FILES = \
213 -x autogen.sh
Brian Paulde0ee312004-03-26 15:19:11 +0000214
Brian Pauldff11bb2005-07-21 18:44:52 +0000215
Ian Romanick654adaa2011-02-11 16:44:11 -0800216parsers: configure
217 -@touch $(TOP)/configs/current
218 $(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
219 $(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
José Fonseca864eb842011-07-14 17:33:30 +0100220 $(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
Ian Romanick654adaa2011-02-11 16:44:11 -0800221
Brian Paul281f8552004-09-09 18:17:36 +0000222# Everything for new a Mesa release:
José Fonseca9a7f84d2011-07-14 17:28:52 +0100223ARCHIVES = $(PACKAGE_NAME).tar.gz \
224 $(PACKAGE_NAME).tar.bz2 \
225 $(PACKAGE_NAME).zip \
Brian Paul281f8552004-09-09 18:17:36 +0000226
Ian Romanick654adaa2011-02-11 16:44:11 -0800227tarballs: md5
José Fonseca9a7f84d2011-07-14 17:28:52 +0100228 rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
Brian Paul281f8552004-09-09 18:17:36 +0000229
Dan Nicholson72796232007-12-05 17:23:00 -0800230# Helper for autoconf builds
231ACLOCAL = aclocal
232ACLOCAL_FLAGS =
233AUTOCONF = autoconf
234AC_FLAGS =
Dan Nicholsond368eed2008-05-05 18:24:21 -0700235aclocal.m4: configure.ac acinclude.m4
Dan Nicholson72796232007-12-05 17:23:00 -0800236 $(ACLOCAL) $(ACLOCAL_FLAGS)
Brian Paul8d044042011-07-19 21:11:53 -0600237configure: configure.ac aclocal.m4 acinclude.m4
Dan Nicholson72796232007-12-05 17:23:00 -0800238 $(AUTOCONF) $(AC_FLAGS)
239
José Fonseca9a7f84d2011-07-14 17:28:52 +0100240manifest.txt: .git
241 ( \
242 ls -1 $(EXTRA_FILES) ; \
243 git ls-files $(IGNORE_FILES) \
244 ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
Brian Paul24e2f612009-10-14 10:56:29 -0600245
José Fonseca9a7f84d2011-07-14 17:28:52 +0100246../$(PACKAGE_DIR):
247 ln -s $(PWD) $@
Brian Paulde0ee312004-03-26 15:19:11 +0000248
José Fonseca9a7f84d2011-07-14 17:28:52 +0100249$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
250 cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
Brian Paul80cef692005-09-10 16:54:05 +0000251
José Fonseca9a7f84d2011-07-14 17:28:52 +0100252$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
253 gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
Brian Paulde0ee312004-03-26 15:19:11 +0000254
José Fonseca9a7f84d2011-07-14 17:28:52 +0100255$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
256 bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
Brian Paul80cef692005-09-10 16:54:05 +0000257
José Fonseca9a7f84d2011-07-14 17:28:52 +0100258$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
259 rm -f $(PACKAGE_NAME).zip ; \
Brian Paulde0ee312004-03-26 15:19:11 +0000260 cd .. ; \
José Fonseca9a7f84d2011-07-14 17:28:52 +0100261 zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
262 mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
Brian Paul80cef692005-09-10 16:54:05 +0000263
Ian Romanick10342842011-02-11 16:27:22 -0800264md5: $(ARCHIVES)
José Fonseca9a7f84d2011-07-14 17:28:52 +0100265 @-md5sum $(PACKAGE_NAME).tar.gz
266 @-md5sum $(PACKAGE_NAME).tar.bz2
267 @-md5sum $(PACKAGE_NAME).zip
Dan Nicholson50f7e6f2008-05-06 11:52:34 -0700268
Dave Airlie989e0132012-02-26 20:20:19 +0000269am--refresh:
270
271.PHONY: tarballs md5 am--refresh