diff --git a/Setup.hs b/Setup.hs
--- a/Setup.hs
+++ b/Setup.hs
@@ -1,2 +1,6 @@
+module Main (main) where
+
 import Distribution.Simple
+
+main :: IO ()
 main = defaultMain
diff --git a/ise.template/xst.mustache b/ise.template/xst.mustache
--- a/ise.template/xst.mustache
+++ b/ise.template/xst.mustache
@@ -5,7 +5,7 @@
 -ifmt mixed
 -ofn {{MAIN}}
 -ofmt NGC
--p xc3s500e-5-vq100
+-p {{PLATFORM}}
 -top {{TOP}}
 -opt_mode Speed
 -opt_level 1
@@ -22,22 +22,15 @@
 -case Maintain
 -slice_utilization_ratio 100
 -bram_utilization_ratio 100
--verilog2001 YES
 -fsm_extract YES -fsm_encoding Auto
 -safe_implementation No
 -fsm_style LUT
 -ram_extract Yes
 -ram_style Auto
 -rom_extract Yes
--mux_style Auto
--decoder_extract YES
--priority_extract Yes
 -shreg_extract YES
--shift_extract YES
--xor_collapse YES
 -rom_style Auto
 -auto_bram_packing NO
--mux_extract Yes
 -resource_sharing YES
 -async_to_sync NO
 -mult_style Auto
@@ -46,7 +39,6 @@
 -bufg 24
 -register_duplication YES
 -register_balancing No
--slice_packing YES
 -optimize_primitives NO
 -use_clock_enable Yes
 -use_sync_set Yes
diff --git a/kansas-lava-shake.cabal b/kansas-lava-shake.cabal
--- a/kansas-lava-shake.cabal
+++ b/kansas-lava-shake.cabal
@@ -1,7 +1,8 @@
 name:                kansas-lava-shake
-version:             0.1.1
+version:             0.1.2
 synopsis:            Shake rules for building Kansas Lava projects
--- description:
+description:         Shake rules for building Kansas Lava projects. Currently supports the
+                     Xilinx FPGA tooling only.
 license:             BSD3
 license-file:        LICENSE
 copyright:           (C) 2014 Gergo Erdi
@@ -26,7 +27,8 @@
         kansas-lava >=0.2.4 && < 0.2.5,
         filepath,
         directory,
-        shake,
+        temporary,
+        shake >= 0.14,
         containers,
         text,
         hastache
@@ -38,3 +40,8 @@
 source-repository head
   type:     git
   location: git://github.com/gergoerdi/kansas-lava-shake
+
+source-repository this
+  type:     git
+  location: git://github.com/gergoerdi/kansas-lava-shake
+  tag:      0.1.2
diff --git a/src/Development/KansasLava/Shake.hs b/src/Development/KansasLava/Shake.hs
--- a/src/Development/KansasLava/Shake.hs
+++ b/src/Development/KansasLava/Shake.hs
@@ -8,12 +8,14 @@
 
 lavaRules :: FilePath -> String -> String -> Rules ()
 lavaRules modName vhdl ucf = do
-    gensrc modName <.> "vhdl" *> \target -> do
+    "gensrc" </> modName <.> "vhdl" *> \target -> do
         alwaysRerun
         writeFileChanged target vhdl
-    gensrc modName <.> "ucf" *> \target -> do
+    "gensrc" </> modName <.> "ucf" *> \target -> do
         alwaysRerun
         writeFileChanged target ucf
-    gensrc "lava-prelude.vhdl" *> liftIO . writeVhdlPrelude
-  where
-    gensrc f = "gensrc" </> f
+    "gensrc/lava-prelude.vhdl" *> \target -> do
+        alwaysRerun
+        withTempFile $ \tempFile -> do
+            liftIO $ writeVhdlPrelude tempFile
+            copyFileChanged tempFile target
diff --git a/src/Development/KansasLava/Shake/Xilinx.hs b/src/Development/KansasLava/Shake/Xilinx.hs
--- a/src/Development/KansasLava/Shake/Xilinx.hs
+++ b/src/Development/KansasLava/Shake/Xilinx.hs
@@ -33,7 +33,10 @@
         textTemplate []
 
     "*.xst" *>
-        textTemplate [("MAIN", fromString mod), ("TOP", fromString mod)]
+        textTemplate [ ("MAIN", fromString mod)
+                     , ("TOP", fromString mod)
+                     , ("PLATFORM", fromString xilinxPlatform)
+                     ]
 
     "*.xise" *>
         listTemplate "components" xiseFiles
@@ -50,13 +53,11 @@
         xilinx "xaw2vhdl" [xaw, "-st", "XST", target]
     xawsrc "*.ucf" *> \target -> need [target -<.> "vhdl"]
 
-    "xst/projnav.tmp" *> liftIO . createDirectoryIfMissing True
-
     "*.ngc" *> \target -> do
+        liftIO $ createDirectoryIfMissing True "xst/projnav.tmp"
         need $
           (target -<.> "prj"):
           (target -<.> "xst"):
-          ("xst" </> "projnav.tmp"):
           [gensrc $ f <.> "vhdl" | f <- vhdls] ++
           [xawsrc $ f <.> "vhdl" | f <- xaws]
 
@@ -73,10 +74,10 @@
                      ]
 
     "*.ngd" *> \target -> do
+        liftIO $ createDirectoryIfMissing True "xst/projnav.tmp"
         let ucf = gensrc $ target -<.> "ucf"
         need [ target -<.> "ngc"
              , ucf
-             , "xst/projnav.tmp"
              ]
         removeFilesAfter "."
           [ target -<.> "bld"
@@ -93,13 +94,14 @@
                           ]
 
     "*.pcf" *> \target -> do
+        liftIO $ createDirectoryIfMissing True "xst/projnav.tmp"
         need [ target -<.> "ngc"
              , target -<.> "ngd"
-             , "xst/projnav.tmp"
              ]
         removeFilesAfter "."
           [ "*_summary.xml"
           , "*_usage.xml"
+          , "xilinx_device_details.xml"
           , target -<.> "ngm"
           , target -<.> "mrp"
           , target -<.> "map"
@@ -118,14 +120,14 @@
         "*_map.ncd" *> \target -> need [mapFileName (fromJust . stripSuffix "_map") target -<.> "pcf"]
 
         "*.ncd" *> \target -> do
-            need [ "xst" </> "projnav.tmp"
-                 , target -<.> "pcf"
-                 ]
+            liftIO $ createDirectoryIfMissing True "xst/projnav.tmp"
+            need [target -<.> "pcf"]
             removeFilesAfter "."
               [ "*_pad.txt"
               , "*_pad.xrpt"
               , "*_pad.csv"
               , "_xmsgs//*"
+              , "par_usage_statistics.html"
               , target -<.> "pad"
               , target -<.> "par"
               , target -<.> "xpi"
@@ -142,8 +144,8 @@
                          ]
 
     "*.bit" *> \target -> do
-        need [ "xst/projnav.tmp"
-             , target -<.> "ut"
+        liftIO $ createDirectoryIfMissing True "xst/projnav.tmp"
+        need [ target -<.> "ut"
              , target -<.> "ncd"
              ]
         removeFilesAfter "."
@@ -181,6 +183,7 @@
 
 hastache :: MuContext IO -> FilePath -> Action ()
 hastache ctxt target = do
+    alwaysRerun
     templateFile <- liftIO $ getDataFileName ("ise.template" </> templateName)
     t <- liftIO $ hastacheFile hastacheConfig templateFile ctxt
     writeFileChanged target $ TL.unpack t
