This repository has been archived on 2024-10-24. You can view files and clone it, but cannot push or open issues or pull requests.
fradrive-old/Makefile

52 lines
1.5 KiB
Makefile

db ?= -cf
.PHONY: help
help:
@echo "Nothing to see here, go away"
.PHONY: backend-%
backend-%: --stack-work-$* --backend-$* --stack-krow-$*
.PHONY: database
database: --stack-work-build --database --stack-krow-build
.PHONY: --database
--database:
(in-develop | grep -q 'In develop') || (echo "Not in develop" 1>&2; exit 1)
stack build --fast --flag uniworx:-library-only --flag uniworx:dev
export SERVER_SESSION_ACID_FALLBACK=$${SERVER_SESSION_ACID_FALLBACK:-true}
stack exec uniworxdb -- $(db)
node_modules: .npmrc package.json
npm ci --cache .npm --prefer-offline
.npmrc:
command gup .npmrc
.PHONY: %.lock
%.lock:
[ -e $@ ] || touch $@
flock -en $@ :
.PHONY: --backend-build
--backend-build:
stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --flag uniworx:dev
.PHONY: --stack-work-%
--stack-work-%: .stack-work.lock
[[ -e .stack-work && -e .stack-work-$* ]] && (echo ".stack-work collides with .stack-work-$*, please resolve manually" 1>&2; exit 1)
[[ -e .stack-work && ! -e .stack-work-$* ]] || mv .stack-work-$* .stack-work
.PHONY: --stack-krow-%
--stack-krow-%:
[[ -e .stack-work-$* && echo ".stack-work-$* already exists, please resolve manually" 1>&2; exit 1 ]] || mv .stack-work .stack-work-$*
flock -u .stack-work.lock
# TODO: yarn2nix target
# watch:
# while true; do \
#
# start: frontend-build frontend-build-watch yesod-start
# run-s frontend:build --parallel "frontend:build:watch" "yesod:start"