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

136 lines
3.6 KiB
Makefile

db ?= -cf
.PHONY: help
help:
@echo "Nothing to see here, go away"
.PHONY: build
build: frontend-build backend-build
#.PHONY: start
#start: frontend-build
# $(MAKE) --jobs=2 frontend-watch backend-start
.PHONY: lint
lint: frontend-lint backend-lint
.PHONY: test
test: frontend-test backend-test i18n-check
.PHONY: backend-%
backend-%: # .stack-work.lock # --stack-work-$*
$(MAKE) -- --backend-$*-dev
#( $(MAKE) -- --backend-$* || $(MAKE) -- --stack-krow-$* ) && ( $(MAKE) -- --stack-krow-$* )
.PHONY: backend-%-prod
backend-%-prod: # .stack-work.lock # --stack-work-$*
$(MAKE) -- --backend-$*
.PHONY: --backend-%-dev
--backend-%-dev: .develop.env
$(MAKE) -- --backend-$* dev=--flag\ uniworx:dev
.PHONY: --backend-%-prod
--backend-%-prod:
$(MAKE) -- --backend-$*
.PHONY: --backend-build
--backend-build:
stack build --fast --profile --library-profiling --executable-profiling $(dev) --flag uniworx:-library-only
.PHONY: --backend-lint
--backend-lint:
stack build --test --fast $(dev) --flag uniworx:library-only uniworx:test:hlint
.PHONY: backend-dependencies
backend-dependencies:
stack build --fast --only-dependencies
.PHONY: --backend-test
--backend-test:
stack build --test --coverage --fast $(dev) --flag uniworx:library-only
.PHONY: i18n-check
i18n-check:
./missing-translations.sh
@echo No missing translations.
.PHONY: database
database: .stack-work.lock # --stack-work-build
$(MAKE) -- --database
# ( $(MAKE) -- --database || $(MAKE) -- --stack-krow-build ) && ( $(MAKE) -- --stack-krow-build )
.PHONY: --database
--database: .stack-work.lock
stack build --fast --flag uniworx:-library-only $(dev)
export SERVER_SESSION_ACID_FALLBACK=$${SERVER_SESSION_ACID_FALLBACK:-true}
export AVSPASS=$${AVSPASS:-nopasswordset}
stack exec uniworxdb -- $(db)
.PHONY: frontend-%
frontend-%: node_modules
$(MAKE) -- --frontend-$*
.PHONY: --frontend-build
--frontend-build:
npx -- webpack --progress $(WATCH)
.PHONY: --frontend-watch
--frontend-watch: WATCH=--watch
--frontend-watch: --frontend-build
.PHONY: --frontend-lint
--frontend-lint: .eslintrc.json
npx -- eslint frontend/src $(FIX)
@echo Hooray! There are no hints.
.PHONY: --frontend-test
--frontend-test: karma.conf.js
npx -- karma start --conf karma.conf.js $(WATCH)
.PHONY: --frontend-test-watch
--frontend-test-watch: WATCH=--single-run false
--frontend-test-watch: --frontend-test
node_modules: .npmrc package.json
npm ci --cache .npm --prefer-offline
well-known: node_modules
npx webpack --progress
.npmrc:
command gup .npmrc
.PHONY: clean
clean:
rm -rf node_modules
rm -rf .stack-work .stack-work-build .stack-work-run .stack-work-test .stack-work-doc
.PHONY: %.lock
%.lock:
[ -e $@ ] || touch $@
flock -en $@ true
.PHONY: .stack-work.lock
.stack-work.lock:
[ "${FLOCKER}" != "$0" ] && exec env FLOCKER="$0" flock -en .stack-work.lock "$0" "$@" || :
.PHONY: .develop.env
.develop.env:
[[ ! -z "$(CI)" || ! -z "$$PORT_OFFSET" ]] || ( echo "Not in develop!" 2>&1 ; exit 1 )
# .PHONY: --stack-work-%
# --stack-work-%: .stack-work.lock
# [[ -d .stack-work && -d .stack-work-$* ]] && (echo ".stack-work collides with .stack-work-$*, please resolve manually" 1>&2; exit 1) || :
# [[ ! -d .stack-work-$* ]] || mv .stack-work-$* .stack-work
#
# .PHONY: --stack-krow-%
# --stack-krow-%:
# [[ ! -d .stack-work-$* ]] || ( echo ".stack-work-$* already exists, please resolve manually" 1>&2 ; exit 1 )
# mv .stack-work .stack-work-$*
# flock -u .stack-work.lock true
# watch:
# while true; do \
#
# start: frontend-build frontend-build-watch yesod-start
# run-s frontend:build --parallel "frontend:build:watch" "yesod:start"