setup build system properly

This commit is contained in:
Rachel Lambda Samuelsson 2022-01-23 13:43:50 +01:00
parent f0c44b9477
commit 6fc30272aa
4 changed files with 33 additions and 4 deletions

17
Setup.hs Normal file
View File

@ -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

View File

@ -7,20 +7,34 @@ homepage: https://githug.xyz/depsterr/hm
-- bug-reports: -- bug-reports:
license: ISC license: ISC
license-file: LICENSE license-file: LICENSE
build-type: Custom
author: depsterr author: depsterr
maintainer: depsterr@protonmail.com maintainer: depsterr@protonmail.com
-- copyright: -- copyright:
category: Programming Language category: Programming Language
custom-setup
setup-depends: base >= 4
, Cabal >= 2.4
, process >= 1
, directory >= 1
library library
ghc-options: -Werror=incomplete-patterns -Wall -fno-warn-name-shadowing 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-tool-depends: alex:alex >= 3.0, happy:happy >= 1.19.5
build-depends: base >=4 build-depends: base >=4
, array , array
, containers , containers
, transformers , transformers
, mtl , mtl
, text
hs-source-dirs: src hs-source-dirs: src
default-language: Haskell2010 default-language: Haskell2010

View File

@ -6,11 +6,8 @@ A simple, terminating, pure, hindley milner lambda calculus with inductively def
Depends: Depends:
* BNFC * BNFC
* GNU make
* GHC * GHC
* Cabal * Cabal
Instructions: Instructions:
* Run `bnfc -dm --text-token --functor hm.cf`
* Run `make`
* Run `cabal build` * Run `cabal build`

1
src/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
Hm