Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 1 | -include Makefile.am.libasncodec |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 2 | |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 3 | TARGET = tap3dump |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 4 | ASN_LIBRARY=libasncodec.a |
| 5 | LIBS += -lm |
| 6 | CFLAGS += -DASN_CONVERTER_TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE $(ASN_MODULE_CFLAGS) -DPDU=DataInterChange -I. |
| 7 | ASN_CONVERTER_SOURCES := \ |
| 8 | converter-example.c |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 9 | |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 10 | all: maybe-wip-pause DataInterChange.c $(TARGET) |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 11 | |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 12 | $(TARGET): $(ASN_LIBRARY) $(ASN_CONVERTER_SOURCES:.c=.o) |
| 13 | $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TARGET) $(ASN_CONVERTER_SOURCES:.c=.o) $(LDFLAGS) $(ASN_LIBRARY) $(LIBS) |
| 14 | |
| 15 | $(ASN_LIBRARY): $(ASN_MODULE_SOURCES:.c=.o) |
| 16 | $(AR) rcs $@ $^ |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 17 | |
| 18 | .SUFFIXES: |
| 19 | .SUFFIXES: .c .o |
| 20 | |
| 21 | .c.o: |
| 22 | $(CC) $(CFLAGS) -o $@ -c $< |
| 23 | |
| 24 | clean: |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 25 | rm -f $(TARGET) $(ASN_LIBRARY) |
| 26 | rm -f $(ASN_MODULE_SOURCES:.c=.o) $(ASN_CONVERTER_SOURCES:.c=.o) |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 27 | |
| 28 | regen: regenerate-from-asn1-source |
| 29 | |
| 30 | regenerate-from-asn1-source: |
Lev Walkin | 46a6bd2 | 2007-06-26 08:36:39 +0000 | [diff] [blame] | 31 | ../../asn1c/asn1c -S ../../skeletons -pdu=DataInterChange ../tap3.asn1 |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 32 | |
| 33 | |
Lev Walkin | c33a59e | 2006-09-18 20:04:14 +0000 | [diff] [blame] | 34 | DataInterChange.c: ../sample.makefile.regen ../tap3.asn1 |
Lev Walkin | cc7c94e | 2006-09-17 04:01:29 +0000 | [diff] [blame] | 35 | make regen-makefile |
| 36 | @touch DataInterChange.c |
| 37 | make |
| 38 | |
| 39 | regen-makefile: |
Lev Walkin | 5aef2c5 | 2007-06-29 12:46:06 +0000 | [diff] [blame] | 40 | TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" \ |
Lev Walkin | f5b4939 | 2006-09-12 06:19:15 +0000 | [diff] [blame] | 41 | ASN1CMDOPTS="" \ |
| 42 | ASN1MODULES="../tap3.asn1" \ |
| 43 | ASN1PDU=DataInterChange \ |
| 44 | PROGNAME=tap3dump \ |
Lev Walkin | 2fd86de | 2006-09-13 02:10:23 +0000 | [diff] [blame] | 45 | ../sample.makefile.regen |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 46 | |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 47 | check: ${TARGET} check-ber check-xer check-oer check-per |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 48 | @echo ================ |
| 49 | @echo All tests passed |
| 50 | @echo ================ |
| 51 | |
| 52 | check-ber: |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 53 | @if test -f sample-DataInterChange-1.[db]er ; then \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 54 | for f in sample-*-*.[db]er; do \ |
| 55 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 56 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 57 | echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \ |
| 58 | ./${TARGET} -p $$pdu -b $$b -iber -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 59 | ./${TARGET} -p $$pdu -b $$b -ixer -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
Lev Walkin | 46a6bd2 | 2007-06-26 08:36:39 +0000 | [diff] [blame] | 60 | diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ |
Lev Walkin | c33a59e | 2006-09-18 20:04:14 +0000 | [diff] [blame] | 61 | rm -f ./.tmp.[12].$$$$; \ |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 62 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 63 | ./${TARGET} -J0.0001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 5; \ |
| 64 | ./${TARGET} -J0.001 -n 1000 -p $$pdu -b $$b -iber -onull $$f || exit 6; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 65 | done; done; fi |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 66 | |
| 67 | check-xer: |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 68 | @if test -f sample-DataInterChange-1.xer ; then \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 69 | for f in sample-*-*.xer; do \ |
| 70 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 71 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 72 | echo "Recoding $$f ($$pdu) into DER and back ($$b)..."; \ |
| 73 | ./${TARGET} -p $$pdu -b $$b -ixer -oder $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 74 | ./${TARGET} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
Lev Walkin | 46a6bd2 | 2007-06-26 08:36:39 +0000 | [diff] [blame] | 75 | diff $$f ./.tmp.2.$$$$ || exit 4; \ |
Lev Walkin | c33a59e | 2006-09-18 20:04:14 +0000 | [diff] [blame] | 76 | rm -f ./.tmp.[12].$$$$; \ |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 77 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 78 | ./${TARGET} -J0.0001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 5; \ |
| 79 | ./${TARGET} -J0.001 -n 1000 -p $$pdu -b $$b -ixer -onull $$f || exit 6; \ |
| 80 | done; done; fi |
| 81 | |
| 82 | check-oer: |
| 83 | @if test -f sample-DataInterChange-1.*oer ; then \ |
| 84 | for f in sample-*-*.*oer; do \ |
| 85 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
| 86 | for b in 1 17 33 980 8192; do \ |
| 87 | echo "Recoding $$f ($$pdu) into XER and back ($$b)..."; \ |
| 88 | ./${TARGET} -p $$pdu -b $$b -ioer -oxer $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 89 | ./${TARGET} -p $$pdu -b $$b -ixer -ooer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
| 90 | diff $$f ./.tmp.2.$$$$ || exit 4; \ |
| 91 | rm -f ./.tmp.[12].$$$$; \ |
| 92 | echo "Test junking $$f (please wait) ($$b) ..."; \ |
| 93 | ./${TARGET} -J0.0001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 5; \ |
| 94 | ./${TARGET} -J0.001 -n 1000 -p $$pdu -b $$b -ioer -onull $$f || exit 6; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 95 | done; done; fi |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 96 | |
| 97 | check-per: |
Lev Walkin | 46a6bd2 | 2007-06-26 08:36:39 +0000 | [diff] [blame] | 98 | @if test -f sample-DataInterChange-1-nopad.per ; then \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 99 | for f in sample-*-[1-9]-nopad.per; do \ |
| 100 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 101 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 102 | echo "Recoding non-padded $$f ($$pdu) into DER into XER and back ($$b)..."; \ |
| 103 | ./${TARGET} -p $$pdu -b $$b -per-nopad -iper -oder $$f > ./.tmp.1.$$$$ || exit 2; \ |
| 104 | ./${TARGET} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 3; \ |
| 105 | ./${TARGET} -p $$pdu -b $$b -ixer -oder ./.tmp.2.$$$$ > ./.tmp.3.$$$$ || exit 4; \ |
Lev Walkin | 46a6bd2 | 2007-06-26 08:36:39 +0000 | [diff] [blame] | 106 | diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 107 | rm -f ./.tmp.[123].$$$$; \ |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 108 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 109 | ./${TARGET} -J0.0001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 6; \ |
| 110 | ./${TARGET} -J0.001 -n 1000 -p $$pdu -b $$b -per-nopad -iper -onull $$f || exit 7; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 111 | done; done; fi |
Lev Walkin | 46a6bd2 | 2007-06-26 08:36:39 +0000 | [diff] [blame] | 112 | @if test -f sample-DataInterChange-1.per ; then \ |
| 113 | for f in sample-*-[1-9].per; do \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 114 | pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 115 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 116 | echo "Recoding $$f ($$pdu) into DER into XER and back ($$b)..."; \ |
| 117 | ./${TARGET} -p $$pdu -b $$b -iper -oder $$f > ./.tmp.1.$$$$ || exit 3; \ |
| 118 | ./${TARGET} -p $$pdu -b $$b -iber -oxer ./.tmp.1.$$$$ > ./.tmp.2.$$$$ || exit 4; \ |
| 119 | ./${TARGET} -p $$pdu -b $$b -ixer -oper ./.tmp.2.$$$$ > ./.tmp.1.$$$$ || exit 5; \ |
Lev Walkin | 46a6bd2 | 2007-06-26 08:36:39 +0000 | [diff] [blame] | 120 | diff $$f ./.tmp.1.$$$$ || exit 6; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 121 | rm -f ./.tmp.[12].$$$$; \ |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 122 | echo "Test junking $$f (please wait)..."; \ |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 123 | ./${TARGET} -J0.0001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 7; \ |
| 124 | ./${TARGET} -J0.001 -n 1000 -p $$pdu -b $$b -iper -onull $$f || exit 8; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 125 | done; done; fi |
Lev Walkin | afda1a5 | 2006-09-15 18:37:21 +0000 | [diff] [blame] | 126 | |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 127 | maybe-wip-pause: |
| 128 | @if [ -f WIP ]; then cat WIP; sleep 2; fi |
| 129 | |
Lev Walkin | 3f12bc0 | 2005-03-10 15:09:02 +0000 | [diff] [blame] | 130 | distclean: clean |
Lev Walkin | bcda5ff | 2006-09-17 03:29:51 +0000 | [diff] [blame] | 131 | rm -f $(ASN_MODULE_SOURCES) |
| 132 | rm -f $(ASN_MODULE_HEADERS) |
Lev Walkin | f5b4939 | 2006-09-12 06:19:15 +0000 | [diff] [blame] | 133 | rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS) |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame^] | 134 | rm -f Makefile.am.example |