chore(stack): introduce uniworxdev binary for always retaining binaries in bin/

This commit is contained in:
Sarah Vaupel 2024-08-15 05:17:27 +02:00
parent 5183ec1707
commit 13d8bfefc7
2 changed files with 18 additions and 7 deletions

View File

@ -33,20 +33,22 @@ backend-%-prod: # .stack-work.lock # --stack-work-$*
# TODO: this creates more binaries than just bin/uniworx as side effect! Document or change behaviour?
bin/uniworx:
$(MAKE) -- --backend-build-prod
bin/uniworxdev:
$(MAKE) -- --backend-build-dev
# TODO replace with bin/uniworxdev
.PHONY: --backend-%-dev
--backend-%-dev: .develop.env
$(MAKE) -- --backend-$* stackopts=--flag\ uniworx:dev
--backend-%-dev: # .develop.env
$(MAKE) -- --backend-$* stackopts="--flag uniworx:dev"
# TODO deprecated in favor of binary targets
.PHONY: --backend-%-prod
--backend-%-prod:
$(MAKE) -- --backend-$* stackopts=--copy-bins\ --local-bin-path\ $$(pwd)/bin\ --flag\ uniworx:-dev
$(MAKE) -- --backend-$* stackopts="--flag uniworx:-dev"
.PHONY: --backend-build
--backend-build: well-known
stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only $(stackopts)
stack build --fast --profile --library-profiling --executable-profiling --flag uniworx:-library-only --copy-bins --local-bin-path $$(pwd)/bin $(stackopts)
.PHONY: --backend-lint
--backend-lint:
@ -85,12 +87,12 @@ database: .stack-work.lock # --stack-work-build
export AVSPASS=$${AVSPASS:-nopasswordset}
stack exec uniworxdb -- $(db)
# TODO: same behaviour as b9in/uniworx! Merge or tweak targets!
# TODO: same behaviour as bin/uniworx! Merge or tweak targets!
bin/uniworxdb: .stack-work.lock
stack build --fast --flag uniworx:-library-only --copy-bins\ --local-bin-path\ $$(pwd)/bin\ --flag\ uniworx:-dev
.PHONY: frontend-%
frontend-%: well-known
frontend-%: node_modules well-known
$(MAKE) -- --frontend-$*
.PHONY: --frontend-build

View File

@ -287,7 +287,7 @@ data-files:
library:
source-dirs: src
executables:
uniworx:
uniworx: &uniworxexe
main: main.hs
source-dirs: app
dependencies:
@ -295,8 +295,17 @@ executables:
when:
- condition: flag(library-only)
buildable: false
- condition: flag(dev)
buildable: false
ghc-options:
- -threaded -rtsopts "-with-rtsopts=-N -T"
uniworxdev:
<<: *uniworxexe
when:
- condition: flag(library-only)
buildable: false
- condition: "!flag(dev)"
buildable: false
uniworxdb:
main: Database.hs
ghc-options: