Ticket #7941: Update-clean-build-target.-Fixes-7941-Testsuite.patch

File Update-clean-build-target.-Fixes-7941-Testsuite.patch, 2.4 KB (added by jstolarek, 2 years ago)
  • Makefile

    From 37b813c03b11604b8c172924c3f8cee6c0b63fbc Mon Sep 17 00:00:00 2001
    From: Jan Stolarek <[email protected]>
    Date: Mon, 27 May 2013 21:44:52 +0200
    Subject: [PATCH] Update clean build target. Fixes 7941
    
    ---
     Makefile | 37 ++++++++++++++++++++++++++++++++++++-
     1 file changed, 36 insertions(+), 1 deletion(-)
    
    diff --git a/Makefile b/Makefile
    index c3db8db..88db39f 100644
    a b endif 
    2121endif
    2222endif
    2323
     24# We need these functions to clean the test tree. They are taken from
     25# mk/tree.mk in main GHC repo - see there for comment.
     26
     27removeFiles = $(call removeHelper,removeFiles,$(RM),$(RM_OPTS),$1)
     28removeTrees = $(call removeHelper,removeTrees,$(RM),$(RM_OPTS_REC),$1)
     29
     30removeHelper = $(if $(strip $4),\
     31                   $(if $(findstring *,$4),\
     32                       $(error $1: Got a star: $4),\
     33                   $(if $(findstring ..,$4),\
     34                       $(error $1: Got dot-dot: $4),\
     35                   $(if $(filter /%,$4),\
     36                       $(error $1: Got leading slash: $4),\
     37                       $2 $3 $4\
     38                    )))\
     39                )
     40
     41removeTestArtefacts = $(call removeFiles,$(wildcard $1/*.hi) $(wildcard $1/*.o) $(wildcard $1/*.comp.stderr))
     42
    2443clean distclean maintainer-clean:
    2544        $(MAKE) -C $(TOP)/timeout $@
    26         $(RM) -f mk/*.o mk/*.hi mk/ghc-config mk/ghc-config.exe mk/ghcconfig*.mk
     45        $(call removeFiles,$(wildcard mk/*.o mk/*.hi mk/ghc-config mk/ghc-config.exe mk/ghcconfig*.mk))
     46        $(call removeFiles,$(wildcard driver/*.pyc))
     47        $(call removeTrees,$(wildcard tests/cabal/local*conf) tests/cabal/package.conf.ghcpkg02/package.cache)
     48        $(call removeFiles,$(wildcard tests/safeHaskell/check/*.comp.stderr))
     49        $(call removeFiles,$(wildcard tests/codeGen/should_gen_asm/*.s))
     50        $(call removeFiles,$(wildcard tests/codeGen/should_gen_asm/*.comp.stderr))
     51        $(call removeFiles,tests/driver/T5584/A.hi-boot)
     52        $(call removeFiles,tests/driver/T5584_out/T5584/A.o-boot)
     53        $(call removeFiles,tests/ghci/scripts/ghci056_c.o)
     54        $(call removeFiles,tests/polykinds/T7272.hi-boot tests/polykinds/T7272.o-boot)
     55        $(call removeTestArtefacts,tests/polykinds)
     56        $(call removeTestArtefacts,tests/codeGen/should_run)
     57        $(call removeTestArtefacts,tests/rename/should_compile)
     58        $(call removeTestArtefacts,tests/rename/should_fail)
     59        $(call removeTestArtefacts,tests/typecheck/should_compile)
     60        $(call removeTestArtefacts,tests/rts/T5644)
     61        $(call removeTestArtefacts,tests/typecheck/should_compile)