From b39acee3abd199d80b84c68ebfa7301b7e7a957e Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Fri, 12 Nov 2021 20:50:20 -0500 Subject: rb_info plugin and button,action+context name helper rb_info is just a test plugin just some info from the running rockbox install the real star here is the generator scripts to make actions_helper.c and button_helper.c Change-Id: I23f7bbdae3f2cffca2490c4df40bb13b0b5d5064 --- apps/plugins/plugins.make | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) (limited to 'apps/plugins/plugins.make') diff --git a/apps/plugins/plugins.make b/apps/plugins/plugins.make index ac94a04c59..b430bd2792 100644 --- a/apps/plugins/plugins.make +++ b/apps/plugins/plugins.make @@ -101,8 +101,35 @@ else PLUGINLIBFLAGS = $(PLUGINFLAGS) -ffunction-sections -fdata-sections endif +ROOT_PLUGINSLIB_DIR := $(ROOTDIR)/apps/plugins/lib +BUILD_PLUGINSLIB_DIR := $(BUILDDIR)/apps/plugins/lib + +# action_helper # +ACTION_REQ := $(addprefix $(ROOT_PLUGINSLIB_DIR)/,action_helper.pl action_helper.h) \ + $(BUILD_PLUGINSLIB_DIR)/pluginlib_actions.o + +# special rule for generating and compiling action_helper +$(BUILD_PLUGINSLIB_DIR)/action_helper.o: $(ACTION_REQ) + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,GEN $(@F))$(CC) $(PLUGINFLAGS) $(INCLUDES) -E -P \ + $(ROOT_PLUGINSLIB_DIR)/pluginlib_actions.h - < /dev/null | $< > $(basename $@).c + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(ROOT_PLUGINSLIB_DIR) \ + $(PLUGINLIBFLAGS) -c $(basename $@).c -o $@ + +# button_helper # +BUTTON_REQ := $(addprefix $(ROOT_PLUGINSLIB_DIR)/,button_helper.pl button_helper.h) \ + $(BUILD_PLUGINSLIB_DIR)/action_helper.o + +# special rule for generating and compiling button_helper +$(BUILD_PLUGINSLIB_DIR)/button_helper.o: $(BUTTON_REQ) $(ROOTDIR)/firmware/export/button.h + $(SILENT)mkdir -p $(dir $@) + $(call PRINTS,GEN $(@F))$(CC) $(PLUGINFLAGS) $(INCLUDES) -dM -E -P \ + $(addprefix -include ,button-target.h button.h) - < /dev/null | $< > $(basename $@).c + $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(ROOT_PLUGINSLIB_DIR) \ + $(PLUGINLIBFLAGS) -c $(basename $@).c -o $@ + # special pattern rule for compiling plugin lib (with function and data sections) -$(BUILDDIR)/apps/plugins/lib/%.o: $(ROOTDIR)/apps/plugins/lib/%.c +$(BUILD_PLUGINSLIB_DIR)/%.o: $(ROOT_PLUGINSLIB_DIR)/%.c $(SILENT)mkdir -p $(dir $@) $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINLIBFLAGS) -c $< -o $@ -- cgit v1.2.3