1

I'm trying to use Shake as replacement for Make in small project. Currently it's mostly used for aliasing shell commands. Is there any way to specify default phony action? Something similar to default: in makefile. For example, given:

phony "build" $ do
    ...

I'd like to declare that if given no targets, it run the action for build.

Neil Mitchell
  • 9,090
  • 1
  • 27
  • 85

1 Answers1

1

Short answer: you can write want ["build"].

Long answer: there are a few things going on here:

  • action defines something that will run by default.

  • The function want is defined as action . need, so it lets you declare some files that you want to build by default. I rarely use action directly, since it's almost always a want you are doing.

  • The function withoutActions takes a build system and removes all the actions from it. You almost never need to call that, since...

  • Provided you are using shakeArgs or shakeArgsWith (which almost everyone should be) then if there are any file-like command line arguments it calls withoutActions and want on the args you passed. If there are no file-like arguments the action statements are not removed and run.

Neil Mitchell
  • 9,090
  • 1
  • 27
  • 85