setup build system properly

master
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 100644
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:
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

View File

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

1
src/.gitignore vendored 100644
View File

@ -0,0 +1 @@
Hm