[project @ 2003-07-22 16:18:06 by simonmar]
[ghc-hetmet.git] / ghc / tests / mk / should_compile.mk
1 #-----------------------------------------------------------------------------
2 # $Id: should_compile.mk,v 1.5 2000/12/12 13:57:40 simonmar Exp $
3 # template for should_compile tests.
4
5 HS_SRCS = $(wildcard *.hs)
6
7 SRC_RUNTEST_OPTS += -x 0 \
8         $(foreach i,$(wildcard $*.stdout),-o1 $(i)) \
9         $(foreach i,$(wildcard $*.stderr),-o2 $(i))
10
11 %.o : %.hs
12         @echo ---- Testing for successful compilation of $<
13         $(RUNTEST) $(HC) $(RUNTEST_OPTS) -- $(HC_OPTS) -c $< -o $@
14
15 %.hc : %.hs
16         @echo ---- Testing for successful compilation of $<
17         $(RUNTEST) $(HC) $(RUNTEST_OPTS) -- $(HC_OPTS) -C $< -o $@
18
19 ifeq "$(HCOnly)" "YES"
20 all :: $(HS_HCS)
21 else
22 all :: $(HS_OBJS)
23 endif
24
25 # Most single-module tests are declared to be module ShouldCompile, so we
26 # can clean the .hi files in one go:
27 CLEAN_FILES += ShouldCompile.hi