diff options
Diffstat (limited to 'apps/plugins/plugins.make')
-rw-r--r-- | apps/plugins/plugins.make | 29 |
1 files changed, 28 insertions, 1 deletions
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 | |||
101 | PLUGINLIBFLAGS = $(PLUGINFLAGS) -ffunction-sections -fdata-sections | 101 | PLUGINLIBFLAGS = $(PLUGINFLAGS) -ffunction-sections -fdata-sections |
102 | endif | 102 | endif |
103 | 103 | ||
104 | ROOT_PLUGINSLIB_DIR := $(ROOTDIR)/apps/plugins/lib | ||
105 | BUILD_PLUGINSLIB_DIR := $(BUILDDIR)/apps/plugins/lib | ||
106 | |||
107 | # action_helper # | ||
108 | ACTION_REQ := $(addprefix $(ROOT_PLUGINSLIB_DIR)/,action_helper.pl action_helper.h) \ | ||
109 | $(BUILD_PLUGINSLIB_DIR)/pluginlib_actions.o | ||
110 | |||
111 | # special rule for generating and compiling action_helper | ||
112 | $(BUILD_PLUGINSLIB_DIR)/action_helper.o: $(ACTION_REQ) | ||
113 | $(SILENT)mkdir -p $(dir $@) | ||
114 | $(call PRINTS,GEN $(@F))$(CC) $(PLUGINFLAGS) $(INCLUDES) -E -P \ | ||
115 | $(ROOT_PLUGINSLIB_DIR)/pluginlib_actions.h - < /dev/null | $< > $(basename $@).c | ||
116 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(ROOT_PLUGINSLIB_DIR) \ | ||
117 | $(PLUGINLIBFLAGS) -c $(basename $@).c -o $@ | ||
118 | |||
119 | # button_helper # | ||
120 | BUTTON_REQ := $(addprefix $(ROOT_PLUGINSLIB_DIR)/,button_helper.pl button_helper.h) \ | ||
121 | $(BUILD_PLUGINSLIB_DIR)/action_helper.o | ||
122 | |||
123 | # special rule for generating and compiling button_helper | ||
124 | $(BUILD_PLUGINSLIB_DIR)/button_helper.o: $(BUTTON_REQ) $(ROOTDIR)/firmware/export/button.h | ||
125 | $(SILENT)mkdir -p $(dir $@) | ||
126 | $(call PRINTS,GEN $(@F))$(CC) $(PLUGINFLAGS) $(INCLUDES) -dM -E -P \ | ||
127 | $(addprefix -include ,button-target.h button.h) - < /dev/null | $< > $(basename $@).c | ||
128 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(ROOT_PLUGINSLIB_DIR) \ | ||
129 | $(PLUGINLIBFLAGS) -c $(basename $@).c -o $@ | ||
130 | |||
104 | # special pattern rule for compiling plugin lib (with function and data sections) | 131 | # special pattern rule for compiling plugin lib (with function and data sections) |
105 | $(BUILDDIR)/apps/plugins/lib/%.o: $(ROOTDIR)/apps/plugins/lib/%.c | 132 | $(BUILD_PLUGINSLIB_DIR)/%.o: $(ROOT_PLUGINSLIB_DIR)/%.c |
106 | $(SILENT)mkdir -p $(dir $@) | 133 | $(SILENT)mkdir -p $(dir $@) |
107 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINLIBFLAGS) -c $< -o $@ | 134 | $(call PRINTS,CC $(subst $(ROOTDIR)/,,$<))$(CC) -I$(dir $<) $(PLUGINLIBFLAGS) -c $< -o $@ |
108 | 135 | ||