]> rtime.felk.cvut.cz Git - omk.git/blob - snippets/nuttx-bin.omk
Initial support for NuttX user-space programs build.
[omk.git] / snippets / nuttx-bin.omk
1
2 # Final rules for NuttX binaries build requests preparation
3
4 # Interface to other rules:
5
6 # Input variables:
7 # bin_PROGRAMS     .. list of the require binary programs
8 # utils_PROGRAMS   .. list of the development utility programs
9 # USER_BIN_DIR     .. directory to store final executables
10 # USER_TESTS_DIR   .. directory to store test executables
11
12 # Defined variables
13 # USER_REGISTRY_DIR .. directory where registry for builtin applications is stored
14
15 USER_REGISTRY_DIR = $(USER_COMPILED_DIR_NAME)/registry
16
17 check-dir::
18         @$(call mkdir_def,$(USER_REGISTRY_DIR))
19
20 $(foreach prog,$(bin_PROGRAMS),$(eval $(call ELF_template,$(prog),$(USER_BIN_DIR))))
21 $(foreach prog,$(test_PROGRAMS),$(eval $(call ELF_template,$(prog),$(USER_TESTS_DIR))))
22
23 binary-pass-local:  $(bin_PROGRAMS:%=$(USER_BIN_DIR)/%.elf) $(test_PROGRAMS:%=$(USER_TESTS_DIR)/%.elf)
24
25 $(foreach prog,$(bin_PROGRAMS),$(eval $(call PROGBUILTIN_template,$(prog),$(USER_REGISTRY_DIR),$(USER_REGISTRY_DIR))))
26
27 library-pass-local:  $(bin_PROGRAMS:%=$(USER_REGISTRY_DIR)/%.pbi)
28
29 clean-local::
30         $(Q)rm -f $(bin_PROGRAMS:%=$(USER_REGISTRY_DIR)/%.*)