[commit: nofib] master: Make `git clean -nxd` silent after `make distclean` (cc8fc60)

git at git.haskell.org git at git.haskell.org
Tue Jan 15 13:18:05 UTC 2019


Repository : ssh://git@git.haskell.org/nofib

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/cc8fc601f8869ebf75c58abccd8afc04dd8f0ec4/nofib

>---------------------------------------------------------------

commit cc8fc601f8869ebf75c58abccd8afc04dd8f0ec4
Author: Sebastian Graf <sebastian.graf at kit.edu>
Date:   Tue Jan 8 13:45:02 2019 +0100

    Make `git clean -nxd` silent after `make distclean`
    
    Also check that invariant in CI: After a `make distclean`
    `git clean -nxd` should find no files.
    
    The hope is that this catches cases were a `make clean` would forget to
    list a `.gitignore`d file that should either be registered as a
    `(DIST_)CLEAN_FILES` or should be unignored and committed into the
    repository.


>---------------------------------------------------------------

cc8fc601f8869ebf75c58abccd8afc04dd8f0ec4
 .gitlab-ci.yml         | 10 ++++++++++
 nofib-analyse/Makefile | 13 +++++++++++--
 real/maillist/Makefile |  2 ++
 3 files changed, 23 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1acca61..8b6c308 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,3 +11,13 @@ validate:
     - make boot mode=fast
     - "make mode=fast NoFibRuns=1 2>&1 | tee log"
     - "nofib-analyse/nofib-analyse log"
+    - |
+      # The following checks that `make distclean` removes any files reported
+      # by `git clean -fxd`
+      make distclean
+      files=$(git clean -nxd | cut -d" " -f3 | sed "/log/d")
+      if ! [ -z $files ]
+      then
+        echo "The following files weren't cleaned:\n$files"
+        exit 1
+      fi
diff --git a/nofib-analyse/Makefile b/nofib-analyse/Makefile
index 5691121..0e9236b 100644
--- a/nofib-analyse/Makefile
+++ b/nofib-analyse/Makefile
@@ -10,8 +10,17 @@ all :: $(PROG)
 
 boot :: $(PROG)
 
-clean:
-	rm -f $(PROG)
+# This clean hierarchy mirrors mk/ghc-target.mk.
+# See mk/ghc-paths.mk for the semantics.
+
+.PHONY: mostlyclean clean distclean maintainer-clean
+
+mostlyclean::
 	rm -f CmdLine.hi GenUtils.hi Main.hi Slurp.hi
 	rm -f CmdLine.o  GenUtils.o  Main.o  Slurp.o
 
+clean:: mostlyclean
+	rm -f $(PROG)
+
+distclean:: clean
+maintainer-clean:: distclean
diff --git a/real/maillist/Makefile b/real/maillist/Makefile
index c9a17b2..f575874 100644
--- a/real/maillist/Makefile
+++ b/real/maillist/Makefile
@@ -5,3 +5,5 @@ include $(TOP)/mk/target.mk
 FAST_OPTS = runtime_files/fast
 NORM_OPTS = runtime_files/norm
 SLOW_OPTS = runtime_files/slow
+
+CLEAN_FILES += runtime_files/*.tex



More information about the ghc-commits mailing list