When I run cabal build for my project, it places my compiled executable in
dist-newstyle/build/$PLATFORM/$GHC/$PACKAGE-$VERSION/x/$PACKAGE/build/$PACKAGE/$PACKAGE
I'm using a Makefile to run cabal build as needed when I need to run the executable.
Since I'm working on different platforms at various times, I need a way to tell my Makefile what to expect the $PLATFORM value to be.
There's a couple ways I could go about this:
run
cabal buildonce unconditionally, and then use wildcards:BIN := $(wildcard dist-newstyle/build/*/ghc-*/foo-*/x/foo/build/foo/foo)use
unameto predict what the platform will beBIN := dist-newstyle/build/$(shell uname -m)-$(shell uname -s | some magic)/ghc-$(shell ghc --version | some magic)/foo-$(VERSION)/x/foo/build/foo/foogive up on making sure the binary is up to date within the
Makefileand just runcabal rununconditionally
Any of those would work, but I would like to know if I could just ask cabal to tell me where it expects to place an executable.
Is there a cabal command I can run to tell me what $PLATFORM and/or $GHC values it detects?