blob: ae911c09b0473034e54fd57bd61916e3ad8b2216 [file] [log] [blame]
Lev Walkinad775912017-09-26 22:55:22 -07001-include Makefile.am.libasncodec
Lev Walkin48f33652006-09-17 03:27:57 +00002
Lev Walkin48f33652006-09-17 03:27:57 +00003TARGET = rrc-dump
Lev Walkinad775912017-09-26 22:55:22 -07004ASN_LIBRARY=libasncodec.a
Lev Walkin9dc9f672017-09-12 23:29:20 -07005LIBS += -lm
Lev Walkinad775912017-09-26 22:55:22 -07006CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE $(ASN_MODULE_CFLAGS) -DPDU=DL_DCCH_Message -DASN_PDU_COLLECTION -I.
7ASN_CONVERTER_SOURCES := \
8 converter-example.c\
9 pdu_collection.c
Lev Walkin48f33652006-09-17 03:27:57 +000010
Lev Walkineb00dfa2017-08-25 12:55:10 -070011all: maybe-wip-pause DL-DCCH-Message.c $(TARGET)
Lev Walkin48f33652006-09-17 03:27:57 +000012
Lev Walkinad775912017-09-26 22:55:22 -070013$(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 Walkin48f33652006-09-17 03:27:57 +000018
19.SUFFIXES:
20.SUFFIXES: .c .o
21
22.c.o:
Lev Walkinad775912017-09-26 22:55:22 -070023 $(CC) $(CFLAGS) -o $@ -c $<
Lev Walkin48f33652006-09-17 03:27:57 +000024
25clean:
Lev Walkinad775912017-09-26 22:55:22 -070026 rm -f $(TARGET) $(ASN_LIBRARY)
27 rm -f $(ASN_MODULE_SOURCES:.c=.o) $(ASN_CONVERTER_SOURCES:.c=.o)
Lev Walkin48f33652006-09-17 03:27:57 +000028
29regen: regenerate-from-asn1-source
30
31regenerate-from-asn1-source:
Lev Walkin101c26d2013-04-07 01:37:43 -070032 ../../asn1c/asn1c -S ../../skeletons -pdu=DL-DCCH-Message -pdu=auto -fcompound-names -gen-PER ../rrc-7.1.0.asn1
Lev Walkin48f33652006-09-17 03:27:57 +000033
34
Lev Walkin101c26d2013-04-07 01:37:43 -070035DL-DCCH-Message.c: ../sample.makefile.regen ../rrc-7.1.0.asn1
Lev Walkincc7c94e2006-09-17 04:01:29 +000036 make regen-makefile
37 @touch DL-DCCH-Message.c
Lev Walkin48f33652006-09-17 03:27:57 +000038 make
39
Lev Walkincc7c94e2006-09-17 04:01:29 +000040regen-makefile:
Lev Walkin66adab42006-09-23 02:52:12 +000041 ASN1CMDOPTS="-pdu=auto -fcompound-names -gen-PER" \
Lev Walkin101c26d2013-04-07 01:37:43 -070042 ASN1MODULES="../rrc-7.1.0.asn1" \
Lev Walkincc7c94e2006-09-17 04:01:29 +000043 ASN1PDU=DL-DCCH-Message \
44 PROGNAME=rrc-dump \
45 ../sample.makefile.regen
46
Lev Walkin9dc9f672017-09-12 23:29:20 -070047check: ${TARGET} check-ber check-xer check-oer check-per
Lev Walkin1f12da42006-09-24 19:47:07 +000048 @echo ================
49 @echo All tests passed
50 @echo ================
51
52check-ber:
Lev Walkin00918812006-09-18 21:19:32 +000053 @if test -f sample-DL-DCCH-Message-1.[db]er ; then \
Lev Walkina926fce2017-08-27 12:54:25 -070054 for f in sample-*-*.[db]er; do \
Lev Walkin9dc9f672017-09-12 23:29:20 -070055 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000056 for b in 1 17 33 980 8192; do \
Lev Walkina926fce2017-08-27 12:54:25 -070057 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 Walkin08b30bb2007-06-26 08:24:50 +000060 diff ./.tmp.1.$$$$ ./.tmp.2.$$$$ || exit 4; \
Lev Walkinbc691772006-09-17 11:02:53 +000061 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000062 echo "Test junking $$f (please wait)..."; \
Lev Walkina926fce2017-08-27 12:54:25 -070063 ./${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 Walkin13afe532006-09-18 21:30:04 +000065 done; done; fi
Lev Walkin1f12da42006-09-24 19:47:07 +000066
67check-xer:
Lev Walkin00918812006-09-18 21:19:32 +000068 @if test -f sample-DL-DCCH-Message-1.xer ; then \
Lev Walkina926fce2017-08-27 12:54:25 -070069 for f in sample-*-*.xer; do \
Lev Walkin9dc9f672017-09-12 23:29:20 -070070 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +000071 for b in 1 17 33 980 8192; do \
Lev Walkina926fce2017-08-27 12:54:25 -070072 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 Walkin08b30bb2007-06-26 08:24:50 +000075 diff $$f ./.tmp.2.$$$$ || exit 4; \
Lev Walkinbc691772006-09-17 11:02:53 +000076 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +000077 echo "Test junking $$f (please wait)..."; \
Lev Walkina926fce2017-08-27 12:54:25 -070078 ./${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 Walkin13afe532006-09-18 21:30:04 +000080 done; done; fi
Lev Walkin1f12da42006-09-24 19:47:07 +000081
Lev Walkin9dc9f672017-09-12 23:29:20 -070082check-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 Walkin13afe532006-09-18 21:30:04 +000086 for b in 1 17 33 980 8192; do \
Lev Walkin9dc9f672017-09-12 23:29:20 -070087 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 Walkin13afe532006-09-18 21:30:04 +000095 done; done; fi
Lev Walkin9dc9f672017-09-12 23:29:20 -070096
97check-per:
Lev Walkin2f186082017-09-13 00:57:59 -070098 @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 Walkin08b30bb2007-06-26 08:24:50 +0000112 @if test -f sample-DL-DCCH-Message-1.per ; then \
113 for f in sample-*-[1-9].per; do \
Lev Walkin9dc9f672017-09-12 23:29:20 -0700114 pdu=`echo $$f | sed -E -e "s/sample-([A-Za-z0-9-]+)-[0-9].*/\1/"`; \
Lev Walkin13afe532006-09-18 21:30:04 +0000115 for b in 1 17 33 980 8192; do \
Lev Walkina926fce2017-08-27 12:54:25 -0700116 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 Walkin08b30bb2007-06-26 08:24:50 +0000120 diff $$f ./.tmp.1.$$$$ || exit 6; \
Lev Walkin13afe532006-09-18 21:30:04 +0000121 rm -f ./.tmp.[12].$$$$; \
Lev Walkin1f12da42006-09-24 19:47:07 +0000122 echo "Test junking $$f (please wait)..."; \
Lev Walkina926fce2017-08-27 12:54:25 -0700123 ./${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 Walkin13afe532006-09-18 21:30:04 +0000125 done; done; fi
Lev Walkin48f33652006-09-17 03:27:57 +0000126
Lev Walkineb00dfa2017-08-25 12:55:10 -0700127maybe-wip-pause:
128 @if [ -f WIP ]; then cat WIP; sleep 2; fi
129
Lev Walkin48f33652006-09-17 03:27:57 +0000130distclean: clean
131 rm -f $(ASN_MODULE_SOURCES)
132 rm -f $(ASN_MODULE_HEADERS)
133 rm -f $(ASN_CONVERTER_SOURCES) $(ASN_CONVERTER_HEADERS)
Lev Walkinad775912017-09-26 22:55:22 -0700134 rm -f Makefile.am.example