OSDN Git Service

libparted: gpt: avoid invalid free with many (~100) partitions
[android-x86/external-parted.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2 SUBDIRS = po lib include libparted parted partprobe doc debug tests
3
4 EXTRA_DIST =                            \
5   .version                              \
6   .prev-version                         \
7   BUGS                                  \
8   libparted.pc.in                       \
9   parted.spec.in                        \
10   parted.spec                           \
11   scripts/data/abi/baseline_symbols.txt \
12   scripts/extract_symvers               \
13   cfg.mk                                \
14   dist-check.mk                         \
15   maint.mk                              \
16   GNUmakefile
17
18 aclocaldir=$(datadir)/aclocal
19
20 pcdir = $(libdir)/pkgconfig
21 pc_DATA = libparted.pc
22
23 # This is best not done via configure.ac, because automake's
24 # make distcheck target does not like auto-generated files
25 # being included in the distributed archive.
26 parted.spec: parted.spec.in
27         sed 's/@''PACKAGE@/$(PACKAGE)/;s/@''VERSION@/$(VERSION)/' $< > $@-tmp
28         mv $@-tmp $@
29 MAINTAINERCLEANFILES = parted.spec
30
31 .PHONY: root-check
32 root-check:
33         sudo sh -c '$(MAKE) check; t=$$?; chown -R $(USER) .; exit $$t'
34
35 # Not everyone who runs "make distcheck" will want to or even
36 # be able to run the root tests.  If you want to skip them,
37 # run make like this: "make distcheck root-check="
38 root_check ?= root-check
39 distcheck-hook: $(root_check)
40         $(MAKE) my-distcheck
41
42 ### ABI Checking scripts ###
43
44 baseline_file = ${top_srcdir}/scripts/data/abi/baseline_symbols.txt
45 extract_symvers = $(top_srcdir)/scripts/extract_symvers
46
47 current_symbols.txt: ${extract_symvers}
48           -@(sh ${extract_symvers} libparted/.libs/libparted.so current_symbols.txt)
49
50 baseline_symbols:
51         -@(output=${baseline_file}; \
52           if test ! -f $${output}; then \
53             echo "Baseline file doesn't exist."; \
54             echo "Try 'make new-abi-baseline' to create it."; \
55             exit 1; \
56           fi; true)
57
58 new-abi-baseline:
59         -@$(mkinstalldirs) ${baseline_dir}
60         -@(output=${baseline_file}; \
61           if test -f $${output}; then \
62             output=$${output}.new; \
63             t=`echo $${output} | sed 's=.*config/abi/=='`; \
64             echo "Baseline file already exists, writing to $${t} instead."; \
65           fi; \
66           sh ${extract_symvers} libparted/.libs/libparted.so $${output})
67
68 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
69 # 'check-abi' to test for changes against that file.
70 check-abi: baseline_symbols current_symbols.txt
71         @diff -u ${baseline_file} ./current_symbols.txt 2>&1 \
72          | tee libparted.abi-diff
73         @test `wc -l < libparted.abi-diff` -eq 0 && exit 0 \
74          || echo "ABI has changed. Please, update you ABI package version." \
75          && exit 1
76
77 MOSTLYCLEANDIRS = m4
78
79 MAINTAINERCLEANFILES += \
80   ABOUT-NLS     \
81   ChangeLog     \
82   INSTALL       \
83   aclocal.m4    \
84   configure
85
86 .PHONY: ss-1024 ss-2048 ss-4096
87 ss-1024 ss-2048 ss-4096:
88         PARTED_SECTOR_SIZE=$(subst ss-,,$@) $(MAKE) check-recursive
89
90 # Run the regression test suite with different settings,
91 # to ensure it works with simulated partition sizes > 512.
92 .PHONY: check-other-sector_sizes
93 check-other-sector_sizes:
94         $(MAKE) ss-1024
95         $(MAKE) ss-2048
96         $(MAKE) ss-4096
97
98 check: check-other-sector_sizes
99
100 # Arrange so that .tarball-version appears only in the distribution
101 # tarball, and never in a checked-out repository.
102 dist-hook: gen-ChangeLog
103         echo $(VERSION) > $(distdir)/.tarball-version
104
105 gen_start_date = 2000-01-01
106 .PHONY: gen-ChangeLog
107 gen-ChangeLog:
108         if test -d .git; then                                           \
109           $(top_srcdir)/build-aux/gitlog-to-changelog                   \
110             --since=$(gen_start_date) > $(distdir)/cl-t;                \
111           rm -f $(distdir)/ChangeLog;                                   \
112           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
113         fi
114
115 BUILT_SOURCES = .version
116 .version:
117         echo $(VERSION) > $@-t && mv $@-t $@