Etienne Carriere | 3ddc362 | 2017-03-13 15:31:15 +0100 | [diff] [blame] | 1 | ifeq ($O,) |
| 2 | out-dir := $(CURDIR)/out |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 3 | else |
Etienne Carriere | 3ddc362 | 2017-03-13 15:31:15 +0100 | [diff] [blame] | 4 | include scripts/common.mk |
| 5 | out-dir := $(call strip-trailing-slashes-and-dots,$(O)) |
| 6 | ifeq ($(out-dir),) |
| 7 | $(error invalid output directory (O=$(O))) |
| 8 | endif |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 9 | endif |
| 10 | |
Pascal Brand | e0d1841 | 2015-10-13 12:53:58 +0200 | [diff] [blame] | 11 | -include $(TA_DEV_KIT_DIR)/host_include/conf.mk |
Cedric Chaumont | 1390f3a | 2015-08-31 13:55:16 +0200 | [diff] [blame] | 12 | |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 13 | ifneq ($V,1) |
| 14 | q := @ |
Jerome Forissier | 2a1ef2c | 2016-06-15 11:07:27 +0200 | [diff] [blame] | 15 | echo := @echo |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 16 | else |
| 17 | q := |
Jerome Forissier | 2a1ef2c | 2016-06-15 11:07:27 +0200 | [diff] [blame] | 18 | echo := @: |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 19 | endif |
Etienne Carriere | 3ddc362 | 2017-03-13 15:31:15 +0100 | [diff] [blame] | 20 | # export 'q', used by sub-makefiles. |
| 21 | export q |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 22 | |
Andrew F. Davis | 04b0359 | 2016-08-08 15:05:04 -0500 | [diff] [blame] | 23 | # If _HOST or _TA specific compilers are not specified, then use CROSS_COMPILE |
| 24 | CROSS_COMPILE_HOST ?= $(CROSS_COMPILE) |
| 25 | CROSS_COMPILE_TA ?= $(CROSS_COMPILE) |
| 26 | |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 27 | .PHONY: all |
Pascal Brand | e0d1841 | 2015-10-13 12:53:58 +0200 | [diff] [blame] | 28 | ifneq ($(wildcard $(TA_DEV_KIT_DIR)/host_include/conf.mk),) |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 29 | all: xtest ta |
Pascal Brand | e0d1841 | 2015-10-13 12:53:58 +0200 | [diff] [blame] | 30 | else |
| 31 | all: |
| 32 | $(q)echo "TA_DEV_KIT_DIR is not correctly defined" && false |
| 33 | endif |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 34 | |
| 35 | .PHONY: xtest |
| 36 | xtest: |
| 37 | $(q)$(MAKE) -C host/xtest CROSS_COMPILE="$(CROSS_COMPILE_HOST)" \ |
Sumit Garg | 0e00914 | 2015-11-04 15:34:07 -0500 | [diff] [blame] | 38 | --no-builtin-variables \ |
Etienne Carriere | 3ddc362 | 2017-03-13 15:31:15 +0100 | [diff] [blame] | 39 | O=$(out-dir) \ |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 40 | $@ |
| 41 | |
| 42 | .PHONY: ta |
| 43 | ta: |
| 44 | $(q)$(MAKE) -C ta CROSS_COMPILE="$(CROSS_COMPILE_TA)" \ |
Etienne Carriere | 3ddc362 | 2017-03-13 15:31:15 +0100 | [diff] [blame] | 45 | O=$(out-dir) \ |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 46 | $@ |
| 47 | |
| 48 | .PHONY: clean |
Pascal Brand | e0d1841 | 2015-10-13 12:53:58 +0200 | [diff] [blame] | 49 | ifneq ($(wildcard $(TA_DEV_KIT_DIR)/host_include/conf.mk),) |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 50 | clean: |
Etienne Carriere | 3ddc362 | 2017-03-13 15:31:15 +0100 | [diff] [blame] | 51 | $(q)$(MAKE) -C host/xtest O=$(out-dir) $@ |
| 52 | $(q)$(MAKE) -C ta O=$(out-dir) $@ |
Pascal Brand | e0d1841 | 2015-10-13 12:53:58 +0200 | [diff] [blame] | 53 | else |
| 54 | clean: |
| 55 | $(q)echo "TA_DEV_KIT_DIR is not correctly defined" |
| 56 | $(q)echo "You can remove manually $(out-dir)" |
| 57 | endif |
Pascal Brand | c639ac8 | 2015-07-02 08:53:34 +0200 | [diff] [blame] | 58 | |
Markus S. Wamser | a00bfb8 | 2018-10-16 11:20:32 +0200 | [diff] [blame] | 59 | .PHONY: checkpatch checkpatch-staging checkpatch-working |
| 60 | checkpatch: checkpatch-staging checkpatch-working |
| 61 | |
| 62 | checkpatch-working: |
| 63 | @./scripts/checkpatch.sh |
| 64 | |
| 65 | checkpatch-staging: |
| 66 | @./scripts/checkpatch.sh --cached |
| 67 | |
Jerome Forissier | 2a1ef2c | 2016-06-15 11:07:27 +0200 | [diff] [blame] | 68 | install: |
| 69 | $(echo) ' INSTALL ${DESTDIR}/lib/optee_armtz' |
| 70 | $(q)mkdir -p ${DESTDIR}/lib/optee_armtz |
| 71 | $(q)find $(out-dir) -name \*.ta -exec cp -a {} ${DESTDIR}/lib/optee_armtz \; |
| 72 | $(echo) ' INSTALL ${DESTDIR}/bin' |
| 73 | $(q)mkdir -p ${DESTDIR}/bin |
| 74 | $(q)cp -a $(out-dir)/xtest/xtest ${DESTDIR}/bin |
Jerome Forissier | 0756671 | 2020-06-17 17:55:00 +0200 | [diff] [blame] | 75 | |
| 76 | .PHONY: cscope |
| 77 | cscope: |
| 78 | $(echo) ' CSCOPE .' |
| 79 | ${q}rm -f cscope.* |
| 80 | ${q}find $(PWD) -name "*.[ch]" -o -name "*.cpp" | grep -v /package/ > cscope.files |
| 81 | ${q}cscope -b -q -k |