diff --git a/shake-ats.cabal b/shake-ats.cabal
--- a/shake-ats.cabal
+++ b/shake-ats.cabal
@@ -1,5 +1,5 @@
 name:                shake-ats
-version:             0.3.0.3
+version:             0.3.0.4
 synopsis:            Utilities for building ATS projects with shake
 description:         Various helper functions for building [ATS](http://www.ats-lang.org/) with the [shake](http://shakebuild.com/) library
 homepage:            https://github.com/vmchale/shake-ats#readme
diff --git a/src/Development/Shake/ATS.hs b/src/Development/Shake/ATS.hs
--- a/src/Development/Shake/ATS.hs
+++ b/src/Development/Shake/ATS.hs
@@ -45,8 +45,11 @@
 
 ghcExport :: String -> Rules ()
 ghcExport m =
-    [ m ++ "_stub.h", m ++ ".o" ] &%> \[_,out] ->
-        command [Cwd (takeDirectory out)] "ghc" ["-c", "-O", takeBaseName out -<.> "hs" ]
+    [ m ++ ".o" ] &%> \[out] -> do
+        let fn = out -<.> "hs"
+        let dir = takeDirectory out
+        need [ fn ]
+        command [Cwd dir] "ghc" ["-c", "-O", takeFileName fn ]
 
 -- | The directory @~/.atspkg@
 pkgHome :: Action String
