shake-ats 1.4.1.1 → 1.4.1.2
raw patch · 2 files changed
+19/−13 lines, 2 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- shake-ats.cabal +1/−1
- src/Development/Shake/ATS.hs +18/−12
shake-ats.cabal view
@@ -1,5 +1,5 @@ name: shake-ats-version: 1.4.1.1+version: 1.4.1.2 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
src/Development/Shake/ATS.hs view
@@ -106,11 +106,6 @@ uncurry3 :: (a -> b -> c -> d) -> ((a, b, c) -> d) uncurry3 f (x, y, z) = f x y z --- Change architecture to use C stuff better?--- Step 1: Use patsopt to generate C files--- Step 2: Use gcc to generate `.o` files--- Step 3: Generate library/binary from those files.- -- | Location of @patscc@ patscc :: MonadIO m => ATSToolConfig -> m String patscc = patsTool "patscc"@@ -152,6 +147,10 @@ [] -> pure undefined _ -> ghcVersion +doStatic :: ArtifactType -> Rules () -> Rules ()+doStatic StaticLibrary = id+doStatic _ = const (pure ())+ atsBin :: BinaryTarget -> Rules () atsBin tgt@BinaryTarget{..} = do @@ -163,20 +162,27 @@ let cTargets = atsToC <$> src - foldr (>>) (pure ()) (atsCGen toolConfig tgt <$> src <*> cTargets)+ let h Executable = id+ h StaticLibrary = fmap (-<.> "o")+ g Executable = ccAction+ g StaticLibrary = staticLibA+ h' = h tgtType + cconfig' <- cconfig toolConfig libs gc (makeCFlags cFlags mempty (pure undefined) gc)++ zipWithM_ (atsCGen toolConfig tgt) src cTargets++ doStatic tgtType (zipWithM_ (objectFileR (cc toolConfig) cconfig') cTargets (h' cTargets))+ binTarget %> \_ -> do - need cTargets+ need (h' cTargets) ghcV' <- ghcV hsLibs - cconfig' <- cconfig toolConfig libs gc (makeCFlags cFlags hsLibs ghcV' gc)-- let g Executable = ccAction- g StaticLibrary = staticLibA+ cconfig'' <- cconfig toolConfig libs gc (makeCFlags cFlags hsLibs ghcV' gc) - unit $ g tgtType (cc toolConfig) cTargets binTarget cconfig'+ unit $ g tgtType (cc toolConfig) (h' cTargets) binTarget cconfig'' atsCGen :: ATSToolConfig -> BinaryTarget