OSDN Git Service

mesa: Add a dist hook to remove .gitignore files from distribution.
[android-x86/external-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 .PHONY: doxygen
30
31 # Rules for making release tarballs
32
33 PACKAGE_DIR = Mesa-$(PACKAGE_VERSION)
34 PACKAGE_NAME = MesaLib-$(PACKAGE_VERSION)
35
36 EXTRA_FILES = \
37         aclocal.m4                                      \
38         configure                                       \
39         bin/ar-lib                                      \
40         bin/compile                                     \
41         bin/config.sub                                  \
42         bin/config.guess                                \
43         bin/depcomp                                     \
44         bin/install-sh                                  \
45         bin/ltmain.sh                                   \
46         bin/missing                                     \
47         bin/ylwrap                                      \
48         bin/test-driver                                 \
49         src/glsl/glsl_parser.cpp                        \
50         src/glsl/glsl_parser.h                          \
51         src/glsl/glsl_lexer.cpp                         \
52         src/glsl/glcpp/glcpp-lex.c                      \
53         src/glsl/glcpp/glcpp-parse.c                    \
54         src/glsl/glcpp/glcpp-parse.h                    \
55         src/mesa/program/lex.yy.c                       \
56         src/mesa/program/program_parse.tab.c            \
57         src/mesa/program/program_parse.tab.h            \
58         `git ls-files | grep "Makefile.am" | sed -e "s/Makefile.am/Makefile.in/"`
59
60 noinst_HEADERS =                                        \
61         include/c99_compat.h                            \
62         include/c99                                     \
63         include/c11                                     \
64         include/D3D9                                    \
65         include/HaikuGL                                 \
66         include/pci_ids
67
68 IGNORE_FILES = \
69         -x autogen.sh
70
71
72 parsers: configure
73         $(MAKE) -C src/glsl glsl_parser.cpp glsl_parser.h glsl_lexer.cpp glcpp/glcpp-lex.c glcpp/glcpp-parse.c glcpp/glcpp-parse.h
74
75 # Everything for new a Mesa release:
76 ARCHIVES = $(PACKAGE_NAME).tar.gz \
77         $(PACKAGE_NAME).tar.bz2 \
78         $(PACKAGE_NAME).zip
79
80 tarballs: checksums
81         rm -f ../$(PACKAGE_DIR) $(PACKAGE_NAME).tar
82
83 manifest.txt: .git
84         ( \
85                 ls -1 $(EXTRA_FILES) ; \
86                 git ls-files $(IGNORE_FILES) \
87         ) | sed -e '/^\(.*\/\)\?\./d' -e "s@^@$(PACKAGE_DIR)/@" > $@
88
89 ../$(PACKAGE_DIR):
90         ln -s $(PWD) $@
91
92 $(PACKAGE_NAME).tar: parsers ../$(PACKAGE_DIR) manifest.txt
93         cd .. ; tar -cf $(PACKAGE_DIR)/$(PACKAGE_NAME).tar -T $(PACKAGE_DIR)/manifest.txt
94
95 $(PACKAGE_NAME).tar.gz: $(PACKAGE_NAME).tar ../$(PACKAGE_DIR)
96         gzip --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.gz
97
98 $(PACKAGE_NAME).tar.bz2: $(PACKAGE_NAME).tar
99         bzip2 --stdout --best $(PACKAGE_NAME).tar > $(PACKAGE_NAME).tar.bz2
100
101 $(PACKAGE_NAME).zip: parsers ../$(PACKAGE_DIR) manifest.txt
102         rm -f $(PACKAGE_NAME).zip ; \
103         cd .. ; \
104         zip -q -@ $(PACKAGE_NAME).zip < $(PACKAGE_DIR)/manifest.txt ; \
105         mv $(PACKAGE_NAME).zip $(PACKAGE_DIR)
106
107 checksums: $(ARCHIVES)
108         @-sha256sum $(PACKAGE_NAME).tar.gz
109         @-sha256sum $(PACKAGE_NAME).tar.bz2
110         @-sha256sum $(PACKAGE_NAME).zip
111
112 .PHONY: tarballs checksums
113
114 # We list some directories in EXTRA_DIST, but don't actually want to include
115 # the .gitignore files in the tarball.
116 dist-hook:
117         find $(distdir) -name .gitignore -exec $(RM) {} +