blob: d65d4c4968e71596ca5d830e9696cac12f1b5c60 [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
26 @echo "All tests passed."
27
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 \
Brian88b715b2007-12-02 15:23:51 -0700115linux-cell \
Brian Paulab93aa72008-09-03 09:08:19 -0600116linux-cell-debug \
Brian Paulde0ee312004-03-26 15:19:11 +0000117linux-debug \
Keith Whitwelle61df582004-04-14 12:44:07 +0000118linux-dri \
Brian15b3bd12007-02-23 11:58:46 -0700119linux-dri-debug \
Dave Airlie898c03a2004-05-03 11:30:37 +0000120linux-dri-x86 \
Keith Whitwell69ab4fe2004-04-30 08:29:04 +0000121linux-dri-x86-64 \
Ian Romanick447cdd52004-10-13 19:56:15 +0000122linux-dri-ppc \
Jeremy Kolb97a30232006-02-19 22:30:46 +0000123linux-dri-xcb \
Jakob Bornecrantz9395fb62008-05-22 16:24:51 +0200124linux-egl \
Ian Romanickdc6e2c72005-07-29 17:25:50 +0000125linux-indirect \
Keith Whitwella5cb1aa2005-04-29 17:31:10 +0000126linux-fbdev \
Brian Paul294d9ab2006-04-13 03:00:14 +0000127linux-ia64-icc \
128linux-ia64-icc-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000129linux-icc \
130linux-icc-static \
Zack Rusinb04430e2007-10-22 11:00:28 -0400131linux-llvm \
Brian Paul6a7b6a52009-12-18 11:17:06 -0700132linux-llvm-debug \
Chia-I Wu97ea8e92009-11-06 16:27:19 +0800133linux-opengl-es \
Brian Paul525eb0b2006-07-04 16:49:58 +0000134linux-osmesa \
Brian Pauldf37cde2009-05-18 08:46:17 -0600135linux-osmesa-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000136linux-osmesa16 \
137linux-osmesa16-static \
138linux-osmesa32 \
139linux-ppc \
140linux-ppc-static \
José Fonseca83a674a2007-09-19 23:43:36 +0100141linux-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000142linux-sparc \
143linux-sparc5 \
144linux-static \
145linux-ultrasparc \
Keith Whitwell6fb23562004-04-14 21:19:34 +0000146linux-tcc \
Brian Paulde0ee312004-03-26 15:19:11 +0000147linux-x86 \
Keith Whitwelle61df582004-04-14 12:44:07 +0000148linux-x86-debug \
Brian Paul7644bfb2005-03-03 01:44:42 +0000149linux-x86-32 \
Brian Paulde0ee312004-03-26 15:19:11 +0000150linux-x86-64 \
Brian Paul42fa8122005-05-07 16:59:58 +0000151linux-x86-64-debug \
José Fonseca59424e22007-09-28 17:17:11 +0000152linux-x86-64-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000153linux-x86-64-static \
José Fonseca59424e22007-09-28 17:17:11 +0000154linux-x86-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000155linux-x86-static \
156netbsd \
157openbsd \
158osf1 \
Brian Paul294d9ab2006-04-13 03:00:14 +0000159osf1-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000160solaris-x86 \
161solaris-x86-gcc \
Brian Paulc717ffa2006-05-17 22:51:44 +0000162solaris-x86-gcc-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000163sunos4 \
164sunos4-gcc \
165sunos4-static \
166sunos5 \
167sunos5-gcc \
Brian Paul9073c402006-04-07 15:16:46 +0000168sunos5-64-gcc \
Brian Paulde0ee312004-03-26 15:19:11 +0000169sunos5-smp \
Brian Paul294d9ab2006-04-13 03:00:14 +0000170sunos5-v8 \
171sunos5-v8-static \
172sunos5-v9 \
173sunos5-v9-static \
Brian2c0b3d82007-07-31 09:32:10 -0600174sunos5-v9-cc-g++ \
Brian Paulde0ee312004-03-26 15:19:11 +0000175ultrix-gcc:
José Fonsecac3168e02010-02-14 13:15:49 +0000176 @ 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 ; \
Brian Paul31635422006-08-03 16:58:06 +0000183 fi
Eric Anholt2fb5d152004-06-01 00:06:14 +0000184 $(MAKE) default
Brian Paulde0ee312004-03-26 15:19:11 +0000185
186
187# Rules for making release tarballs
188
José Fonseca9a7f84d2011-07-14 17:28:52 +0100189PACKAGE_VERSION=7.12-devel
190PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
191PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
Brian Paulde0ee312004-03-26 15:19:11 +0000192
José Fonseca9a7f84d2011-07-14 17:28:52 +0100193EXTRA_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
Chia-I Wu238f7822010-05-07 22:09:45 +0800205
José Fonseca9a7f84d2011-07-14 17:28:52 +0100206IGNORE_FILES = \
207 -x autogen.sh
Brian Paulde0ee312004-03-26 15:19:11 +0000208
Brian Pauldff11bb2005-07-21 18:44:52 +0000209
Ian Romanick654adaa2011-02-11 16:44:11 -0800210parsers: 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
José Fonseca864eb842011-07-14 17:33:30 +0100214 $(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 -0800215
Brian Paul281f8552004-09-09 18:17:36 +0000216# Everything for new a Mesa release:
José Fonseca9a7f84d2011-07-14 17:28:52 +0100217ARCHIVES = $(PACKAGE_NAME).tar.gz \
218 $(PACKAGE_NAME).tar.bz2 \
219 $(PACKAGE_NAME).zip \
Brian Paul281f8552004-09-09 18:17:36 +0000220
Ian Romanick654adaa2011-02-11 16:44:11 -0800221tarballs: md5
José Fonseca9a7f84d2011-07-14 17:28:52 +0100222 rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
Brian Paul281f8552004-09-09 18:17:36 +0000223
Dan Nicholson72796232007-12-05 17:23:00 -0800224# Helper for autoconf builds
225ACLOCAL = aclocal
226ACLOCAL_FLAGS =
227AUTOCONF = autoconf
228AC_FLAGS =
Dan Nicholsond368eed2008-05-05 18:24:21 -0700229aclocal.m4: configure.ac acinclude.m4
Dan Nicholson72796232007-12-05 17:23:00 -0800230 $(ACLOCAL) $(ACLOCAL_FLAGS)
Brian Paul8d044042011-07-19 21:11:53 -0600231configure: configure.ac aclocal.m4 acinclude.m4
Dan Nicholson72796232007-12-05 17:23:00 -0800232 $(AUTOCONF) $(AC_FLAGS)
233
José Fonseca9a7f84d2011-07-14 17:28:52 +0100234manifest.txt: .git
235 ( \
236 ls -1 $(EXTRA_FILES) ; \
237 git ls-files $(IGNORE_FILES) \
238 ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
Brian Paul24e2f612009-10-14 10:56:29 -0600239
José Fonseca9a7f84d2011-07-14 17:28:52 +0100240../$(PACKAGE_DIR):
241 ln -s $(PWD) $@
Brian Paulde0ee312004-03-26 15:19:11 +0000242
José Fonseca9a7f84d2011-07-14 17:28:52 +0100243$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
244 cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
Brian Paul80cef692005-09-10 16:54:05 +0000245
José Fonseca9a7f84d2011-07-14 17:28:52 +0100246$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
247 gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
Brian Paulde0ee312004-03-26 15:19:11 +0000248
José Fonseca9a7f84d2011-07-14 17:28:52 +0100249$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
250 bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
Brian Paul80cef692005-09-10 16:54:05 +0000251
José Fonseca9a7f84d2011-07-14 17:28:52 +0100252$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
253 rm -f $(PACKAGE_NAME).zip ; \
Brian Paulde0ee312004-03-26 15:19:11 +0000254 cd .. ; \
José Fonseca9a7f84d2011-07-14 17:28:52 +0100255 zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
256 mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
Brian Paul80cef692005-09-10 16:54:05 +0000257
Ian Romanick10342842011-02-11 16:27:22 -0800258md5: $(ARCHIVES)
José Fonseca9a7f84d2011-07-14 17:28:52 +0100259 @-md5sum $(PACKAGE_NAME).tar.gz
260 @-md5sum $(PACKAGE_NAME).tar.bz2
261 @-md5sum $(PACKAGE_NAME).zip
Dan Nicholson50f7e6f2008-05-06 11:52:34 -0700262
Brian Paul8d044042011-07-19 21:11:53 -0600263.PHONY: tarballs md5