1
1
mirror of https://github.com/anoma/juvix.git synced 2025-01-07 16:22:14 +03:00
juvix/Makefile

103 lines
2.1 KiB
Makefile
Raw Normal View History

PWD=$(CURDIR)
PREFIX="$(PWD)/.stack-work/prefix"
UNAME := $(shell uname)
2022-04-04 18:44:08 +03:00
HLINTQUIET :=
ifeq ($(UNAME), Darwin)
THREADS := $(shell sysctl -n hw.logicalcpu)
else ifeq ($(UNAME), Linux)
THREADS := $(shell nproc)
else
THREADS := $(shell echo %NUMBER_OF_PROCESSORS%)
endif
all:
2022-04-05 20:57:21 +03:00
make pre-commit
.PHONY : checklines
checklines :
@grep '.\{81,\}' \
--exclude=*.agda \
-l --recursive src; \
status=$$?; \
if [ $$status = 0 ] ; \
then echo "Lines were found with more than 80 characters!" >&2 ; \
else echo "Succeed!"; \
fi
.PHONY : hlint
hlint :
2022-04-05 20:57:21 +03:00
@hlint src app test ${HLINTQUIET}
.PHONY : haddock
haddock :
cabal --docdir=docs/ --htmldir=docs/ haddock --enable-documentation
.PHONY : docs
docs :
cd docs ; \
sh conv.sh
.PHONY : build
build:
stack build --fast --jobs $(THREADS)
build-watch:
stack build --fast --file-watch
.PHONY : cabal
cabal :
cabal build all
clean:
cabal clean
stack clean
clean-full:
stack clean --full
2022-03-23 14:13:28 +03:00
.PHONY : test
test:
stack test --fast --jobs $(THREADS)
.PHONY : test-watch
test-watch:
stack test --fast --jobs $(THREADS) --file-watch
format:
2022-04-05 20:57:21 +03:00
@find . -name "*.hs" -exec ormolu --mode inplace {} --ghc-opt -XStandaloneDeriving --ghc-opt -XUnicodeSyntax --ghc-opt -XDerivingStrategies --ghc-opt -XMultiParamTypeClasses --ghc-opt -XTemplateHaskell --ghc-opt -XImportQualifiedPost \;
.PHONY: check-ormolu
check-ormolu:
2022-04-05 20:57:21 +03:00
@find . -name "*.hs" -exec ormolu --mode check {} --ghc-opt -XStandaloneDeriving --ghc-opt -XUnicodeSyntax --ghc-opt -XDerivingStrategies --ghc-opt -XMultiParamTypeClasses --ghc-opt -XTemplateHaskell --ghc-opt -XImportQualifiedPost \;
2022-03-23 14:13:28 +03:00
.PHONY : install
install:
stack install --fast --jobs $(THREADS)
.PHONY : install-watch
install-watch:
stack install --fast --jobs $(THREADS) --file-watch
repl:
2021-11-06 02:46:28 +03:00
stack ghci MiniJuvix:lib
2022-04-05 20:57:21 +03:00
.PHONY : install-pre-commit
install-pre-commit:
pip install pre-commit
pre-commit install
.PHONY : pre-commit
pre-commit :
pre-commit run --all-files
.PHONY : update-submodules
update-submodules :
git submodule foreach git pull origin main
.PHONY : minijuvix-stdlib
minijuvix-stdlib:
2022-04-04 18:44:08 +03:00
git submodule update --init minijuvix-stdlib