If my .cabal file has multiple executables, I can single out one to build by typing the name
cabal build myExecutable
But I am lazy, and want to type just
cabal build
for a default target (I can stand the extra characters of typing for my secondary executables).
Is this possible? (I've been google'ing and looking through the cabal manual for a while now.... No definitive answer yet).
I have to do this, like, 1000 times a day....
You could hack something together with flags, e.g.:
flag all
default: False
executable first-prog:
buildable: True
executable second-prog
if flag(all)
buildable: True
else
buildable: False
executable third-prog:
if flag(all)
buildable: True
else
buildable: False
and then use cabal configure -fall; cabal build
when you wanted to build everything.
You could use the age old solution of writing a make file and just type
$ make
into your terminal.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With