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:             1.0.0.2
+version:             1.1.0.0
 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
@@ -136,6 +136,16 @@
 patsHomeLocs n = intercalate ":" $ (<> ".atspkg/contrib") . ("./" <>) <$> g
     where g = [ join $ replicate i "../" | i <- [1..n] ]
 
+-- TODO depend on GHC version?
+makeCFlags :: [String] -- ^ Inputs
+           -> [ForeignCabal] -- ^ Haskell libraries
+           -> Bool -- ^ Whether to use the Garbage collector
+           -> [String]
+makeCFlags ss fc b = gcFlag' : (hsExtra <> ss) where
+    gcFlag' = (bool ("-optc" <>) id noHs) $ gcFlag b
+    hsExtra = bool ["--make", "-odir", ".atspkg", "-no-hs-main", "-package-db", "~/.cabal/store/ghc-8.2.2/package.db/"] mempty noHs
+    noHs = null fc
+
 atsBin :: String -- ^ C compiler we should use
        -> [String] -- ^ Flags to pass to the C compiler
        -> Version -- ^ Library version
@@ -170,7 +180,11 @@
         command
             [EchoStderr False, AddEnv "PATSHOME" home, AddEnv "PATH" (home ++ "/bin:" ++ path), AddEnv "PATSHOMELOCS" $ patsHomeLocs 5]
             (home ++ "/bin/patscc")
-            ([sourceFile, "-atsccomp", cc ++ " -I" ++ h ++ "/ccomp/runtime/ -I" ++ h ++ " -L" ++ h' ++ "/lib", gcFlag gc, "-o", out, "-cleanaft"] <> cFlags <> toLibs libs')
+            (mconcat 
+                [ [sourceFile, "-atsccomp", cc ++ " -I" ++ h ++ "/ccomp/runtime/ -I" ++ h ++ " -L" ++ h' ++ "/lib", "-o", out, "-cleanaft"]
+                , makeCFlags cFlags hs gc
+                , toLibs libs'
+                ])
 
 -- | Build a @.lats@ file.
 atsLex :: Rules ()
