blob: 6bd4cfdfffb6f433c16e3e624ee8bb71a37ae99a [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
Brian Paulde0ee312004-03-26 15:19:11 +000024clean:
Dan Nicholsona6464b32008-05-07 11:35:23 -070025 -@touch $(TOP)/configs/current
26 -@for dir in $(SUBDIRS) ; do \
Brian16c503f2007-05-09 16:22:53 -060027 if [ -d $$dir ] ; then \
28 (cd $$dir && $(MAKE) clean) ; \
29 fi \
Brian Paulde0ee312004-03-26 15:19:11 +000030 done
Dan Nicholsona6464b32008-05-07 11:35:23 -070031 -@test -s $(TOP)/configs/current || rm -f $(TOP)/configs/current
Brian Paulde0ee312004-03-26 15:19:11 +000032
33
Dan Nicholsona6464b32008-05-07 11:35:23 -070034realclean: clean
Brian Paulde0ee312004-03-26 15:19:11 +000035 -rm -rf lib*
36 -rm -f $(TOP)/configs/current
Dan Nicholsondca1b792007-10-23 09:25:58 -070037 -rm -f $(TOP)/configs/autoconf
38 -rm -rf autom4te.cache
Dan Nicholsonc5e2b852008-05-06 14:00:43 -070039 -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
40 -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
Keith Whitwellae68c322004-12-15 11:03:41 +000041
Brian Paulde0ee312004-03-26 15:19:11 +000042
Brian Paul666702b2009-04-16 09:31:45 -060043distclean: realclean
44
45
Brian Paulde0ee312004-03-26 15:19:11 +000046install:
Brian Paul0e794a12006-06-22 22:50:48 +000047 @for dir in $(SUBDIRS) ; do \
Brian16c503f2007-05-09 16:22:53 -060048 if [ -d $$dir ] ; then \
49 (cd $$dir && $(MAKE) install) || exit 1 ; \
50 fi \
Brian Paul0e794a12006-06-22 22:50:48 +000051 done
Brian Paul81ca6162005-01-03 15:35:00 +000052
Brian16c503f2007-05-09 16:22:53 -060053
Kristian Høgsberg43875802010-02-25 15:49:18 -050054.PHONY: default doxygen clean realclean distclean install
Dan Nicholson50f7e6f2008-05-06 11:52:34 -070055
Brian Paulde0ee312004-03-26 15:19:11 +000056# If there's no current configuration file
57$(TOP)/configs/current:
58 @echo
59 @echo
60 @echo "Please choose a configuration from the following list:"
Dan Nicholson38c5b142008-05-06 15:46:40 -070061 @ls -1 $(TOP)/configs | grep -v "current\|default\|CVS\|autoconf.*"
Brian Paulde0ee312004-03-26 15:19:11 +000062 @echo
63 @echo "Then type 'make <config>' (ex: 'make linux-x86')"
Dan Nicholson38c5b142008-05-06 15:46:40 -070064 @echo
65 @echo "Or, run './configure' then 'make'"
66 @echo "See './configure --help' for details"
67 @echo
Brian Paulde0ee312004-03-26 15:19:11 +000068 @echo "(ignore the following error message)"
69 @exit 1
70
71
72# Rules to set/install a specific build configuration
73aix \
Karl Schultza16bdb52004-10-01 13:33:26 +000074aix-64 \
Brian Paul294d9ab2006-04-13 03:00:14 +000075aix-64-static \
Brian Paulde0ee312004-03-26 15:19:11 +000076aix-gcc \
Brian Paul6d50d912004-07-01 15:32:51 +000077aix-static \
Dan Nicholsondca1b792007-10-23 09:25:58 -070078autoconf \
Brian792b8822007-08-02 20:26:49 -060079bluegene-osmesa \
Briana5467fb2007-09-20 15:11:14 -060080bluegene-xlc-osmesa \
Philippe Houdoin92ec9972004-08-14 10:10:42 +000081beos \
Alex Neundorfcae5b7f2007-10-24 16:31:22 -060082catamount-osmesa-pgi \
Brian Paulde0ee312004-03-26 15:19:11 +000083darwin \
Jeremy Huddleston7c7fece2008-03-10 15:13:28 -070084darwin-fat-32bit \
85darwin-fat-all \
Brian Paulde0ee312004-03-26 15:19:11 +000086freebsd \
Eric Anholtcc182212004-10-28 00:19:21 +000087freebsd-dri \
Eric Anholtf054fa82005-05-28 20:17:06 +000088freebsd-dri-amd64 \
Eric Anholtcc182212004-10-28 00:19:21 +000089freebsd-dri-x86 \
Brian Paulde0ee312004-03-26 15:19:11 +000090hpux10 \
91hpux10-gcc \
Brian Paulff7d3bb2004-03-30 14:56:47 +000092hpux10-static \
Karl Schultz786eef22004-10-01 20:19:16 +000093hpux11-32 \
Brian Paulde0ee312004-03-26 15:19:11 +000094hpux11-32-static \
95hpux11-32-static-nothreads \
Karl Schultz786eef22004-10-01 20:19:16 +000096hpux11-64 \
Brian Paulde0ee312004-03-26 15:19:11 +000097hpux11-64-static \
Brian Paul294d9ab2006-04-13 03:00:14 +000098hpux11-ia64 \
99hpux11-ia64-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000100hpux9 \
101hpux9-gcc \
102irix6-64 \
103irix6-64-static \
104irix6-n32 \
105irix6-n32-static \
106irix6-o32 \
107irix6-o32-static \
108linux \
Keith Whitwell211d7ab2009-11-04 13:03:35 +0000109linux-i965 \
Brian Paulde0ee312004-03-26 15:19:11 +0000110linux-alpha \
111linux-alpha-static \
Brian88b715b2007-12-02 15:23:51 -0700112linux-cell \
Brian Paulab93aa72008-09-03 09:08:19 -0600113linux-cell-debug \
Brian Paulde0ee312004-03-26 15:19:11 +0000114linux-debug \
Keith Whitwelle61df582004-04-14 12:44:07 +0000115linux-dri \
Brian15b3bd12007-02-23 11:58:46 -0700116linux-dri-debug \
Dave Airlie898c03a2004-05-03 11:30:37 +0000117linux-dri-x86 \
Keith Whitwell69ab4fe2004-04-30 08:29:04 +0000118linux-dri-x86-64 \
Ian Romanick447cdd52004-10-13 19:56:15 +0000119linux-dri-ppc \
Jeremy Kolb97a30232006-02-19 22:30:46 +0000120linux-dri-xcb \
Jakob Bornecrantz9395fb62008-05-22 16:24:51 +0200121linux-egl \
Ian Romanickdc6e2c72005-07-29 17:25:50 +0000122linux-indirect \
Keith Whitwella5cb1aa2005-04-29 17:31:10 +0000123linux-fbdev \
Brian Paul294d9ab2006-04-13 03:00:14 +0000124linux-ia64-icc \
125linux-ia64-icc-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000126linux-icc \
127linux-icc-static \
Zack Rusinb04430e2007-10-22 11:00:28 -0400128linux-llvm \
Brian Paul6a7b6a52009-12-18 11:17:06 -0700129linux-llvm-debug \
Chia-I Wu97ea8e92009-11-06 16:27:19 +0800130linux-opengl-es \
Brian Paul525eb0b2006-07-04 16:49:58 +0000131linux-osmesa \
Brian Pauldf37cde2009-05-18 08:46:17 -0600132linux-osmesa-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000133linux-osmesa16 \
134linux-osmesa16-static \
135linux-osmesa32 \
136linux-ppc \
137linux-ppc-static \
José Fonseca83a674a2007-09-19 23:43:36 +0100138linux-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000139linux-sparc \
140linux-sparc5 \
141linux-static \
142linux-ultrasparc \
Keith Whitwell6fb23562004-04-14 21:19:34 +0000143linux-tcc \
Brian Paulde0ee312004-03-26 15:19:11 +0000144linux-x86 \
Keith Whitwelle61df582004-04-14 12:44:07 +0000145linux-x86-debug \
Brian Paul7644bfb2005-03-03 01:44:42 +0000146linux-x86-32 \
Brian Paulde0ee312004-03-26 15:19:11 +0000147linux-x86-64 \
Brian Paul42fa8122005-05-07 16:59:58 +0000148linux-x86-64-debug \
José Fonseca59424e22007-09-28 17:17:11 +0000149linux-x86-64-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000150linux-x86-64-static \
José Fonseca59424e22007-09-28 17:17:11 +0000151linux-x86-profile \
Brian Paulde0ee312004-03-26 15:19:11 +0000152linux-x86-static \
153netbsd \
154openbsd \
155osf1 \
Brian Paul294d9ab2006-04-13 03:00:14 +0000156osf1-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000157solaris-x86 \
158solaris-x86-gcc \
Brian Paulc717ffa2006-05-17 22:51:44 +0000159solaris-x86-gcc-static \
Brian Paulde0ee312004-03-26 15:19:11 +0000160sunos4 \
161sunos4-gcc \
162sunos4-static \
163sunos5 \
164sunos5-gcc \
Brian Paul9073c402006-04-07 15:16:46 +0000165sunos5-64-gcc \
Brian Paulde0ee312004-03-26 15:19:11 +0000166sunos5-smp \
Brian Paul294d9ab2006-04-13 03:00:14 +0000167sunos5-v8 \
168sunos5-v8-static \
169sunos5-v9 \
170sunos5-v9-static \
Brian2c0b3d82007-07-31 09:32:10 -0600171sunos5-v9-cc-g++ \
Brian Paulde0ee312004-03-26 15:19:11 +0000172ultrix-gcc:
José Fonsecac3168e02010-02-14 13:15:49 +0000173 @ if test -f configs/current -o -L configs/current; then \
174 if ! cmp configs/$@ configs/current > /dev/null; then \
175 echo "Please run 'make realclean' before changing configs" ; \
176 exit 1 ; \
177 fi ; \
178 else \
179 cd configs && rm -f current && ln -s $@ current ; \
Brian Paul31635422006-08-03 16:58:06 +0000180 fi
Eric Anholt2fb5d152004-06-01 00:06:14 +0000181 $(MAKE) default
Brian Paulde0ee312004-03-26 15:19:11 +0000182
183
184# Rules for making release tarballs
185
José Fonseca9a7f84d2011-07-14 17:28:52 +0100186PACKAGE_VERSION=7.12-devel
187PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
188PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
Brian Paulde0ee312004-03-26 15:19:11 +0000189
José Fonseca9a7f84d2011-07-14 17:28:52 +0100190EXTRA_FILES = \
191 aclocal.m4 \
192 configure \
193 src/glsl/glsl_parser.cpp \
194 src/glsl/glsl_parser.h \
195 src/glsl/glsl_lexer.cpp \
196 src/glsl/glcpp/glcpp-lex.c \
197 src/glsl/glcpp/glcpp-parse.c \
198 src/glsl/glcpp/glcpp-parse.h \
199 src/mesa/program/lex.yy.c \
200 src/mesa/program/program_parse.tab.c \
201 src/mesa/program/program_parse.tab.h
Chia-I Wu238f7822010-05-07 22:09:45 +0800202
José Fonseca9a7f84d2011-07-14 17:28:52 +0100203IGNORE_FILES = \
204 -x autogen.sh
Brian Paulde0ee312004-03-26 15:19:11 +0000205
Brian Paul3e2419a2005-07-22 15:52:46 +0000206DEPEND_FILES = \
José Fonseca9a7f84d2011-07-14 17:28:52 +0100207 src/mesa/depend \
208 src/glx/depend \
209 src/glw/depend \
210 src/glu/sgi/depend
Brian Paul3e2419a2005-07-22 15:52:46 +0000211
Brian Pauldff11bb2005-07-21 18:44:52 +0000212
Ian Romanick654adaa2011-02-11 16:44:11 -0800213parsers: configure
214 -@touch $(TOP)/configs/current
215 $(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp
216 $(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
217 $(MAKE) -C src/mesa/program lex.yy.c program_parse.tab.c program_parse.tab.h
218
Brian Paul281f8552004-09-09 18:17:36 +0000219# Everything for new a Mesa release:
José Fonseca9a7f84d2011-07-14 17:28:52 +0100220ARCHIVES = $(PACKAGE_NAME).tar.gz \
221 $(PACKAGE_NAME).tar.bz2 \
222 $(PACKAGE_NAME).zip \
Brian Paul281f8552004-09-09 18:17:36 +0000223
Ian Romanick654adaa2011-02-11 16:44:11 -0800224tarballs: md5
José Fonseca9a7f84d2011-07-14 17:28:52 +0100225 rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
Brian Paul281f8552004-09-09 18:17:36 +0000226
Dan Nicholson72796232007-12-05 17:23:00 -0800227# Helper for autoconf builds
228ACLOCAL = aclocal
229ACLOCAL_FLAGS =
230AUTOCONF = autoconf
231AC_FLAGS =
Dan Nicholsond368eed2008-05-05 18:24:21 -0700232aclocal.m4: configure.ac acinclude.m4
Dan Nicholson72796232007-12-05 17:23:00 -0800233 $(ACLOCAL) $(ACLOCAL_FLAGS)
Ian Romanick654adaa2011-02-11 16:44:11 -0800234configure: rm_depend configure.ac aclocal.m4 acinclude.m4
Dan Nicholson72796232007-12-05 17:23:00 -0800235 $(AUTOCONF) $(AC_FLAGS)
236
Brian Paul3e2419a2005-07-22 15:52:46 +0000237rm_depend:
238 @for dep in $(DEPEND_FILES) ; do \
239 rm -f $$dep ; \
240 touch $$dep ; \
241 done
242
José Fonseca9a7f84d2011-07-14 17:28:52 +0100243manifest.txt: .git
244 ( \
245 ls -1 $(EXTRA_FILES) ; \
246 git ls-files $(IGNORE_FILES) \
247 ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
Brian Paul24e2f612009-10-14 10:56:29 -0600248
José Fonseca9a7f84d2011-07-14 17:28:52 +0100249../$(PACKAGE_DIR):
250 ln -s $(PWD) $@
Brian Paulde0ee312004-03-26 15:19:11 +0000251
José Fonseca9a7f84d2011-07-14 17:28:52 +0100252$(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
253 cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
Brian Paul80cef692005-09-10 16:54:05 +0000254
José Fonseca9a7f84d2011-07-14 17:28:52 +0100255$(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
256 gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
Brian Paulde0ee312004-03-26 15:19:11 +0000257
José Fonseca9a7f84d2011-07-14 17:28:52 +0100258$(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
259 bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
Brian Paul80cef692005-09-10 16:54:05 +0000260
José Fonseca9a7f84d2011-07-14 17:28:52 +0100261$(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
262 rm -f $(PACKAGE_NAME).zip ; \
Brian Paulde0ee312004-03-26 15:19:11 +0000263 cd .. ; \
José Fonseca9a7f84d2011-07-14 17:28:52 +0100264 zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
265 mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
Brian Paul80cef692005-09-10 16:54:05 +0000266
Ian Romanick10342842011-02-11 16:27:22 -0800267md5: $(ARCHIVES)
José Fonseca9a7f84d2011-07-14 17:28:52 +0100268 @-md5sum $(PACKAGE_NAME).tar.gz
269 @-md5sum $(PACKAGE_NAME).tar.bz2
270 @-md5sum $(PACKAGE_NAME).zip
Dan Nicholson50f7e6f2008-05-06 11:52:34 -0700271
José Fonseca9a7f84d2011-07-14 17:28:52 +0100272.PHONY: tarballs rm_depend md5