wiki:CodingGuidelines/Jam

While trying to implement Jam Rules for adding WifiFirmware, Matt and Colin encountered, that there are no written coding guidelines. Thus making it hard to stick to them. This Wiki is intended to fill this gap, by collecting (reverse engineering?) these guidelines. Thus allowing to get patches - from newcomers to the jam build system - more easily accepted and making Ingos life somewhat easier :)

Generally use the same rules as for C++:

  • max. 100 chars per line
  • indent with tabs
  • descriptive identifiers (rule names, variable names, action names, ...). Avoid using the $(1), etc style in rules where arguments can easily be named. In actions, this is not possible, so use local variables in the actions that just copy the arguments, but have proper names for them
  • two blank lines inbetween rules, actions, anything that looks like a C/C++ function. (this is not usually done in the existing files, should we start doing it?)
  • rule and action names use CamelCase
  • The action matching a rule is defined right after it, and has the same name suffixed by a '1' character
  • All rules are defined in build/jam and then used througout the buildsystem, unless something is really specific to a subdirectory
Last modified 2 years ago Last modified on Jan 20, 2023, 11:41:41 AM
Note: See TracWiki for help on using the wiki.