You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
1.1 KiB

9 years ago
  1. #
  2. # This file is the default set of rules to compile a Pebble project.
  3. #
  4. # Feel free to customize this to your needs.
  5. #
  6. import os.path
  7. top = '.'
  8. out = 'build'
  9. def options(ctx):
  10. ctx.load('pebble_sdk')
  11. def configure(ctx):
  12. ctx.load('pebble_sdk')
  13. def build(ctx):
  14. ctx.load('pebble_sdk')
  15. build_worker = os.path.exists('worker_src')
  16. binaries = []
  17. for p in ctx.env.TARGET_PLATFORMS:
  18. ctx.set_env(ctx.all_envs[p])
  19. ctx.set_group(ctx.env.PLATFORM_NAME)
  20. app_elf='{}/pebble-app.elf'.format(ctx.env.BUILD_DIR)
  21. ctx.pbl_program(source=ctx.path.ant_glob('src/**/*.c'),
  22. target=app_elf)
  23. if build_worker:
  24. worker_elf='{}/pebble-worker.elf'.format(ctx.env.BUILD_DIR)
  25. binaries.append({'platform': p, 'app_elf': app_elf, 'worker_elf': worker_elf})
  26. ctx.pbl_worker(source=ctx.path.ant_glob('worker_src/**/*.c'),
  27. target=worker_elf)
  28. else:
  29. binaries.append({'platform': p, 'app_elf': app_elf})
  30. ctx.set_group('bundle')
  31. ctx.pbl_bundle(binaries=binaries, js=ctx.path.ant_glob('src/js/**/*.js'))