From a413c6353dbfff5221ea020ff8e1475d5ee17a81 Mon Sep 17 00:00:00 2001 From: Niels de Vos Date: Tue, 10 Oct 2017 13:23:50 +0200 Subject: build: make it possible to build cleanly 2x in a row MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 'make clean' does not cleanup everything, and some of the files get cleaned too eagerly. Several files are being packaged in a 'make dist' tarball, that get rebuild each time anyway. Specifically, this change prevents - libglusterfs/src/generator.pyc from laying around - keeping rpc/xdr/gen/*.x symlinks - modifying tests/basic/{fuse,gfapi}/Makefile each run - including tests/env.rc and events/src/eventtypes.py in the tarball Change-Id: I774dd1abf3a9d3b6a89b938cf6ee7d7792c59a82 BUG: 1501317 Reported-by: Patrick Matthäi Signed-off-by: Niels de Vos --- .gitignore | 2 ++ Makefile.am | 6 +++++- configure.ac | 4 +--- events/src/Makefile.am | 2 ++ libglusterfs/src/Makefile.am | 3 ++- rpc/xdr/gen/Makefile.am | 2 +- tests/basic/fuse/Makefile | 12 ++++++++++++ tests/basic/fuse/Makefile.am | 12 ------------ tests/basic/gfapi/Makefile | 21 +++++++++++++++++++++ tests/basic/gfapi/Makefile.am | 21 --------------------- 10 files changed, 46 insertions(+), 39 deletions(-) create mode 100644 tests/basic/fuse/Makefile delete mode 100644 tests/basic/fuse/Makefile.am create mode 100644 tests/basic/gfapi/Makefile delete mode 100644 tests/basic/gfapi/Makefile.am diff --git a/.gitignore b/.gitignore index 2f7b8ca8b8f..45a5e878f6c 100644 --- a/.gitignore +++ b/.gitignore @@ -97,6 +97,8 @@ libtool # copied XDR for cyclic libglusterfs <-> rpc-header dependency rpc/xdr/gen/*.x run-tests.sh +!tests/basic/fuse/Makefile +!tests/basic/gfapi/Makefile tests/env.rc tests/utils/arequal-checksum xlators/features/glupy/src/__init__.py diff --git a/Makefile.am b/Makefile.am index e4172159875..bbf121a0059 100644 --- a/Makefile.am +++ b/Makefile.am @@ -22,7 +22,7 @@ pkgconfig_DATA += libgfdb.pc endif CLEANFILES = glusterfs-api.pc libgfchangelog.pc libgfdb.pc \ - tests/env.rc contrib/umountd/Makefile{,.in} + tests/env.rc contrib/umountd/Makefile CONFIG_CLEAN_FILES = $(CONTRIB_BUILDDIR)/uuid/uuid_types.h gitclean: distclean @@ -41,10 +41,14 @@ gitclean: distclean -rm -f $(CONTRIBDIR)/argp-standalone/install-sh -rm -f $(CONTRIBDIR)/argp-standalone/missing +# dist-hook gets executed with 'make dist', this is the only target getting +# executed, a dist-hook in other Makefile.am files seem to get ignored. dist-hook: gen-VERSION gen-ChangeLog -rm -fr $(distdir)/contrib/argp-standalone/autom4te.cache -rm -fr $(distdir)/contrib/argp-standalone/.deps -rm -fr $(distdir)/contrib/umountd/.deps + -rm -f $(distdir)/events/src/eventtypes.py + -rm -f $(distdir)/tests/env.rc -cp -f $(top_srcdir)/build-aux/config.sub.dist $(distdir)/config.sub -cp -f $(top_srcdir)/build-aux/config.guess.dist $(distdir)/config.guess diff --git a/configure.ac b/configure.ac index 4e0b4aeffa8..418ded7fe87 100644 --- a/configure.ac +++ b/configure.ac @@ -285,9 +285,7 @@ AC_CONFIG_FILES([Makefile tools/glusterfind/Makefile tools/glusterfind/src/Makefile tools/setgfid2path/Makefile - tools/setgfid2path/src/Makefile - tests/basic/fuse/Makefile - tests/basic/gfapi/Makefile]) + tools/setgfid2path/src/Makefile]) AC_CANONICAL_HOST diff --git a/events/src/Makefile.am b/events/src/Makefile.am index 8493abdcd82..4308ccdbb22 100644 --- a/events/src/Makefile.am +++ b/events/src/Makefile.am @@ -8,6 +8,8 @@ CLEANFILES = eventtypes.py eventsdir = $(GLUSTERFS_LIBEXECDIR)/events events_PYTHON = __init__.py gf_event.py eventsapiconf.py eventtypes.py \ utils.py +# this does not work, see the Makefile.am in the root for a workaround +#nodist_events_PYTHON = eventtypes.py eventtypes.py: $(top_srcdir)/events/eventskeygen.py $(PYTHON) $(top_srcdir)/events/eventskeygen.py PY_HEADER diff --git a/libglusterfs/src/Makefile.am b/libglusterfs/src/Makefile.am index ac57c961143..094646c5e3f 100644 --- a/libglusterfs/src/Makefile.am +++ b/libglusterfs/src/Makefile.am @@ -102,7 +102,8 @@ y.tab.h: graph.y defaults.c: defaults-tmpl.c generator.py gen-defaults.py $(PYTHON) $(srcdir)/gen-defaults.py $(srcdir)/defaults-tmpl.c > $@ -CLEANFILES = $(nodist_libglusterfs_la_SOURCES) $(nodist_libglusterfs_la_HEADERS) +CLEANFILES = $(nodist_libglusterfs_la_SOURCES) \ + $(nodist_libglusterfs_la_HEADERS) *.pyc if UNITTEST CLEANFILES += *.gcda *.gcno *_xunit.xml diff --git a/rpc/xdr/gen/Makefile.am b/rpc/xdr/gen/Makefile.am index 6cffca4c3ac..b1c8e9333d6 100644 --- a/rpc/xdr/gen/Makefile.am +++ b/rpc/xdr/gen/Makefile.am @@ -4,7 +4,7 @@ XDRGENFILES = glusterfs3-xdr.x cli1-xdr.x nlm4-xdr.x nsm-xdr.x \ XDRHEADERS = $(XDRGENFILES:.x=.h) XDRSOURCES = $(XDRGENFILES:.x=.c) -CLEANFILES = $(XDRSOURCES) $(XDRHEADERS) +CLEANFILES = $(XDRSOURCES) $(XDRHEADERS) $(XDRGENFILES) # trick automake into doing BUILT_SOURCES magic BUILT_SOURCES = $(XDRHEADERS) $(XDRSOURCES) diff --git a/tests/basic/fuse/Makefile b/tests/basic/fuse/Makefile new file mode 100644 index 00000000000..c446d253228 --- /dev/null +++ b/tests/basic/fuse/Makefile @@ -0,0 +1,12 @@ +CFLAGS = -Wall -g +LDFLAGS = + +BINARIES = seek + +%: %.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ + +all: $(BINARIES) + +clean: + -$(RM) $(BINARIES) diff --git a/tests/basic/fuse/Makefile.am b/tests/basic/fuse/Makefile.am deleted file mode 100644 index c446d253228..00000000000 --- a/tests/basic/fuse/Makefile.am +++ /dev/null @@ -1,12 +0,0 @@ -CFLAGS = -Wall -g -LDFLAGS = - -BINARIES = seek - -%: %.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ - -all: $(BINARIES) - -clean: - -$(RM) $(BINARIES) diff --git a/tests/basic/gfapi/Makefile b/tests/basic/gfapi/Makefile new file mode 100644 index 00000000000..e30fefea5b9 --- /dev/null +++ b/tests/basic/gfapi/Makefile @@ -0,0 +1,21 @@ +## compiles against the *system* version of libgfapi, +## but not the libgfapi for the testcases + +CFLAGS = -Wall -g $(shell pkg-config --cflags glusterfs-api) +LDFLAGS = $(shell pkg-config --libs glusterfs-api) + +BINARIES = upcall-cache-invalidate libgfapi-fini-hang anonymous_fd seek \ + bug1283983 bug1291259 gfapi-ssl-test gfapi-load-volfile + +%: %.c + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ + +all: check-pkgconfig $(BINARIES) + +clean: + -$(RM) $(BINARIES) + +.phony: check-pkgconfig + +check-pkgconfig: + pkg-config --exists glusterfs-api diff --git a/tests/basic/gfapi/Makefile.am b/tests/basic/gfapi/Makefile.am deleted file mode 100644 index e30fefea5b9..00000000000 --- a/tests/basic/gfapi/Makefile.am +++ /dev/null @@ -1,21 +0,0 @@ -## compiles against the *system* version of libgfapi, -## but not the libgfapi for the testcases - -CFLAGS = -Wall -g $(shell pkg-config --cflags glusterfs-api) -LDFLAGS = $(shell pkg-config --libs glusterfs-api) - -BINARIES = upcall-cache-invalidate libgfapi-fini-hang anonymous_fd seek \ - bug1283983 bug1291259 gfapi-ssl-test gfapi-load-volfile - -%: %.c - $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $^ - -all: check-pkgconfig $(BINARIES) - -clean: - -$(RM) $(BINARIES) - -.phony: check-pkgconfig - -check-pkgconfig: - pkg-config --exists glusterfs-api -- cgit