OSDN Git Service

build: update gnulib submodule to latest
[android-x86/external-parted.git] / Makefile.am
index 8fca2eb..39c1d01 100644 (file)
@@ -1,34 +1,50 @@
 ACLOCAL_AMFLAGS = -I m4
-SUBDIRS = po libparted parted partprobe include doc debug
-
-EXTRA_DIST = config.rpath                          \
-             ABOUT-NLS                             \
-             AUTHORS                               \
-             BUGS                                  \
-             COPYING                               \
-             THANKS                                \
-             TODO                                  \
-            libparted.pc.in                       \
-             parted.spec.in                        \
-             parted.m4                             \
-             scripts/data/abi/baseline_symbols.txt \
-             scripts/extract_symvers
+SUBDIRS = po lib libparted parted partprobe include doc debug tests
+
+EXTRA_DIST =                           \
+  .version                             \
+  .prev-version                                \
+  BUGS                                 \
+  libparted.pc.in                      \
+  parted.spec.in                       \
+  parted.spec                          \
+  scripts/data/abi/baseline_symbols.txt \
+  scripts/extract_symvers              \
+  cfg.mk                               \
+  dist-check.mk                                \
+  maint.mk                             \
+  GNUmakefile
 
 aclocaldir=$(datadir)/aclocal
-aclocal_DATA=parted.m4
 
 pcdir = $(libdir)/pkgconfig
-pc_DATA = libparted.pc.in
+pc_DATA = libparted.pc
+
+# This is best not done via configure.ac, because automake's
+# make distcheck target does not like auto-generated files
+# being included in the distributed archive.
+parted.spec: parted.spec.in
+       sed 's/@''PACKAGE@/$(PACKAGE)/;s/@''VERSION@/$(VERSION)/' $< > $@-tmp
+       mv $@-tmp $@
+MAINTAINERCLEANFILES = parted.spec
+
+.PHONY: root-check
+root-check:
+       sudo $(MAKE) check
 
-dist-hook: parted.spec
-       cp parted.spec $(distdir)
+# Not everyone who runs "make distcheck" will want to or even
+# be able to run the root tests.  If you want to skip them,
+# run make like this: "make distcheck root-check="
+root-check ?= root-check
+distcheck-hook: $(root-check)
+       $(MAKE) my-distcheck
 
 ### ABI Checking scripts ###
 
 baseline_file = ${top_srcdir}/scripts/data/abi/baseline_symbols.txt
 extract_symvers = $(top_srcdir)/scripts/extract_symvers
 
-current_symbols.txt: ${extract_symvers} 
+current_symbols.txt: ${extract_symvers}
          -@(sh ${extract_symvers} libparted/.libs/libparted.so current_symbols.txt)
 
 baseline_symbols:
@@ -53,7 +69,49 @@ new-abi-baseline:
 # 'check-abi' to test for changes against that file.
 check-abi: baseline_symbols current_symbols.txt
        @diff -u ${baseline_file} ./current_symbols.txt 2>&1 \
-         | tee libparted.abi-diff
-       @test `wc -l < libparted.abi-diff` -gt 0 \
-         && (echo "ABI has changed. Please, update you ABI package version."; exit 1) \
-         || exit 0
+        | tee libparted.abi-diff
+       @test `wc -l < libparted.abi-diff` -eq 0 && exit 0 \
+        || echo "ABI has changed. Please, update you ABI package version." \
+        && exit 1
+
+MOSTLYCLEANDIRS = m4
+
+MAINTAINERCLEANFILES += \
+  ABOUT-NLS     \
+  ChangeLog     \
+  INSTALL       \
+  aclocal.m4    \
+  configure
+
+.PHONY: ss-1024 ss-2048 ss-4096
+ss-1024 ss-2048 ss-4096:
+       PARTED_SECTOR_SIZE=$(subst ss-,,$@) $(MAKE) check-recursive
+
+# Run the regression test suite with different settings,
+# to ensure it works with simulated partition sizes > 512.
+.PHONY: check-other-sector_sizes
+check-other-sector_sizes:
+       $(MAKE) ss-1024
+       $(MAKE) ss-2048
+       $(MAKE) ss-4096
+
+check: check-other-sector_sizes
+
+# Arrange so that .tarball-version appears only in the distribution
+# tarball, and never in a checked-out repository.
+dist-hook: gen-ChangeLog
+       echo $(VERSION) > $(distdir)/.tarball-version
+
+gen_start_date = 2000-01-01
+.PHONY: gen-ChangeLog
+gen-ChangeLog:
+       if test -d .git; then                                           \
+         $(top_srcdir)/build-aux/gitlog-to-changelog                   \
+           --since=$(gen_start_date) > $(distdir)/cl-t;                \
+         rm -f $(distdir)/ChangeLog;                                   \
+         mv $(distdir)/cl-t $(distdir)/ChangeLog;                      \
+       fi
+
+BUILT_SOURCES = .version
+.version:
+       echo $(VERSION) > $@-t && mv $@-t $@