ghc-dup: 26bbd3f2aa2f69c0159f1b2890d653a93e91132a

     1: # -----------------------------------------------------------------------------
     2: # Examples of use:
     3: #
     4: #  make           -- run all the tests in the current directory
     5: #  make verbose   -- as make test, but up the verbosity
     6: #  make accept    -- run the tests, accepting the current output
     7: #
     8: # The following variables may be set on the make command line:
     9: #
    10: #  TEST      -- specific test to run
    11: #  TESTS     -- specific tests to run (same as $TEST really)
    12: #  EXTRA_HC_OPTS      -- extra flags to send to the Haskell compiler
    13: #  EXTRA_RUNTEST_OPTS -- extra flags to give the test driver
    14: #  CONFIG    -- use a different configuration file
    15: #  COMPILER  -- select a configuration file from config/
    16: #  THREADS   -- run n tests at once
    17: #
    18: # -----------------------------------------------------------------------------
    19: 
    20: # export the value of $MAKE for invocation in tests/driver/
    21: export MAKE
    22: 
    23: RUNTESTS     = $(TOP)/driver/runtests.py
    24: COMPILER     = ghc
    25: CONFIGDIR    = $(TOP)/config
    26: CONFIG       = $(CONFIGDIR)/$(COMPILER)
    27: 
    28: PACKAGE_CONF = $(TOP)/../dist/package.conf.inplace 
    29: 
    30: # TEST_HC_OPTS is passed to every invocation of TEST_HC 
    31: # in nested Makefiles
    32: TEST_HC_OPTS = -fforce-recomp -dcore-lint -dcmm-lint -dno-debug-output -no-user-$(GhcPackageDbFlag) -rtsopts $(EXTRA_HC_OPTS) -package-conf $(PACKAGE_CONF)
    33: 
    34: RUNTEST_OPTS =
    35: 
    36: ifeq "$(filter $(TargetOS_CPP), cygwin32 mingw32)" ""
    37: exeext =
    38: else
    39: exeext = .exe
    40: endif
    41: 
    42: RUNTEST_OPTS += -e ghc_compiler_always_flags="'$(TEST_HC_OPTS)'"
    43: 
    44: ifeq "$(GhcWithNativeCodeGen)" "YES"
    45: RUNTEST_OPTS += -e ghc_with_native_codegen=1
    46: else
    47: RUNTEST_OPTS += -e ghc_with_native_codegen=0
    48: endif
    49: 
    50: HASKELL98_LIBDIR := $(shell "$(GHC_PKG)" field haskell98 library-dirs | sed 's/^[^:]*: *//')
    51: HAVE_PROFILING := $(shell if [ -f $(subst \,/,$(HASKELL98_LIBDIR))/libHShaskell98-*_p.a ]; then echo YES; else echo NO; fi)
    52: 
    53: ifeq "$(HAVE_PROFILING)" "YES"
    54: RUNTEST_OPTS += -e ghc_with_profiling=1
    55: else
    56: RUNTEST_OPTS += -e ghc_with_profiling=0
    57: endif
    58: 
    59: ifeq "$(filter thr, $(GhcRTSWays))" "thr"
    60: RUNTEST_OPTS += -e ghc_with_threaded_rts=1
    61: else
    62: RUNTEST_OPTS += -e ghc_with_threaded_rts=0
    63: endif
    64: 
    65: ifeq "$(filter dyn, $(GhcRTSWays))" "dyn"
    66: RUNTEST_OPTS += -e ghc_with_dynamic_rts=1
    67: else
    68: RUNTEST_OPTS += -e ghc_with_dynamic_rts=0
    69: endif
    70: 
    71: ifeq "$(GhcWithInterpreter)" "NO"
    72: RUNTEST_OPTS += -e ghc_with_interpreter=0
    73: else ifeq "$(GhcStage)" "1"
    74: RUNTEST_OPTS += -e ghc_with_interpreter=0
    75: else
    76: RUNTEST_OPTS += -e ghc_with_interpreter=1
    77: endif
    78: 
    79: ifeq "$(GhcUnregisterised)" "YES"
    80: RUNTEST_OPTS += -e ghc_unregisterised=1
    81: else
    82: RUNTEST_OPTS += -e ghc_unregisterised=0
    83: endif
    84: 
    85: ifeq "$(GhcWithSMP)" "YES"
    86: RUNTEST_OPTS += -e ghc_with_smp=1
    87: else
    88: RUNTEST_OPTS += -e ghc_with_smp=0
    89: endif
    90: 
    91: ifneq "$(shell $(SHELL) -c 'llc --version | grep version' 2> /dev/null)" ""
    92: RUNTEST_OPTS += -e ghc_with_llvm=1
    93: else
    94: RUNTEST_OPTS += -e ghc_with_llvm=0
    95: endif
    96: 
    97: ifeq "$(WINDOWS)" "YES"
    98: RUNTEST_OPTS += -e windows=True
    99: else
   100: RUNTEST_OPTS += -e windows=False
   101: endif
   102: 
   103: ifeq "$(DARWIN)" "YES"
   104: RUNTEST_OPTS += -e darwin=True
   105: else
   106: RUNTEST_OPTS += -e darwin=False
   107: endif
   108: 
   109: ifeq "$(IN_TREE_COMPILER)" "YES"
   110: RUNTEST_OPTS += -e in_tree_compiler=True
   111: else
   112: RUNTEST_OPTS += -e in_tree_compiler=False
   113: endif
   114: 
   115: ifneq "$(THREADS)" ""
   116: RUNTEST_OPTS += --threads=$(THREADS)
   117: endif
   118: 
   119: ifneq "$(CLEAN_ONLY)" ""
   120: RUNTEST_OPTS += -e clean_only=True
   121: else
   122: RUNTEST_OPTS += -e clean_only=False
   123: endif
   124: 
   125: ifneq "$(CHECK_FILES_WRITTEN)" ""
   126: RUNTEST_OPTS += --check-files-written
   127: endif
   128: 
   129: RUNTEST_OPTS +=  \
   130: 	--rootdir=. \
   131: 	--config=$(CONFIG) \
   132: 	-e 'config.confdir="$(CONFIGDIR)"' \
   133: 	-e 'config.compiler="$(TEST_HC)"' \
   134: 	-e 'config.ghc_pkg="$(GHC_PKG)"' \
   135: 	-e 'config.hp2ps="$(HP2PS_ABS)"' \
   136: 	-e 'config.hpc="$(HPC)"' \
   137: 	-e 'config.gs="$(GS)"' \
   138: 	-e 'config.platform="$(TARGETPLATFORM)"' \
   139: 	-e 'config.os="$(TargetOS_CPP)"' \
   140: 	-e 'config.arch="$(TargetARCH_CPP)"' \
   141: 	-e 'config.wordsize="$(WORDSIZE)"' \
   142: 	-e 'default_testopts.cleanup="$(CLEANUP)"' \
   143: 	-e 'config.timeout=int($(TIMEOUT)) or config.timeout' \
   144: 	-e 'config.timeout_prog="$(TIMEOUT_PROGRAM)"' \
   145: 	-e 'config.exeext="$(exeext)"' \
   146: 	-e 'config.top="$(TOP_ABS)"'
   147: 
   148: ifneq "$(OUTPUT_SUMMARY)" ""
   149: RUNTEST_OPTS +=  \
   150: 	--output-summary "$(OUTPUT_SUMMARY)"
   151: endif
   152: 
   153: RUNTEST_OPTS +=  \
   154: 	$(EXTRA_RUNTEST_OPTS)
   155: 
   156: ifeq "$(fast)" "YES"
   157: setfast = -e config.fast=1
   158: else
   159: setfast = 
   160: endif
   161: 
   162: ifeq "$(accept)" "YES"
   163: setaccept = -e config.accept=1
   164: else
   165: setaccept = 
   166: endif
   167: 
   168: TESTS	     = 
   169: TEST	     = 
   170: WAY =
   171: 
   172: .PHONY: all boot test verbose accept fast
   173: 
   174: all: test
   175: 
   176: TIMEOUT_PROGRAM = $(TOP)/timeout/install-inplace/bin/timeout$(exeext)
   177: 
   178: boot: $(TIMEOUT_PROGRAM)
   179: 
   180: $(TIMEOUT_PROGRAM) :
   181: 	@echo "Looks like you don't have timeout, building it first..."
   182: 	$(MAKE) -C $(TOP)/timeout all
   183: 
   184: $(PACKAGE_CONF) :
   185: 	@echo "You need to build the library first (cabal build)"
   186: 	@false
   187: 
   188: test: $(PACKAGE_CONF) $(TIMEOUT_PROGRAM)
   189: 	$(PYTHON) $(RUNTESTS) $(RUNTEST_OPTS) \
   190: 		$(patsubst %, --only=%, $(TEST)) \
   191: 		$(patsubst %, --only=%, $(TESTS)) \
   192: 		$(patsubst %, --way=%, $(WAY)) \
   193: 		$(patsubst %, --skipway=%, $(SKIPWAY)) \
   194: 		$(setfast) \
   195: 		$(setaccept)
   196: 
   197: verbose: test
   198: 
   199: accept: $(PACKAGE_CONF)
   200: 	$(MAKE) accept=YES
   201: 
   202: fast: $(PACKAGE_CONF)
   203: 	$(MAKE) fast=YES
   204: 

Generated by git2html.