blob: 4d29a41b097caaf81505ecb63e0fa87212d5e90c [file] [log] [blame]
Igor Opaniuk06fe31c2017-08-07 02:37:51 +03001export V?=0
2
3OUTPUT_DIR := $(CURDIR)/out
4EXAMPLE_LIST := hello_world random
5
6.PHONY: all
7all: examples prepare-for-rootfs
8
9.PHONY: clean
10clean: examples-clean prepare-for-rootfs-clean
11
12examples:
13 for example in $(EXAMPLE_LIST); do \
14 $(MAKE) -C $$example CROSS_COMPILE="$(HOST_CROSS_COMPILE)"; \
15 done
16
17examples-clean:
18 for example in $(EXAMPLE_LIST); do \
19 $(MAKE) -C $$example clean; \
20 done
21
22prepare-for-rootfs: examples
23 echo "Copying example CA and TA binaries to $(OUTPUT_DIR)..."
24 @mkdir -p $(OUTPUT_DIR)
25 @mkdir -p $(OUTPUT_DIR)/ta
26 @mkdir -p $(OUTPUT_DIR)/ca
27 @for example in $(EXAMPLE_LIST); do \
Igor Opaniuka48df3c2017-09-04 22:26:18 +030028 if [ -e $$example/host/optee_$$example ]; then \
Igor Opaniuk06fe31c2017-08-07 02:37:51 +030029 cp -p $$example/host/optee_$$example $(OUTPUT_DIR)/ca/; \
30 fi; \
31 cp -pr $$example/ta/*.ta $(OUTPUT_DIR)/ta/; \
32 done
33
34prepare-for-rootfs-clean:
35 rm -rf $(OUTPUT_DIR)/ta/*
36 rm -rf $(OUTPUT_DIR)/ca/*