packages feed

scc-0.6: Makefile

Executables=test test-prof test-coroutine test-enumerator test-enumerator-scc test-parallel shsh shsh-prof
CoroutineLibraryFiles=Control/Cofunctor/Ticker.hs \
                      $(addprefix Control/Monad/, \
                                  Parallel.hs Coroutine.hs Coroutine/SuspensionFunctors.hs Coroutine/Nested.hs)
SCCCommonFiles=$(CoroutineLibraryFiles) \
                Control/Concurrent/Configuration.hs  \
	      	    $(addprefix Control/Concurrent/SCC/, \
                            Streams.hs Types.hs Coercions.hs Primitives.hs Configurable.hs XML.hs)
AllLibraryFiles=$(SCCCommonFiles) Control/Monad/Coroutine/Enumerator.hs \
                Control/Concurrent/SCC/Combinators.hs \
                Control/Concurrent/SCC/Combinators/Parallel.hs Control/Concurrent/SCC/Combinators/Sequential.hs \
                Control/Concurrent/SCC/Parallel.hs Control/Concurrent/SCC/Sequential.hs
DocumentationFiles=$(SCCCommonFiles) Control/Monad/Coroutine/Enumerator.hs \
                Control/Concurrent/SCC/Combinators/Parallel.hs Control/Concurrent/SCC/Combinators/Sequential.hs \
                Control/Concurrent/SCC/Parallel.hs Control/Concurrent/SCC/Sequential.hs
OptimizingOptions=-O -threaded -hidir obj -odir obj
ProfilingOptions=-prof -auto-all -hidir prof -odir prof

all: $(Executables) doc/index.html

docs: doc/index.html

test: Test.hs $(AllLibraryFiles) | obj
	ghc --make $< -o $@ $(OptimizingOptions)

test-prof: Test.hs $(AllLibraryFiles) | prof
	ghc --make $< -o $@ $(ProfilingOptions)

test-coroutine: TestCoroutine.hs $(CoroutineLibraryFiles) | obj
	ghc --make $< -o $@ $(OptimizingOptions) -threaded -eventlog

test-enumerator: TestEnumerator.hs $(CoroutineLibraryFiles) Control/Monad/Coroutine/Enumerator.hs | obj
	ghc --make $< -o $@ $(OptimizingOptions) -threaded -eventlog

test-enumerator-scc: TestEnumeratorSCC.hs $(SCCCommonFiles) \
	                  Control/Monad/Coroutine/Enumerator.hs \
                     Control/Concurrent/SCC/Combinators/Sequential.hs Control/Concurrent/SCC/Sequential.hs | obj
	ghc --make $< -o $@ $(OptimizingOptions) -threaded -eventlog

test-parallel: TestParallel.hs Control/Monad/Parallel.hs | obj
	ghc --make $< -o $@ $(OptimizingOptions) -threaded -eventlog

shsh: Shell.hs $(AllLibraryFiles) | obj
	ghc --make $< -o $@ $(OptimizingOptions)

shsh-prof: Shell.hs $(AllLibraryFiles) | prof
	ghc --make $< -o $@ $(ProfilingOptions)

doc/index.html: $(DocumentationFiles)
	haddock -hU -o doc \
	   -i http://www.haskell.org/ghc/docs/latest/html/libraries/base,base.haddock \
	   -i $(lastword $(wildcard ~/.cabal/share/doc/enumerator-*/html/)),$(lastword $(wildcard ~/.cabal/share/doc/enumerator-*/html/enumerator.haddock)) \
	   -i $(lastword $(wildcard ~/.cabal/share/doc/transformers-*/html/)),$(lastword $(wildcard ~/.cabal/share/doc/transformers-*/html/transformers.haddock)) \
	   -i $(lastword $(wildcard ~/.cabal/share/doc/text-*/html/)),$(lastword $(wildcard ~/.cabal/share/doc/text-*/html/text.haddock)) \
	   $^

obj prof:
	mkdir -p $@

clean:
	rm -rf obj/* prof/* doc/* dist/* $(Executables)
	rm -f $(foreach SourceFile,$(LibraryFiles),$(SourceFile:%.hs=%.o) $(SourceFile:%.hs=%.hi))