Move Templates.hs to application.

Portnov [2009-07-22 07:30:17]
Move Templates.hs to application.
Filename
Blog/Makefile
Framework/TEngine/TemplateUtil.hs
Framework/TGenerator/Makefile
Framework/TGenerator/TemplateGen.hs
diff --git a/Blog/Makefile b/Blog/Makefile
index 5dc2ed5..892b63a 100644
--- a/Blog/Makefile
+++ b/Blog/Makefile
@@ -1,5 +1,5 @@
 GHC=ghc $(GHCFLAGS) --make -O2 -optc-O3 -i. -i../
-TEMPLATES=../Framework/TEngine/Templates.hs
+TEMPLATES=Templates.hs

 all: Templates Blog

diff --git a/Framework/TEngine/TemplateUtil.hs b/Framework/TEngine/TemplateUtil.hs
index 2f04dd9..a069dbd 100644
--- a/Framework/TEngine/TemplateUtil.hs
+++ b/Framework/TEngine/TemplateUtil.hs
@@ -10,7 +10,6 @@ import Control.Monad (when)
 import qualified Data.Map as M

 import Framework.Http.Response (ok)
-import Framework.TEngine.Templates (render)
 import Framework.Types
 import Framework.TEngine.Types
 import Framework.Controller
@@ -19,6 +18,8 @@ import Framework.API.Cache
 import Framework.Cache
 import Framework.ContextProcessors (contextProcessors)

+import Templates (render)
+
 instance (Ord k, Show k,Show v, Read k, Read v) => Serializable (M.Map k v) where
     toString = show
     fromString = read
diff --git a/Framework/TGenerator/Makefile b/Framework/TGenerator/Makefile
index b06fb39..bc92af0 100644
--- a/Framework/TGenerator/Makefile
+++ b/Framework/TGenerator/Makefile
@@ -3,7 +3,7 @@ GHC=ghc --make -O2 -i. -i../../
 all: TemplateGen

 TemplateGen: TemplateGen.hs TemplateParser.hs
-	$(GHC) TemplateGen.hs
+	$(GHC) -main-is TemplateGen.main TemplateGen.hs

 clean:
 	rm TemplateGen
diff --git a/Framework/TGenerator/TemplateGen.hs b/Framework/TGenerator/TemplateGen.hs
index 15fe6ee..9335738 100644
--- a/Framework/TGenerator/TemplateGen.hs
+++ b/Framework/TGenerator/TemplateGen.hs
@@ -95,7 +95,7 @@ genFormat m (IncludeVar v) = ("    render ("++(getvar v)++") pairs",  m)

 preamble h = do
 --   hPutStrLn h "{-# LANGUAGE ExistentialQuantification, TypeSynonymInstances, OverlappingInstances #-}"
-  hPutStrLn h "module Framework.TEngine.Templates where"
+  hPutStrLn h "module Templates where"
   hPutStrLn h "import qualified Data.Map as M"
   hPutStrLn h "import Data.List"
   hPutStrLn h "import Framework.Utils"
ViewGit