1PLUGIN_UUID = f07bfc66-958c-4a15-99c0-260e4e7375dd
2
3PLUGIN			= $(PLUGIN_UUID).plugin
4PLUGIN_SRS		= $(wildcard ./*.c)
5PLUGIN_OBJ		= $(patsubst %.c, $(O)/supp_plugin/%.o, $(PLUGIN_SRS))
6PLUGIN_INCLUDES_DIR	= $(CURDIR)/include $(OPTEE_CLIENT_EXPORT)/include
7
8PLUGIN_INCLUDES		= $(addprefix -I, $(PLUGIN_INCLUDES_DIR))
9PLUGIN_CCFLAGS		= $(CFLAGS) -Wall -fPIC
10PLUGIN_LDFLAGS		= $(LDFLAGS) -shared
11
12CC			?= $(CROSS_COMPILE)gcc
13
14$(O)/supp_plugin/$(PLUGIN): $(PLUGIN_OBJ)
15	$(q)$(CC) $(PLUGIN_LDFLAGS) $(PLUGIN_OBJ) -o $@
16
17$(O)/supp_plugin/%.o: $(CURDIR)/%.c
18	$(q)mkdir -p $(O)/supp_plugin
19	@echo '  CC      $<'
20	$(q)$(CC) $(PLUGIN_INCLUDES) $(PLUGIN_CCFLAGS) -c $< -o $@
21
22.PHONY: clean
23clean:
24	$(q)$(RM) -rf $(O)/supp_plugin/
25