build: add config.sub and config.guess to tarballs target
[profile/ivi/mesa.git] / Makefile.am
1 # Copyright © 2012 Intel Corporation
2 #
3 # Permission is hereby granted, free of charge, to any person obtaining a
4 # copy of this software and associated documentation files (the "Software"),
5 # to deal in the Software without restriction, including without limitation
6 # the rights to use, copy, modify, merge, publish, distribute, sublicense,
7 # and/or sell copies of the Software, and to permit persons to whom the
8 # Software is furnished to do so, subject to the following conditions:
9 #
10 # The above copyright notice and this permission notice (including the next
11 # paragraph) shall be included in all copies or substantial portions of the
12 # Software.
13 #
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
17 # THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18 # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19 # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
20 # IN THE SOFTWARE.
21
22 SUBDIRS = src
23
24 ACLOCAL_AMFLAGS = -I m4
25
26 doxygen:
27         cd doxygen && $(MAKE)
28
29 check-local:
30         $(MAKE) -C src/mapi/glapi/tests check
31         $(MAKE) -C src/mapi/shared-glapi/tests check
32         $(MAKE) -C src/mesa/main/tests check
33         $(MAKE) -C src/glsl/tests check
34         $(MAKE) -C src/glx/tests check
35
36 clean-local:
37         -@touch $(top_builddir)/configs/current
38         -@for dir in $(SUBDIRS) ; do \
39                 if [ -d $$dir ] ; then \
40                         (cd $$dir && $(MAKE) clean) ; \
41                 fi \
42         done
43         -@test -s $(top_builddir)/configs/current || rm -f $(top_builddir)/configs/current
44
45
46
47 distclean-local:
48         -rm -rf lib*
49         -rm -f $(top_builddir)/configs/current
50         -find . '(' -name '*.o' -o -name '*.a' -o -name '*.so' -o \
51           -name depend -o -name depend.bak ')' -exec rm -f '{}' ';'
52
53 .PHONY: doxygen
54
55 # Rules for making release tarballs
56
57 PACKAGE_VERSION=9.0.1
58 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
59 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
60
61 EXTRA_FILES = \
62         aclocal.m4                                      \
63         configure                                       \
64         bin/config.sub                                  \
65         bin/config.guess                                \
66         bin/install-sh                                  \
67         src/glsl/glsl_parser.cc                         \
68         src/glsl/glsl_parser.h                          \
69         src/glsl/glsl_lexer.cc                          \
70         src/glsl/glcpp/glcpp-lex.c                      \
71         src/glsl/glcpp/glcpp-parse.c                    \
72         src/glsl/glcpp/glcpp-parse.h                    \
73         src/mesa/main/api_exec_es1.c                    \
74         src/mesa/main/api_exec_es1_dispatch.h           \
75         src/mesa/main/api_exec_es1_remap_helper.h       \
76         src/mesa/main/api_exec_es2.c                    \
77         src/mesa/main/api_exec_es2_dispatch.h           \
78         src/mesa/main/api_exec_es2_remap_helper.h       \
79         src/mesa/program/lex.yy.c                       \
80         src/mesa/program/program_parse.tab.c            \
81         src/mesa/program/program_parse.tab.h
82
83 IGNORE_FILES = \
84         -x autogen.sh
85
86
87 parsers: configure
88         -@touch $(top_builddir)/configs/current
89         $(MAKE) -C src/glsl glsl_parser.cc glsl_parser.h glsl_lexer.cc
90         $(MAKE) -C src/glsl/glcpp glcpp-lex.c glcpp-parse.c glcpp-parse.h
91         $(MAKE) -C src/mesa program/lex.yy.c program/program_parse.tab.c program/program_parse.tab.h
92
93 # Everything for new a Mesa release:
94 ARCHIVES = $(PACKAGE_NAME).tar.gz \
95         $(PACKAGE_NAME).tar.bz2 \
96         $(PACKAGE_NAME).zip
97
98 tarballs: md5
99         rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
100
101 manifest.txt: .git
102         ( \
103                 ls -1 $(EXTRA_FILES) ; \
104                 git ls-files $(IGNORE_FILES) \
105         ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
106
107 ../$(PACKAGE_DIR):
108         ln -s $(PWD) $@
109
110 $(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
111         cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
112
113 $(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
114         gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
115
116 $(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
117         bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
118
119 $(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
120         rm -f $(PACKAGE_NAME).zip ; \
121         cd .. ; \
122         zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
123         mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
124
125 md5: $(ARCHIVES)
126         @-md5sum $(PACKAGE_NAME).tar.gz
127         @-md5sum $(PACKAGE_NAME).tar.bz2
128         @-md5sum $(PACKAGE_NAME).zip
129
130 .PHONY: tarballs md5