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

git at git.haskell.org git at git.haskell.org
Tue Jan 8 12:51:41 UTC 2019


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

On branch  : distclean-git-clean
Link       : http://ghc.haskell.org/trac/ghc/changeset/58f710d162962bf20f6e39faccf35c436712c266/nofib

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

commit 58f710d162962bf20f6e39faccf35c436712c266
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_FILE` or should be unignored and committed into the
    repository.


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

58f710d162962bf20f6e39faccf35c436712c266
 .gitlab-ci.yml         |  6 ++++++
 nofib-analyse/Makefile | 13 +++++++++++--
 real/maillist/Makefile |  1 +
 3 files changed, 18 insertions(+), 2 deletions(-)

diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index 1acca61..cb47c1a 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -11,3 +11,9 @@ 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)
+    - echo $files
+    - [ -z $files ] || exit 1
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 cfa1f48..ef6c11f 100644
--- a/real/maillist/Makefile
+++ b/real/maillist/Makefile
@@ -2,3 +2,4 @@ TOP = ../..
 include $(TOP)/mk/boilerplate.mk
 include $(TOP)/mk/target.mk
 
+CLEAN_FILES += runtime_files/addresses.tex



More information about the ghc-commits mailing list