1 ################################################################################ 44 ################################################################################ 48 # NetMsgs source generator command 49 NETMSGSGEN = netmsgsgen
54 NETMSGS_BASES = $(basename $(NETMSGS_XML_FILES))
57 NETMSGS_H_FILES = $(addprefix $(NETMSGS_H_DIR)/,\
58 $(addsuffix .h,$(NETMSGS_BASES)))
61 NETMSGS_C_FILES = $(addprefix $(NETMSGS_C_DIR)/,\
62 $(addsuffix .c,$(NETMSGS_BASES)))
65 NETMSGS_PY_FILES = $(addprefix $(NETMSGS_PY_DIR)/,\
66 $(addsuffix .py,$(NETMSGS_BASES)))
68 NETMSGS_SHARE_DIR ?= $(RNMAKE_PKG_ROOT)/share
69 NETMSGS_SHARE_FILES = $(addprefix $(NETMSGS_SHARE_DIR)/,$(NETMSGS_XML_FILES))
72 $(addprefix $(NETMSGS_C_DIR)/,$(addsuffix .c,$(basename $(1))))
75 .PHONY: netmsgs-all netmsgs-all-c netmsgs-all-py netmsgs-all-share
76 netmsgs-all: netmsgs-all-c netmsgs-all-py netmsgs-all-share
78 netmsgs-all-c: $(NETMSGS_H_FILES)
80 netmsgs-all-py: $(NETMSGS_PY_FILES)
82 netmsgs-all-share: $(NETMSGS_SHARE_FILES)
86 $(RM) $(NETMSGS_H_FILES)
87 $(RM) $(NETMSGS_C_FILES)
88 $(RM) $(NETMSGS_PY_FILES)
89 $(RM) $(NETMSGS_SHARE_FILES)
91 # Generate NetMsgs C .h and .c message files from XML 92 $(NETMSGS_H_DIR)/%.h : %.xml
94 @printf
"$(color_tgt_file) $(<)$(color_end)\n" 95 @test -d
"$(NETMSGS_H_DIR)" || $(MKDIR) $(NETMSGS_H_DIR)
96 $(NETMSGSGEN) --lang=c --xml=$(<) $(NETMSGS_CFLAGS) $(@) $(call xml2c,$(<))
98 # Generate NetMsgs Python .py files from XML
99 $(NETMSGS_PY_DIR)/%.py : %.xml
101 @printf
"$(color_tgt_file) $(<)$(color_end)\n" 102 @test -d
"$(NETMSGS_PY_DIR)" || $(MKDIR) $(NETMSGS_PY_DIR)
103 $(NETMSGSGEN) --lang=python --xml=$(<) $(NETMSGS_PYFLAGS) $(@)
105 # Copy NetMsgs XML specification files to share 106 $(NETMSGS_SHARE_DIR)/%.xml : %.xml
108 @printf
"$(color_tgt_file) $(<)$(color_end)\n" 109 @test -d
"$(NETMSGS_SHARE_DIR)" || $(MKDIR) $(NETMSGS_SHARE_DIR)