Upgrade to libtasn1 4.19.0
[platform/upstream/libtasn1.git] / Makefile.am
1 ## Process this file with automake to produce Makefile.in
2 # Copyright (C) 2002-2022 Free Software Foundation, Inc.
3 #
4 # This file is part of LIBTASN1.
5 #
6 # This program is free software: you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
10 #
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 # GNU General Public License for more details.
15 #
16 # You should have received a copy of the GNU General Public License
17 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
19 DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc
20 AM_DISTCHECK_DVI_TARGET = html
21
22 EXTRA_DIST = windows/asn1-parser/asn1-parser.vcproj                     \
23         windows/asn1-parser/config.h windows/libtasn1.ncb               \
24         windows/libtasn1.sln windows/libtasn1.suo                       \
25         windows/gnulib/getopt.h windows/gnulib/gnulib.vcproj            \
26         windows/libtasn1/libtasn1.vcproj                                \
27         windows/test-parser/test-parser.vcproj                          \
28         windows/test-tree/test-tree.vcproj windows/libtasn14win.mk
29 EXTRA_DIST += cfg.mk maint.mk CONTRIBUTING.md README.md
30
31 SUBDIRS = lib src fuzz tests
32
33 if ENABLE_DOC
34 SUBDIRS += doc examples
35 endif
36
37 include $(top_srcdir)/aminclude_static.am
38
39 ACLOCAL_AMFLAGS = -I m4 -I src/gl/m4
40
41 ABIDW_COMMON = --no-show-locs --no-corpus-path
42 ABIGNORE_FILE = "$(top_srcdir)/devel/libtasn1.abignore"
43 LIBGNUTLS_ABI_LAST_FILE = "$(top_srcdir)/devel/libtasn1-latest-$$(uname -m).abi"
44
45 abi-dump-versioned: lib/libtasn1.la
46         @echo "**************************************************"
47         @echo "Generating versioned ABI files of current libtasn1"
48         @echo "**************************************************"
49         @abidw lib/.libs/libtasn1.so $(ABIDW_COMMON) --suppressions $(ABIGNORE_FILE) --out-file "$(srcdir)/devel/libtasn1-$(VERSION)-$$(uname -m).abi"
50
51 abi-dump-latest: lib/libtasn1.la
52         @echo "****************************************"
53         @echo "Generating ABI files of current libtasn1"
54         @echo "****************************************"
55         @abidw lib/.libs/libtasn1.so $(ABIDW_COMMON) --suppressions $(ABIGNORE_FILE) --out-file $(LIBGNUTLS_ABI_LAST_FILE)
56         @rm -f "./devel/libtasn1-latest-$$(uname -m).tmp"
57
58 abi-check-latest: lib/libtasn1.la
59         @echo "Checking whether the latest ABI dump matches"
60         @abidiff --suppressions $(ABIGNORE_FILE) lib/.libs/libtasn1.so $(LIBGNUTLS_ABI_LAST_FILE) --hd2 "$(builddir)/lib/includes/"; if test $$? != 0;then \
61                 echo "*********************************************************"; \
62                 echo "libtasn1 ABI has changed; use 'make files-update'       "; \
63                 echo "and use 'git diff' to check correctness before committing"; \
64                 echo "*********************************************************"; \
65                 false; \
66         fi
67         @echo "********************************"
68         @echo "Current release matches ABI dump"
69         @echo "********************************"
70
71 ABICHECK_COMMON = --no-added-syms
72 abi-check: lib/libtasn1.la
73         for file in $$(echo $(srcdir)/devel/libtasn1-*-$$(uname -m).abi);do \
74                 echo "Comparing libtasn1 with $$file"; \
75                 abidiff $${file} lib/.libs/libtasn1.so $(ABICHECK_COMMON) --suppressions $(ABIGNORE_FILE) --hd2 "$(builddir)/lib/includes//"; \
76                 if test $$? != 0;then \
77                         echo "****************************************************************************"; \
78                         echo "ABI check failed; If intentional add suppression in devel/libtasn1.abignore"; \
79                         echo "****************************************************************************"; \
80                         false; \
81                 fi; \
82         done
83         @echo "********************"
84         @echo "ABI checks completed"
85         @echo "********************"
86
87 files-update: abi-dump-latest
88
89 local-code-coverage-output: code-coverage-capture
90         cat "GNU Libtasn1-$(VERSION)-coverage/index.html"|grep headerCovTableEntry|grep '%'|head -1|sed 's/^.*>\([0-9]\+\.[0-9]\+\s*%\)<.*$$/ coverage lines: \1/' || true
91
92 clean-local: code-coverage-clean
93 distclean-local: code-coverage-dist-clean
94
95 # git-version-gen
96 EXTRA_DIST += $(top_srcdir)/.version
97 BUILT_SOURCES = $(top_srcdir)/.version
98 $(top_srcdir)/.version:
99         echo $(VERSION) > $@-t && mv $@-t $@
100 dist-hook: gen-ChangeLog
101         echo $(VERSION) > $(distdir)/.tarball-version
102         if test -d "$(top_srcdir)/devel"; then \
103                 $(MAKE) -C $(top_builddir) abi-check-latest; \
104                 make -C doc/ compare-makefile; \
105         fi
106
107 .PHONY: gen-ChangeLog
108 gen-ChangeLog:
109         $(AM_V_GEN)if test -d .git; then                                \
110                 $(top_srcdir)/build-aux/gitlog-to-changelog >           \
111                         $(distdir)/cl-t &&                              \
112                 { rm -f $(distdir)/ChangeLog &&                         \
113                   mv $(distdir)/cl-t $(distdir)/ChangeLog; }            \
114         fi
115
116 .PHONY: abi-check abi-dump-versioned abi-dump-latest