Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame] | 1 | -include Makefile.am.libasncodec |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 2 | |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 3 | TARGET = rrc-dump |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame] | 4 | ASN_LIBRARY=libasncodec.a |
Lev Walkin | 9dc9f67 | 2017-09-12 23:29:20 -0700 | [diff] [blame] | 5 | LIBS += -lm |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame] | 6 | CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE $(ASN_MODULE_CFLAGS) -DPDU=DL_DCCH_Message -DASN_PDU_COLLECTION -I. |
| 7 | ASN_CONVERTER_SOURCES := \ |
| 8 | converter-example.c\ |
| 9 | pdu_collection.c |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 10 | |
Lev Walkin | eb00dfa | 2017-08-25 12:55:10 -0700 | [diff] [blame] | 11 | all: maybe-wip-pause DL-DCCH-Message.c $(TARGET) |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 12 | |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame] | 13 | $(TARGET): $(ASN_LIBRARY) $(ASN_CONVERTER_SOURCES:.c=.o) |
| 14 | $(CC) $(CFLAGS) $(CPPFLAGS) -o $(TARGET) $(ASN_CONVERTER_SOURCES:.c=.o) $(LDFLAGS) $(ASN_LIBRARY) $(LIBS) |
| 15 | |
| 16 | $(ASN_LIBRARY): $(ASN_MODULE_SOURCES:.c=.o) |
| 17 | $(AR) rcs $@ $^ |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 18 | |
| 19 | .SUFFIXES: |
| 20 | .SUFFIXES: .c .o |
| 21 | |
| 22 | .c.o: |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame] | 23 | $(CC) $(CFLAGS) -o $@ -c $< |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 24 | |
| 25 | clean: |
Lev Walkin | ad77591 | 2017-09-26 22:55:22 -0700 | [diff] [blame] | 26 | rm -f $(TARGET) $(ASN_LIBRARY) |
| 27 | rm -f $(ASN_MODULE_SOURCES:.c=.o) $(ASN_CONVERTER_SOURCES:.c=.o) |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 28 | |
| 29 | regen: regenerate-from-asn1-source |
| 30 | |
| 31 | regenerate-from-asn1-source: |
Lev Walkin | 101c26d | 2013-04-07 01:37:43 -0700 | [diff] [blame] | 32 | ../../asn1c/asn1c -S ../../skeletons -pdu=DL-DCCH-Message -pdu=auto -fcompound-names -gen-PER ../rrc-7.1.0.asn1 |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 33 | |
| 34 | |
Lev Walkin | 101c26d | 2013-04-07 01:37:43 -0700 | [diff] [blame] | 35 | DL-DCCH-Message.c: ../sample.makefile.regen ../rrc-7.1.0.asn1 |
Lev Walkin | cc7c94e | 2006-09-17 04:01:29 +0000 | [diff] [blame] | 36 | make regen-makefile |
| 37 | @touch DL-DCCH-Message.c |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 38 | make |
| 39 | |
Lev Walkin | cc7c94e | 2006-09-17 04:01:29 +0000 | [diff] [blame] | 40 | regen-makefile: |
Lev Walkin | 66adab4 | 2006-09-23 02:52:12 +0000 | [diff] [blame] | 41 | ASN1CMDOPTS="-pdu=auto -fcompound-names -gen-PER" \ |
Lev Walkin | 101c26d | 2013-04-07 01:37:43 -0700 | [diff] [blame] | 42 | ASN1MODULES="../rrc-7.1.0.asn1" \ |
Lev Walkin | cc7c94e | 2006-09-17 04:01:29 +0000 | [diff] [blame] | 43 | ASN1PDU=DL-DCCH-Message \ |
| 44 | PROGNAME=rrc-dump \ |
| 45 | ../sample.makefile.regen |
| 46 | |
Lev Walkin | 9dc9f67 | 2017-09-12 23:29:20 -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 | 0091881 | 2006-09-18 21:19:32 +0000 | [diff] [blame] | 53 | @if test -f sample-DL-DCCH-Message-1.[db]er ; then \ |
Lev Walkin | a926fce | 2017-08-27 12:54:25 -0700 | [diff] [blame] | 54 | for f in sample-*-*.[db]er; do \ |
Lev Walkin | 9dc9f67 | 2017-09-12 23:29:20 -0700 | [diff] [blame] | 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 | a926fce | 2017-08-27 12:54:25 -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 | 08b30bb | 2007-06-26 08:24:50 +0000 | [diff] [blame] | 60 | diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \ |
Lev Walkin | bc69177 | 2006-09-17 11:02:53 +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 | a926fce | 2017-08-27 12:54:25 -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 | 0091881 | 2006-09-18 21:19:32 +0000 | [diff] [blame] | 68 | @if test -f sample-DL-DCCH-Message-1.xer ; then \ |
Lev Walkin | a926fce | 2017-08-27 12:54:25 -0700 | [diff] [blame] | 69 | for f in sample-*-*.xer; do \ |
Lev Walkin | 9dc9f67 | 2017-09-12 23:29:20 -0700 | [diff] [blame] | 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 | a926fce | 2017-08-27 12:54:25 -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 | 08b30bb | 2007-06-26 08:24:50 +0000 | [diff] [blame] | 75 | diff $$f ./.tmp.2.$$$$ || exit 4; \ |
Lev Walkin | bc69177 | 2006-09-17 11:02:53 +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 | a926fce | 2017-08-27 12:54:25 -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; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 80 | done; done; fi |
Lev Walkin | 1f12da4 | 2006-09-24 19:47:07 +0000 | [diff] [blame] | 81 | |
Lev Walkin | 9dc9f67 | 2017-09-12 23:29:20 -0700 | [diff] [blame] | 82 | check-oer: |
| 83 | @if test -f sample-DL-DCCH-Message-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/"`; \ |
Lev Walkin | 13afe53 | 2006-09-18 21:30:04 +0000 | [diff] [blame] | 86 | for b in 1 17 33 980 8192; do \ |
Lev Walkin | 9dc9f67 | 2017-09-12 23:29:20 -0700 | [diff] [blame] | 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 | 9dc9f67 | 2017-09-12 23:29:20 -0700 | [diff] [blame] | 96 | |
| 97 | check-per: |
Lev Walkin | 2f18608 | 2017-09-13 00:57:59 -0700 | [diff] [blame] | 98 | @if test -f sample-DL-DCCH-Message-1-nopad.per ; then \ |
| 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/"`; \ |
| 101 | for b in 1 17 33 980 8192; do \ |
| 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; \ |
| 106 | diff ./.tmp.1.$$$$ ./.tmp.3.$$$$ || exit 5; \ |
| 107 | rm -f ./.tmp.[123].$$$$; \ |
| 108 | echo "Test junking $$f (please wait)..."; \ |
| 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; \ |
| 111 | done; done; fi |
Lev Walkin | 08b30bb | 2007-06-26 08:24:50 +0000 | [diff] [blame] | 112 | @if test -f sample-DL-DCCH-Message-1.per ; then \ |
| 113 | for f in sample-*-[1-9].per; do \ |
Lev Walkin | 9dc9f67 | 2017-09-12 23:29:20 -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 | a926fce | 2017-08-27 12:54:25 -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 | 08b30bb | 2007-06-26 08:24:50 +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 | a926fce | 2017-08-27 12:54:25 -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 | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 126 | |
Lev Walkin | eb00dfa | 2017-08-25 12:55:10 -0700 | [diff] [blame] | 127 | maybe-wip-pause: |
| 128 | @if [ -f WIP ]; then cat WIP; sleep 2; fi |
| 129 | |
Lev Walkin | 48f3365 | 2006-09-17 03:27:57 +0000 | [diff] [blame] | 130 | distclean: clean |
| 131 | rm -f $(ASN_MODULE_SOURCES) |
| 132 | rm -f $(ASN_MODULE_HEADERS) |
| 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 |