diff --git a/Makefile b/Makefile index f14987636..41ce46a72 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/package.yaml b/package.yaml index 9a8f665e2..c46471367 100644 --- a/package.yaml +++ b/package.yaml @@ -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: