import source from 3.0
[external/parted.git] / Makefile.am
1 ACLOCAL_AMFLAGS = -I m4
2 SUBDIRS = po lib libparted parted partprobe include 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 distcheck-hook:
32         $(MAKE) my-distcheck
33
34 ### ABI Checking scripts ###
35
36 baseline_file = ${top_srcdir}/scripts/data/abi/baseline_symbols.txt
37 extract_symvers = $(top_srcdir)/scripts/extract_symvers
38
39 current_symbols.txt: ${extract_symvers}
40           -@(sh ${extract_symvers} libparted/.libs/libparted.so current_symbols.txt)
41
42 baseline_symbols:
43         -@(output=${baseline_file}; \
44           if test ! -f $${output}; then \
45             echo "Baseline file doesn't exist."; \
46             echo "Try 'make new-abi-baseline' to create it."; \
47             exit 1; \
48           fi; true)
49
50 new-abi-baseline:
51         -@$(mkinstalldirs) ${baseline_dir}
52         -@(output=${baseline_file}; \
53           if test -f $${output}; then \
54             output=$${output}.new; \
55             t=`echo $${output} | sed 's=.*config/abi/=='`; \
56             echo "Baseline file already exists, writing to $${t} instead."; \
57           fi; \
58           sh ${extract_symvers} libparted/.libs/libparted.so $${output})
59
60 # Use 'new-abi-baseline' to create an initial symbol file.  Then run
61 # 'check-abi' to test for changes against that file.
62 check-abi: baseline_symbols current_symbols.txt
63         @diff -u ${baseline_file} ./current_symbols.txt 2>&1 \
64          | tee libparted.abi-diff
65         @test `wc -l < libparted.abi-diff` -eq 0 && exit 0 \
66          || echo "ABI has changed. Please, update you ABI package version." \
67          && exit 1
68
69 MOSTLYCLEANDIRS = m4
70
71 MAINTAINERCLEANFILES += \
72   ABOUT-NLS     \
73   ChangeLog     \
74   INSTALL       \
75   aclocal.m4    \
76   configure
77
78 .PHONY: ss-1024 ss-2048 ss-4096
79 ss-1024 ss-2048 ss-4096:
80         PARTED_SECTOR_SIZE=$(subst ss-,,$@) $(MAKE) check-recursive
81
82 # Run the regression test suite with different settings,
83 # to ensure it works with simulated partition sizes > 512.
84 .PHONY: check-other-sector_sizes
85 check-other-sector_sizes:
86         $(MAKE) ss-1024
87         $(MAKE) ss-2048
88         $(MAKE) ss-4096
89
90 check: check-other-sector_sizes
91
92 # Arrange so that .tarball-version appears only in the distribution
93 # tarball, and never in a checked-out repository.
94 dist-hook: gen-ChangeLog
95         echo $(VERSION) > $(distdir)/.tarball-version
96
97 gen_start_date = 2000-01-01
98 .PHONY: gen-ChangeLog
99 gen-ChangeLog:
100         if test -d .git; then                                           \
101           $(top_srcdir)/build-aux/gitlog-to-changelog                   \
102             --since=$(gen_start_date) > $(distdir)/cl-t;                \
103           rm -f $(distdir)/ChangeLog;                                   \
104           mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
105         fi
106
107 BUILT_SOURCES = .version
108 .version:
109         echo $(VERSION) > $@-t && mv $@-t $@