| Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 1 |  | 
|  | 2 | # To compile on SunOS: add "-lsocket -lnsl" to LDFLAGS | 
| Gilles Peskine | 6bbe783 | 2020-02-26 19:13:28 +0100 | [diff] [blame] | 3 | # To compile with PKCS11: add "-lpkcs11-helper" to LDFLAGS | 
| Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 4 |  | 
| Mohammad Azim Khan | 9540261 | 2017-07-19 10:15:54 +0100 | [diff] [blame] | 5 | CFLAGS	?= -O2 | 
| Paul Elliott | 9e3256a | 2020-12-17 18:17:32 +0000 | [diff] [blame] | 6 | WARNING_CFLAGS ?= -Wall -Wextra -Wformat=2 -Wno-format-nonliteral | 
| Alon Bar-Lev | ada4105 | 2015-02-18 17:47:52 +0200 | [diff] [blame] | 7 | LDFLAGS ?= | 
| Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 8 |  | 
| Gilles Peskine | c761d8f | 2021-09-20 18:57:55 +0200 | [diff] [blame] | 9 | # Set this to -v to see the details of failing test cases | 
|  | 10 | TEST_FLAGS ?= $(if $(filter-out 0 OFF Off off NO No no FALSE False false N n,$(CTEST_OUTPUT_ON_FAILURE)),-v,) | 
|  | 11 |  | 
| Gilles Peskine | 76dd3aa | 2020-07-02 15:58:37 +0200 | [diff] [blame] | 12 | # Include public header files from ../include, test-specific header files | 
|  | 13 | # from ./include, and private header files (used by some invasive tests) | 
|  | 14 | # from ../library. | 
| Ronald Cron | 02c78b7 | 2020-05-27 09:22:32 +0200 | [diff] [blame] | 15 | LOCAL_CFLAGS = $(WARNING_CFLAGS) -I./include -I../include -I../library -D_FILE_OFFSET_BITS=64 | 
| Mohammad Azim Khan | 94aefaf | 2017-03-23 12:32:54 +0000 | [diff] [blame] | 16 | LOCAL_LDFLAGS = -L../library			\ | 
| Gilles Peskine | 4fa9f9f | 2020-02-26 19:05:31 +0100 | [diff] [blame] | 17 | -lmbedtls$(SHARED_SUFFIX)	\ | 
|  | 18 | -lmbedx509$(SHARED_SUFFIX)	\ | 
| Manuel Pégourié-Gonnard | 21e1ac2 | 2015-06-25 08:45:12 +0200 | [diff] [blame] | 19 | -lmbedcrypto$(SHARED_SUFFIX) | 
| Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 20 |  | 
| Christoph M. Wintersteiger | 6ea2dea1 | 2019-01-21 17:26:19 +0000 | [diff] [blame] | 21 | include ../3rdparty/Makefile.inc | 
|  | 22 | LOCAL_CFLAGS+=$(THIRDPARTY_INCLUDES) | 
| Christoph M. Wintersteiger | d5fd766 | 2018-10-25 12:47:03 +0100 | [diff] [blame] | 23 |  | 
| Nicholas Wilson | 61fa436 | 2018-06-25 12:10:00 +0100 | [diff] [blame] | 24 | # Enable definition of various functions used throughout the testsuite | 
|  | 25 | # (gethostname, strdup, fileno...) even when compiling with -std=c99. Harmless | 
|  | 26 | # on non-POSIX platforms. | 
|  | 27 | LOCAL_CFLAGS += -D_POSIX_C_SOURCE=200809L | 
|  | 28 |  | 
| Paul Bakker | 674e0b0 | 2014-03-26 13:26:52 +0100 | [diff] [blame] | 29 | ifndef SHARED | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 30 | MBEDLIBS=../library/libmbedcrypto.a ../library/libmbedx509.a ../library/libmbedtls.a | 
| Paul Bakker | 674e0b0 | 2014-03-26 13:26:52 +0100 | [diff] [blame] | 31 | else | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 32 | MBEDLIBS=../library/libmbedcrypto.$(DLEXT) ../library/libmbedx509.$(DLEXT) ../library/libmbedtls.$(DLEXT) | 
| Paul Bakker | 674e0b0 | 2014-03-26 13:26:52 +0100 | [diff] [blame] | 33 | endif | 
|  | 34 |  | 
| Paul Bakker | c7ffd36 | 2012-04-05 12:08:29 +0000 | [diff] [blame] | 35 | ifdef DEBUG | 
| Alon Bar-Lev | f7a9f30 | 2015-02-18 17:55:05 +0200 | [diff] [blame] | 36 | LOCAL_CFLAGS += -g3 | 
| Paul Bakker | c7ffd36 | 2012-04-05 12:08:29 +0000 | [diff] [blame] | 37 | endif | 
|  | 38 |  | 
| Gilles Peskine | 5168155 | 2019-05-20 19:35:37 +0200 | [diff] [blame] | 39 | ifdef RECORD_PSA_STATUS_COVERAGE_LOG | 
|  | 40 | LOCAL_CFLAGS += -Werror -DRECORD_PSA_STATUS_COVERAGE_LOG | 
|  | 41 | endif | 
|  | 42 |  | 
| Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 43 | # if we're running on Windows, build for Windows | 
| Paul Bakker | cd5b529 | 2012-05-10 20:49:10 +0000 | [diff] [blame] | 44 | ifdef WINDOWS | 
| Alon Bar-Lev | 18ba0cc | 2015-02-14 01:04:58 +0200 | [diff] [blame] | 45 | WINDOWS_BUILD=1 | 
|  | 46 | endif | 
|  | 47 |  | 
|  | 48 | ifdef WINDOWS_BUILD | 
|  | 49 | DLEXT=dll | 
|  | 50 | EXEXT=.exe | 
| Alon Bar-Lev | ada4105 | 2015-02-18 17:47:52 +0200 | [diff] [blame] | 51 | LOCAL_LDFLAGS += -lws2_32 | 
| Alon Bar-Lev | 18ba0cc | 2015-02-14 01:04:58 +0200 | [diff] [blame] | 52 | ifdef SHARED | 
|  | 53 | SHARED_SUFFIX=.$(DLEXT) | 
|  | 54 | endif | 
| Manuel Pégourié-Gonnard | 8d4a613 | 2015-06-24 12:16:20 +0200 | [diff] [blame] | 55 | else | 
| Andres Amaya Garcia | 420f0cc | 2018-03-27 19:17:21 +0100 | [diff] [blame] | 56 | DLEXT ?= so | 
| Manuel Pégourié-Gonnard | 8d4a613 | 2015-06-24 12:16:20 +0200 | [diff] [blame] | 57 | EXEXT= | 
|  | 58 | SHARED_SUFFIX= | 
| Gilles Peskine | cdd80c4 | 2021-07-13 18:14:25 +0200 | [diff] [blame] | 59 | endif | 
|  | 60 |  | 
|  | 61 | ifdef WINDOWS | 
|  | 62 | PYTHON ?= python | 
|  | 63 | else | 
| Gilles Peskine | 6b0f911 | 2021-04-22 00:21:58 +0200 | [diff] [blame] | 64 | PYTHON ?= $(shell if type python3 >/dev/null 2>/dev/null; then echo python3; else echo python; fi) | 
| Paul Bakker | cd5b529 | 2012-05-10 20:49:10 +0000 | [diff] [blame] | 65 | endif | 
|  | 66 |  | 
| Gilles Peskine | 5bb8bec | 2020-02-26 19:11:43 +0100 | [diff] [blame] | 67 | # Zlib shared library extensions: | 
|  | 68 | ifdef ZLIB | 
|  | 69 | LOCAL_LDFLAGS += -lz | 
|  | 70 | endif | 
|  | 71 |  | 
| Azim Khan | 27a35e7 | 2018-06-29 12:39:19 +0100 | [diff] [blame] | 72 | # A test application is built for each suites/test_suite_*.data file. | 
|  | 73 | # Application name is same as .data file's base name and can be | 
|  | 74 | # constructed by stripping path 'suites/' and extension .data. | 
|  | 75 | APPS = $(basename $(subst suites/,,$(wildcard suites/test_suite_*.data))) | 
| Mohammad Azim Khan | 94aefaf | 2017-03-23 12:32:54 +0000 | [diff] [blame] | 76 |  | 
| Azim Khan | 27a35e7 | 2018-06-29 12:39:19 +0100 | [diff] [blame] | 77 | # Construct executable name by adding OS specific suffix $(EXEXT). | 
| Mohammad Azim Khan | 94aefaf | 2017-03-23 12:32:54 +0000 | [diff] [blame] | 78 | BINARIES := $(addsuffix $(EXEXT),$(APPS)) | 
|  | 79 |  | 
| Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 80 | .SILENT: | 
|  | 81 |  | 
| Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 82 | .PHONY: all check test clean | 
|  | 83 |  | 
| Azim Khan | 1de892b | 2017-06-09 15:02:36 +0100 | [diff] [blame] | 84 | all: $(BINARIES) | 
|  | 85 |  | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 86 | $(MBEDLIBS): | 
| Manuel Pégourié-Gonnard | fc36708 | 2015-06-26 16:50:24 +0200 | [diff] [blame] | 87 | $(MAKE) -C ../library | 
| Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 88 |  | 
| Steven Cooreman | a70d588 | 2020-07-16 20:26:18 +0200 | [diff] [blame] | 89 | MBEDTLS_TEST_OBJS=$(patsubst %.c,%.o,$(wildcard src/*.c src/drivers/*.c)) | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 90 |  | 
| Ronald Cron | ddaf99c | 2020-06-19 11:27:26 +0200 | [diff] [blame] | 91 | mbedtls_test: $(MBEDTLS_TEST_OBJS) | 
|  | 92 |  | 
| Gilles Peskine | e1d51bd | 2021-01-20 19:47:23 +0100 | [diff] [blame] | 93 | TEST_OBJS_DEPS = $(wildcard include/test/*.h include/test/*/*.h) | 
| Gilles Peskine | d71539f | 2020-11-25 18:17:17 +0100 | [diff] [blame] | 94 | ifdef RECORD_PSA_STATUS_COVERAGE_LOG | 
| Gilles Peskine | 75829a4 | 2021-01-25 13:46:14 +0100 | [diff] [blame] | 95 | # Explicitly depend on this header because on a clean copy of the source tree, | 
|  | 96 | # it doesn't exist yet and must be generated as part of the build, and | 
|  | 97 | # therefore the wildcard enumeration above doesn't include it. | 
| Gilles Peskine | d71539f | 2020-11-25 18:17:17 +0100 | [diff] [blame] | 98 | TEST_OBJS_DEPS += include/test/instrument_record_status.h | 
|  | 99 | endif | 
|  | 100 |  | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 101 | # Rule to compile common test C files in src folder | 
| Gilles Peskine | d71539f | 2020-11-25 18:17:17 +0100 | [diff] [blame] | 102 | src/%.o : src/%.c $(TEST_OBJS_DEPS) | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 103 | echo "  CC    $<" | 
|  | 104 | $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $@ -c $< | 
|  | 105 |  | 
| Steven Cooreman | a70d588 | 2020-07-16 20:26:18 +0200 | [diff] [blame] | 106 | src/drivers/%.o : src/drivers/%.c | 
|  | 107 | echo "  CC    $<" | 
|  | 108 | $(CC) $(LOCAL_CFLAGS) $(CFLAGS) -o $@ -c $< | 
|  | 109 |  | 
| Mohammad Azim Khan | 94aefaf | 2017-03-23 12:32:54 +0000 | [diff] [blame] | 110 | C_FILES := $(addsuffix .c,$(APPS)) | 
|  | 111 |  | 
| Azim Khan | 27a35e7 | 2018-06-29 12:39:19 +0100 | [diff] [blame] | 112 | # Wildcard target for test code generation: | 
|  | 113 | # A .c file is generated for each .data file in the suites/ directory. Each .c | 
|  | 114 | # file depends on a .data and .function file from suites/ directory. Following | 
|  | 115 | # nameing convention is followed: | 
|  | 116 | # | 
|  | 117 | #     C file        |        Depends on | 
|  | 118 | #----------------------------------------------------------------------------- | 
|  | 119 | #  foo.c            | suites/foo.function suites/foo.data | 
|  | 120 | #  foo.bar.c        | suites/foo.function suites/foo.bar.data | 
|  | 121 | # | 
|  | 122 | # Note above that .c and .data files have same base name. | 
|  | 123 | # However, corresponding .function file's base name is the word before first | 
|  | 124 | # dot in .c file's base name. | 
|  | 125 | # | 
| Mohammad Azim Khan | 94aefaf | 2017-03-23 12:32:54 +0000 | [diff] [blame] | 126 | .SECONDEXPANSION: | 
| Azim Khan | 27a35e7 | 2018-06-29 12:39:19 +0100 | [diff] [blame] | 127 | %.c: suites/$$(firstword $$(subst ., ,$$*)).function suites/%.data scripts/generate_test_code.py suites/helpers.function suites/main_test.function suites/host_test.function | 
| Manuel Pégourié-Gonnard | 78ec2b0 | 2015-07-08 22:12:06 +0100 | [diff] [blame] | 128 | echo "  Gen   $@" | 
| Azim Khan | 27a35e7 | 2018-06-29 12:39:19 +0100 | [diff] [blame] | 129 | $(PYTHON) scripts/generate_test_code.py -f suites/$(firstword $(subst ., ,$*)).function \ | 
| Mohammad Azim Khan | fff4904 | 2017-03-28 01:48:31 +0100 | [diff] [blame] | 130 | -d suites/$*.data \ | 
| Azim Khan | 1de892b | 2017-06-09 15:02:36 +0100 | [diff] [blame] | 131 | -t suites/main_test.function \ | 
| Mohammad Azim Khan | 9540261 | 2017-07-19 10:15:54 +0100 | [diff] [blame] | 132 | -p suites/host_test.function \ | 
| Mohammad Azim Khan | fff4904 | 2017-03-28 01:48:31 +0100 | [diff] [blame] | 133 | -s suites  \ | 
| Azim Khan | e3b26af | 2018-06-29 02:36:57 +0100 | [diff] [blame] | 134 | --helpers-file suites/helpers.function \ | 
| Mohammad Azim Khan | fff4904 | 2017-03-28 01:48:31 +0100 | [diff] [blame] | 135 | -o . | 
| Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 136 |  | 
| Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 137 |  | 
| Gilles Peskine | d71539f | 2020-11-25 18:17:17 +0100 | [diff] [blame] | 138 | $(BINARIES): %$(EXEXT): %.c $(MBEDLIBS) $(TEST_OBJS_DEPS) $(MBEDTLS_TEST_OBJS) | 
| Manuel Pégourié-Gonnard | 78ec2b0 | 2015-07-08 22:12:06 +0100 | [diff] [blame] | 139 | echo "  CC    $<" | 
| Ronald Cron | f5ea29a | 2020-06-19 10:42:29 +0200 | [diff] [blame] | 140 | $(CC) $(LOCAL_CFLAGS) $(CFLAGS) $< $(MBEDTLS_TEST_OBJS) $(LOCAL_LDFLAGS) $(LDFLAGS) -o $@ | 
| Paul Bakker | 286bf3c | 2013-04-08 18:09:51 +0200 | [diff] [blame] | 141 |  | 
| Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 142 | clean: | 
| Paul Bakker | 62f88dc | 2012-05-10 21:26:28 +0000 | [diff] [blame] | 143 | ifndef WINDOWS | 
| Gilles Peskine | ff8c80a | 2021-09-14 11:28:22 +0200 | [diff] [blame] | 144 | rm -rf $(BINARIES) *.c *.datax | 
| Steven Cooreman | a70d588 | 2020-07-16 20:26:18 +0200 | [diff] [blame] | 145 | rm -f src/*.o src/drivers/*.o src/libmbed* | 
| Gilles Peskine | d71539f | 2020-11-25 18:17:17 +0100 | [diff] [blame] | 146 | rm -f include/test/instrument_record_status.h | 
| Ronald Cron | df885c0 | 2021-04-28 18:29:24 +0200 | [diff] [blame^] | 147 | rm -rf libtestdriver1 | 
| Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 148 | else | 
| Darryl Green | 6c0f94c | 2018-10-17 16:12:33 +0100 | [diff] [blame] | 149 | if exist *.c del /Q /F *.c | 
|  | 150 | if exist *.exe del /Q /F *.exe | 
|  | 151 | if exist *.datax del /Q /F *.datax | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 152 | if exist src/*.o del /Q /F src/*.o | 
| Steven Cooreman | a70d588 | 2020-07-16 20:26:18 +0200 | [diff] [blame] | 153 | if exist src/drivers/*.o del /Q /F src/drivers/*.o | 
| Ronald Cron | b6d6d4c | 2020-06-03 10:11:18 +0200 | [diff] [blame] | 154 | if exist src/libmbed* del /Q /F src/libmed* | 
| Gilles Peskine | d71539f | 2020-11-25 18:17:17 +0100 | [diff] [blame] | 155 | if exist include/test/instrument_record_status.h del /Q /F include/test/instrument_record_status.h | 
| Azim Khan | 27a35e7 | 2018-06-29 12:39:19 +0100 | [diff] [blame] | 156 | endif | 
| Paul Bakker | 0049c2f | 2009-07-11 19:15:43 +0000 | [diff] [blame] | 157 |  | 
| Gilles Peskine | ac372cc | 2018-11-29 10:15:06 +0000 | [diff] [blame] | 158 | # Test suites caught by SKIP_TEST_SUITES are built but not executed. | 
| Mohammad Azim Khan | 94aefaf | 2017-03-23 12:32:54 +0000 | [diff] [blame] | 159 | check: $(BINARIES) | 
| Gilles Peskine | c761d8f | 2021-09-20 18:57:55 +0200 | [diff] [blame] | 160 | perl scripts/run-test-suites.pl $(TEST_FLAGS) --skip=$(SKIP_TEST_SUITES) | 
| Manuel Pégourié-Gonnard | 5c59a4f | 2015-06-24 13:06:24 +0200 | [diff] [blame] | 161 |  | 
|  | 162 | test: check | 
| Mohammad Azim Khan | 1f29be7 | 2017-03-20 22:21:22 +0000 | [diff] [blame] | 163 |  | 
| Ronald Cron | df885c0 | 2021-04-28 18:29:24 +0200 | [diff] [blame^] | 164 | # Generate test library | 
|  | 165 |  | 
|  | 166 | # Perl code that is executed to transform each original line from a library | 
|  | 167 | # source file into the corresponding line in the test driver copy of the | 
|  | 168 | # library. Add a LIBTESTDRIVER1_/libtestdriver1_ to mbedtls_xxx and psa_xxx | 
|  | 169 | # symbols. | 
|  | 170 | define libtestdriver1_rewrite := | 
|  | 171 | s!^(\s*#\s*include\s*[\"<])(mbedtls|psa)/!$${1}libtestdriver1/include/$${2}/!; \ | 
|  | 172 | next if /^\s*#\s*include/; \ | 
|  | 173 | s/\b(?=MBEDTLS_|PSA_)/LIBTESTDRIVER1_/g; \ | 
|  | 174 | s/\b(?=mbedtls_|psa_)/libtestdriver1_/g; | 
|  | 175 | endef | 
|  | 176 |  | 
|  | 177 | libtestdriver1.a: | 
|  | 178 | # Copy the library and fake a 3rdparty Makefile include. | 
|  | 179 | rm -Rf ./libtestdriver1 | 
|  | 180 | mkdir ./libtestdriver1 | 
|  | 181 | cp -Rf ../library ./libtestdriver1 | 
|  | 182 | cp -Rf ../include ./libtestdriver1 | 
|  | 183 | mkdir ./libtestdriver1/3rdparty | 
|  | 184 | touch ./libtestdriver1/3rdparty/Makefile.inc | 
|  | 185 |  | 
|  | 186 | # Set the test driver base (minimal) configuration. | 
|  | 187 | cp ./include/test/drivers/config_test_driver.h ./libtestdriver1/include/mbedtls/config.h | 
|  | 188 |  | 
|  | 189 | # Set the PSA cryptography configuration for the test library. | 
|  | 190 | # It is set from the copied include/psa/crypto_config.h of the Mbed TLS | 
|  | 191 | # library the test library is intended to be linked with extended by | 
|  | 192 | # ./include/test/drivers/crypto_config_test_driver_extension.h to | 
|  | 193 | # mirror the PSA_ACCEL_* macros. | 
|  | 194 | mv ./libtestdriver1/include/psa/crypto_config.h ./libtestdriver1/include/psa/crypto_config.h.bak | 
|  | 195 | head -n -1 ./libtestdriver1/include/psa/crypto_config.h.bak > ./libtestdriver1/include/psa/crypto_config.h | 
|  | 196 | cat ./include/test/drivers/crypto_config_test_driver_extension.h >> ./libtestdriver1/include/psa/crypto_config.h | 
|  | 197 | echo "#endif /* PSA_CRYPTO_CONFIG_H */" >> ./libtestdriver1/include/psa/crypto_config.h | 
|  | 198 |  | 
|  | 199 | # Prefix MBEDTLS_* PSA_* symbols with LIBTESTDRIVER1_ as well as | 
|  | 200 | # mbedtls_* psa_* symbols with libtestdriver1_ to avoid symbol clash | 
|  | 201 | # when this test driver library is linked with the Mbed TLS library. | 
|  | 202 | perl -pi -e '$(libtestdriver1_rewrite)' ./libtestdriver1/library/*.[ch] | 
|  | 203 | perl -pi -e '$(libtestdriver1_rewrite)' ./libtestdriver1/include/*/*.h | 
|  | 204 |  | 
|  | 205 | $(MAKE) -C ./libtestdriver1/library CFLAGS="-I../../ $(CFLAGS)" LDFLAGS="$(LDFLAGS)" libmbedcrypto.a | 
|  | 206 | cp ./libtestdriver1/library/libmbedcrypto.a ../library/libtestdriver1.a | 
|  | 207 |  | 
| Gilles Peskine | 5168155 | 2019-05-20 19:35:37 +0200 | [diff] [blame] | 208 | ifdef RECORD_PSA_STATUS_COVERAGE_LOG | 
| Ronald Cron | 02c78b7 | 2020-05-27 09:22:32 +0200 | [diff] [blame] | 209 | include/test/instrument_record_status.h: ../include/psa/crypto.h Makefile | 
| Gilles Peskine | d71539f | 2020-11-25 18:17:17 +0100 | [diff] [blame] | 210 | echo "  Gen  $@" | 
| Gilles Peskine | 5168155 | 2019-05-20 19:35:37 +0200 | [diff] [blame] | 211 | sed <../include/psa/crypto.h >$@ -n 's/^psa_status_t \([A-Za-z0-9_]*\)(.*/#define \1(...) RECORD_STATUS("\1", \1(__VA_ARGS__))/p' | 
|  | 212 | endif |