1CC      ?= $(CROSS_COMPILE)gcc
2LD      ?= $(CROSS_COMPILE)ld
3AR      ?= $(CROSS_COMPILE)ar
4NM      ?= $(CROSS_COMPILE)nm
5OBJCOPY ?= $(CROSS_COMPILE)objcopy
6OBJDUMP ?= $(CROSS_COMPILE)objdump
7READELF ?= $(CROSS_COMPILE)readelf
8
9OBJS = main.o
10
11CFLAGS += -Wall -I../ta/include -I$(TEEC_EXPORT)/include -I./include
12CFLAGS += -DBINARY_PREFIX=\"TEE-EXMPL\"
13
14#Add/link other required libraries here
15LDADD += -lteec -L$(TEEC_EXPORT)/lib
16
17BINARY = optee_example_plugins
18
19.PHONY: all
20all: $(BINARY)
21
22$(BINARY): $(OBJS)
23	$(CC) $(LDFLAGS) -o $@ $< $(LDADD)
24
25.PHONY: clean
26clean:
27	rm -f $(OBJS) $(BINARY)
28
29%.o: %.c
30	$(CC) $(CFLAGS) -c $< -o $@
31