diff --git a/Main.hs b/Main.hs
--- a/Main.hs
+++ b/Main.hs
@@ -7,6 +7,7 @@
 import Text.Regex.TDFA
 import Control.Applicative
 import Data.Array
+import System.FilePath
 
 data Args = Args {targets' :: [String],
                   rules :: String,
@@ -25,7 +26,8 @@
 paren x = "(" ++ x ++ ")"         
 
 regex :: Regex
-regex = makeRegex "import[ \\t]+(qualified[ \\t]+)?([^ \\t]*)[ \\t]*--[ \\t]*FROM[ \\t]*([^ \\t]+)[ \\t]*"
+regex = makeRegex "import[ \t]+(qualified[ \t]+)?([^ \t]+)[ \t]*--[ \t]*FROM[ \t]*([^ \t]+)[ \t]*"
+             
 
 define (modul,dir) = "-DROOT_" ++ modul ++ "=" ++ show (show dir)
 
@@ -35,11 +37,12 @@
   
   let 
     targets = (if null targets' then ("action":) else id) targets'
-    imports = [(fst (arr!2), fst (arr!3)) | l <- lines cf, Just (_,arr,_) <- [matchOnceText regex l]] 
+    imports = [(fst (arr!2), addTrailingPathSeparator $ fst (arr!3)) | l <- lines cf, Just (_,arr,_) <- [matchOnceText regex l]] 
     defines = intercalate " " $ map define imports
     searchdir = "-i" ++ intercalate ":" (map snd imports)
     expr = "cake " ++ paren rules ++ paren (intercalate " >> " $ map paren targets)
     command = "ghc -XCPP " ++ searchdir ++ " " ++ defines ++ " -e " ++ show expr ++ " " ++ cakefile 
+  putStrLn $ "imports: " ++ show imports
   putStrLn $ "cake: running " ++ command
   system command
   return ()
diff --git a/cake.cabal b/cake.cabal
--- a/cake.cabal
+++ b/cake.cabal
@@ -1,5 +1,5 @@
 name:           cake
-version:        0.1.0
+version:        0.1.1
 category:       Development
 synopsis:       A build-system library and driver
 description:
@@ -36,6 +36,7 @@
   build-depends: cmdargs==0.7.*
   build-depends: regex-tdfa==1.1.*
   build-depends: array==0.3.*
+  build-depends: filepath==1.1.*  
 
   main-is: Main.hs
 
