blob: d90f926c42eddd78cc5be315f7d779dc90b78942 [file] [log] [blame]
Gyorgy Szingba1095c2020-11-24 00:33:11 +01001# Copyright (c) 2020, Arm Limited and Contributors. All rights reserved.
2#
3# SPDX-License-Identifier: BSD-3-Clause
4#
5
6.SUFFIXES:
7.SUFFIXES: .j2
8
9# Disable parallel execution for this makefile.
10.NOTPARALLEL:
11
12TEMPLATES:=$(wildcard *.j2)
13OUTPUTS:=$(TEMPLATES:%.j2=%)
14
15all:
Gyorgy Szingb164e392021-09-04 01:51:57 +020016 ${MAKE} config
Gyorgy Szingba1095c2020-11-24 00:33:11 +010017 bash run.sh
18
19config: ${OUTPUTS}
20
21list:
Gyorgy Szingb164e392021-09-04 01:51:57 +020022 ${MAKE} config
Gyorgy Szingba1095c2020-11-24 00:33:11 +010023 bash run.sh help
24
25# run a command of the generated script
26r-%:
Gyorgy Szingb164e392021-09-04 01:51:57 +020027 ${MAKE} config
Gyorgy Szingba1095c2020-11-24 00:33:11 +010028 bash run.sh "$*"
29
30define help_msg
31*************************************************************
32Available targets:
33 all - generate and run test script
34 config - run script generation only
35 clean - remove intermediate files
36 list - run config and list test cases
37 p-<variable> - print value of make variable (for debugging)
38 r-<test> - run a command of the generated script. Allow
39 executing a single test case. Use
40 make r-help
41 to get the list of tests.
42*************************************************************
43endef
44
45export help_msg
46help:
47 @echo "$$help_msg"
48
49# remove intermediate output
50clean:
51ifneq ($(wildcard ./run.sh),)
52 bash run.sh clean
53endif
54 -rm -rf ${OUTPUTS}
55
56# Convert template to shell script
57%.sh : %.sh.j2 test_data.yaml
58 yasha -v test_data.yaml $<
59
60# print variable value (i.e. make p-TEMPLATES)
61p-%:
62 @echo $*=${$*}