2021-10-26 15:44:54 +03:00
|
|
|
PWD=$(CURDIR)
|
|
|
|
PREFIX="$(PWD)/.stack-work/prefix"
|
|
|
|
UNAME := $(shell uname)
|
|
|
|
|
2021-10-30 12:51:42 +03:00
|
|
|
AGDA_FILES := $(wildcard ./src/MiniJuvix/Syntax/*.agda)
|
|
|
|
GEN_HS := $(patsubst %.agda, %.hs, $(AGDA_FILES))
|
|
|
|
|
2021-10-26 15:44:54 +03:00
|
|
|
ifeq ($(UNAME), Darwin)
|
|
|
|
THREADS := $(shell sysctl -n hw.logicalcpu)
|
|
|
|
else ifeq ($(UNAME), Linux)
|
|
|
|
THREADS := $(shell nproc)
|
|
|
|
else
|
|
|
|
THREADS := $(shell echo %NUMBER_OF_PROCESSORS%)
|
|
|
|
endif
|
2021-09-26 19:59:51 +03:00
|
|
|
|
2021-10-30 12:51:42 +03:00
|
|
|
all:
|
|
|
|
make prepare-push
|
|
|
|
|
2021-09-26 19:59:51 +03:00
|
|
|
.PHONY : checklines
|
|
|
|
checklines :
|
|
|
|
@grep '.\{81,\}' \
|
2021-10-30 12:51:42 +03:00
|
|
|
--exclude=*.agda \
|
2021-09-26 19:59:51 +03:00
|
|
|
-l --recursive src; \
|
|
|
|
status=$$?; \
|
|
|
|
if [ $$status = 0 ] ; \
|
|
|
|
then echo "Lines were found with more than 80 characters!"; \
|
|
|
|
else echo "Succeed!"; \
|
|
|
|
fi
|
|
|
|
|
|
|
|
.PHONY : hlint
|
|
|
|
hlint :
|
|
|
|
hlint src
|
|
|
|
|
|
|
|
.PHONY : doc
|
|
|
|
doc :
|
|
|
|
cabal haddock --enable-documentation
|
|
|
|
|
2021-10-26 15:44:54 +03:00
|
|
|
.PHONY : cabal-build
|
|
|
|
cabal-build :
|
2021-09-26 19:59:51 +03:00
|
|
|
cabal build all
|
|
|
|
|
2021-10-18 20:25:26 +03:00
|
|
|
.PHONY : gen
|
2021-10-30 12:51:42 +03:00
|
|
|
gen :
|
|
|
|
agda2hs ./src/MiniJuvix/Syntax/Core.agda -o src -XUnicodeSyntax -XStandaloneDeriving -XDerivingStrategies -XMultiParamTypeClasses
|
|
|
|
agda2hs ./src/MiniJuvix/Syntax/Eval.agda -o src -XUnicodeSyntax -XStandaloneDeriving -XDerivingStrategies -XMultiParamTypeClasses
|
2021-10-18 20:25:26 +03:00
|
|
|
|
2021-09-26 19:59:51 +03:00
|
|
|
.PHONY : stan
|
|
|
|
stan :
|
2021-10-26 15:44:54 +03:00
|
|
|
stan check --include --filter-all --directory=src
|
|
|
|
|
2021-10-30 12:51:42 +03:00
|
|
|
setup:
|
|
|
|
stack build --only-dependencies --jobs $(THREADS)
|
|
|
|
|
2021-10-26 15:44:54 +03:00
|
|
|
stack-build:
|
|
|
|
stack build --fast --jobs $(THREADS)
|
|
|
|
|
|
|
|
stack-build-watch:
|
|
|
|
stack build --fast --file-watch
|
|
|
|
|
|
|
|
repl-lib:
|
|
|
|
stack ghci minijuvix:lib
|
|
|
|
|
|
|
|
clean:
|
|
|
|
cabal clean
|
|
|
|
stack clean
|
|
|
|
|
|
|
|
clean-full:
|
2021-10-30 12:51:42 +03:00
|
|
|
stack clean --full
|
|
|
|
|
|
|
|
format:
|
|
|
|
find ./src/ -name "*.hs" -exec ormolu --mode inplace {} --ghc-opt -XStandaloneDeriving --ghc-opt -XUnicodeSyntax --ghc-opt -XDerivingStrategies --ghc-opt -XMultiParamTypeClasses \;
|
|
|
|
|
|
|
|
prepare-push:
|
|
|
|
make checklines && make hlint && make format
|