Build system

From TinyWiki

Jump to: navigation, search

What the build system is

todo

Configuring the build system

MAKERULES is used to point to Makerules in the build system.

Before tools/make/ existed, all applications' Makefiles used "include ../Makerules" to bring in the rules for the build system. This sort of worked, but it meant that any application had to have a Makerules in the parent directory. And, as a monolithic file, Makerules made it very difficult to support a different targets and programmer methods. People stuck to the "include ../Makerules" convention and copied a Makerules as necessary -- bad choice. This lead to many forks of Makerules.

It is especially nice to have an environment variable for that include, because application Makefiles can now read "include $(MAKERULES)", allowing the application directory to live anywhere, with no preconditions on a Makerules specifically in the parent dir.

Makelocal is also a hold over. People can still use it as they like. It should live in the same directory as MAKERULES. However, make itself integrates nicely with environment variables. Any variables you set in Makelocal can be equivalently set as variable exports in a login script such as ~/.bashrc. This is the preferred method over Makelocal, which is kind of weird, unless you want to use actual Make'isms.

Finally, there seems to be some confusion lately that the programmer method (such as "mib510") must be defined on the command line. This is not true. The build system for avr platforms defines a variable DEFAULT_PROGRAM that can specify the default programming method for uisp. This has been an option for a nearly a year and a half, since January 8, 2004. As an example, this works

export MIB510=/dev/ttyS0
export DEFAULT_PROGRAM=mib510
make micaz install,1

The build system was extended on 4 May 2005 to allow a DEFAULT_PROGRAM variable to be specified per family. So DEFAULT_PROGRAM_AVR and DEFAULT_PROGRAM_MSP take precedence over DEFAULT_PROGRAM.

You can put those exports in your ~/.bashrc. Or, if you're feeling old-school, you can place them, without the "export" directive, in your Makelocal file.

How the build system works

todo

Personal tools