diff --git a/Docs/examples/streaming_mode/Makefile b/Docs/examples/streaming_mode/Makefile index 4208f609f..985f4e705 100644 --- a/Docs/examples/streaming_mode/Makefile +++ b/Docs/examples/streaming_mode/Makefile @@ -2,6 +2,10 @@ export PATH:=$(realpath ../../../Asn1f4/bin/Debug/):$(PATH) $(info ${PATH}) -all: +all: cTest adaTest + +cTest: Asn1f4.exe -c -uPER -sm -equal -o c_out/ a.asn && (cd c_out; make coverage; cd ..) +adaTest: + Asn1f4.exe -Ada -uPER -sm -equal -o ada_out/ a.asn && (cd ada_out; make coverage; cd ..) diff --git a/Docs/examples/streaming_mode/ada_out/user_code.adb b/Docs/examples/streaming_mode/ada_out/user_code.adb index a45724984..d215a4d80 100644 --- a/Docs/examples/streaming_mode/ada_out/user_code.adb +++ b/Docs/examples/streaming_mode/ada_out/user_code.adb @@ -99,6 +99,7 @@ procedure decode_with_streaming_mode(decodedPDU : out A1; Filename : in String; stream : adaasn1rtl.encoding.Bitstream := adaasn1rtl.encoding.BitStream_init(1024); begin + stream.fetchDataPrm := 1; Seq_IO.Open(ft,Seq_IO.In_File,Filename); read_from_file(stream,ft); -- TASTE_Dataview.A1_Decode(decodedPDU, stream, result); diff --git a/Docs/examples/streaming_mode/c_out/Makefile b/Docs/examples/streaming_mode/c_out/Makefile new file mode 100644 index 000000000..09423c805 --- /dev/null +++ b/Docs/examples/streaming_mode/c_out/Makefile @@ -0,0 +1,45 @@ +# The directories containing the source files, separated by ':' +VPATH=. + +CC=gcc + +# To make "debug" the default configuration if invoked with just "make": +# +# The source files: regardless of where they reside in the source tree, +# VPATH will locate them... +Group0_SRC = $(shell echo *.c) + +# Build a Dependency list and an Object list, by replacing the .c +# extension to .d for dependency files, and .o for object files. +Group0_OBJ = $(patsubst %.c, %.o, ${Group0_SRC}) + +# Your final binary +TARGET=mainprogram + +# What include flags to pass to the compiler +INCLUDEFLAGS= -I . + +# -Wall -Wextra -pedantic -Wcast-qual -Wformat=2 -Wshadow -Wundef -Wno-unused -Wuninitialized -Wno-unused-parameter -fdiagnostics-show-option +# Separate compile options per configuration +CFLAGS += -g -Wall -Werror -Wextra -Wuninitialized -Wcast-qual -Wshadow -Wundef -fdiagnostics-show-option -D_DEBUG ${INCLUDEFLAGS} -O0 -fprofile-arcs -ftest-coverage +LDFLAGS += -g -ftest-coverage -fprofile-arcs + +# A common link flag for all configurations +LDFLAGS += + +all: ${TARGET} + +${TARGET}: ${Group0_OBJ} + @mkdir -p $(dir $@) + $(CC) -g -o $@ $^ ${LDFLAGS} + +%.o: %.c + @mkdir -p $(dir $@) + $(CC) -c $(CFLAGS) -o $@ $< + +coverage: + $(MAKE) && ./$(TARGET) && \ + gcov sample1.c + +clean: + @rm -rf *.o $(TARGET) *.gcda *.gcno *.gcov \ No newline at end of file