diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..e263baf --- /dev/null +++ b/Setup.hs @@ -0,0 +1,17 @@ +import Distribution.Simple +import System.Process +import System.Environment +import System.Directory + +libdir :: String +libdir = "src" + +main :: IO () +main = do + (a:_) <- getArgs + if a == "build" + then do + callProcess "bnfc" ["-d", "--text-token", "--functor", "hm.cf"] + renameDirectory "Hm" (libdir <> "/Hm") + else pure () + defaultMain diff --git a/hm.cabal b/hm.cabal index 5d85bf2..31c42a5 100644 --- a/hm.cabal +++ b/hm.cabal @@ -7,20 +7,34 @@ homepage: https://githug.xyz/depsterr/hm -- bug-reports: license: ISC license-file: LICENSE +build-type: Custom author: depsterr maintainer: depsterr@protonmail.com -- copyright: category: Programming Language +custom-setup + setup-depends: base >= 4 + , Cabal >= 2.4 + , process >= 1 + , directory >= 1 + library ghc-options: -Werror=incomplete-patterns -Wall -fno-warn-name-shadowing - , Simple.CC + exposed-modules: Hm.Abs + , Hm.Layout + , Hm.Lex + , Hm.Par + , Hm.Print + + other-modules: Hm.ErrM build-tool-depends: alex:alex >= 3.0, happy:happy >= 1.19.5 build-depends: base >=4 , array , containers , transformers , mtl + , text hs-source-dirs: src default-language: Haskell2010 diff --git a/readme.md b/readme.md index f0944bc..79c25fb 100644 --- a/readme.md +++ b/readme.md @@ -6,11 +6,8 @@ A simple, terminating, pure, hindley milner lambda calculus with inductively def Depends: * BNFC - * GNU make * GHC * Cabal Instructions: - * Run `bnfc -dm --text-token --functor hm.cf` - * Run `make` * Run `cabal build` diff --git a/src/.gitignore b/src/.gitignore new file mode 100644 index 0000000..2418730 --- /dev/null +++ b/src/.gitignore @@ -0,0 +1 @@ +Hm