Makefile multi-target support

NuttX is still the default target and all NuttX configs can still
be built with:

make

Individual NuttX, POSIX, and QuRT configs can now be built more
easily by specifying the target and configs:

make posix posix_default
make qurt qurt_hello
make nuttx aerocore_default

Running make with just the target will make all the configs for
that target:

make nuttx
make qurt
make posix

The help is also target specific:
make nuttx help
make qurt help
make posix help

"make help" will still assume you want help for the NuttX target

Added a new QuRT config called qurt_hello as a sample config to
test buiding in different commands for separate configs.

Signed-off-by: Mark Charlebois <charlebm@gmail.com>
This commit is contained in:
Mark Charlebois
2015-05-20 19:19:08 -07:00
parent 00296ba241
commit 43345e29dc
8 changed files with 216 additions and 34 deletions
+5 -25
View File
@@ -50,30 +50,10 @@ using namespace std;
extern void init_app_map(map<string,px4_main_t> &apps);
extern void list_builtins(map<string,px4_main_t> &apps);
static const char *commands =
"hello start\n"
"uorb start\n"
"simulator start -s\n"
"barosim start\n"
"adcsim start\n"
"accelsim start\n"
"gyrosim start\n"
"list_devices\n"
"list_topics\n"
"list_tasks\n"
"param show *\n"
"rgbled start\n"
#if 0
"hil mode_pwm"
"param set CAL_GYRO0_ID 2293760\n"
"param set CAL_ACC0_ID 1310720\n"
"param set CAL_ACC1_ID 1376256\n"
"param set CAL_MAG0_ID 196608\n"
"sensors start\n"
"mavlink start -d /tmp/ttyS0\n"
"commander start\n"
#endif
;
__BEGIN_DECLS
// The commands to run are specified in a target file: commands_<target>.c
extern const char *get_commands(void);
__END_DECLS
static void run_cmd(map<string,px4_main_t> &apps, const vector<string> &appargs) {
// command is appargs[0]
@@ -158,7 +138,7 @@ int main(int argc, char **argv)
init_app_map(apps);
px4::init_once();
px4::init(argc, argv, "mainapp");
process_commands(apps, commands);
process_commands(apps, get_commands());
for (;;) {}
}