Commit 3016fd59 authored by Jon Ringle's avatar Jon Ringle Committed by Lev Walkin

Rename Makefile.am.example => converter-example.mk

The generated Makefile.am.example is not really in the automake style.
Renaming it to converter-example.mk to reflect that it is a plain makefile
snippet and that it is for creating the converter-example
parent f71745aa
...@@ -43,6 +43,7 @@ stamp-h* ...@@ -43,6 +43,7 @@ stamp-h*
# /tests/ # /tests/
/tests/tests-asn1c-smoke/Makefile.am.libasncodec /tests/tests-asn1c-smoke/Makefile.am.libasncodec
/tests/tests-asn1c-smoke/Makefile.am.sample /tests/tests-asn1c-smoke/Makefile.am.sample
/tests/tests-asn1c-smoke/converter-example.mk
/tests/tests-asn1c-smoke/*.[acho] /tests/tests-asn1c-smoke/*.[acho]
/tests/tests-asn1c-smoke/*.asn /tests/tests-asn1c-smoke/*.asn
/tests/tests-asn1c-smoke/*.txt /tests/tests-asn1c-smoke/*.txt
...@@ -77,6 +78,7 @@ doc/docsrc/*.xdv ...@@ -77,6 +78,7 @@ doc/docsrc/*.xdv
/examples/sample.source.*/.tmp.* /examples/sample.source.*/.tmp.*
/examples/sample.source.*/Makefile.am.libasncodec /examples/sample.source.*/Makefile.am.libasncodec
/examples/sample.source.*/Makefile.am.example /examples/sample.source.*/Makefile.am.example
/examples/sample.source.*/converter-example.mk
!/examples/sample.source.*/Makefile !/examples/sample.source.*/Makefile
!/examples/sample.source.*/config.h !/examples/sample.source.*/config.h
......
...@@ -149,7 +149,7 @@ asn1c -no-gen-example %\textbf{rectangle.asn}% ...@@ -149,7 +149,7 @@ asn1c -no-gen-example %\textbf{rectangle.asn}%
\item Create the converter and dumper: \item Create the converter and dumper:
\begin{bash} \begin{bash}
make -f Makefile.am.example make -f converter-example.mk
\end{bash} \end{bash}
\item Done. The binary file converter is ready: \item Done. The binary file converter is ready:
...@@ -486,14 +486,14 @@ after compilation will be rather small anyway. ...@@ -486,14 +486,14 @@ after compilation will be rather small anyway.
generated files. generated files.
This makefile can be used on its own to build the just the codec library. This makefile can be used on its own to build the just the codec library.
\item A \textbf{converter-example.c} file containing the \emph{int main()} function with a fully functioning encoder and data format converter. It can convert a given PDU between BER, XER, OER and PER. At some point you will want to replace this file with your own file containing the \emph{int main()} function. \item A \textbf{converter-example.c} file containing the \emph{int main()} function with a fully functioning encoder and data format converter. It can convert a given PDU between BER, XER, OER and PER. At some point you will want to replace this file with your own file containing the \emph{int main()} function.
\item A \textbf{Makefile.am.example} file which binds together \item A \textbf{converter-example.mk} file which binds together
\textbf{Makefile.am.libasncodecs} and \textbf{converter-example.c} \textbf{Makefile.am.libasncodecs} and \textbf{converter-example.c}
to build a versatile converter and debugger for your data formats. to build a versatile converter and debugger for your data formats.
\end{itemize} \end{itemize}
It is possible to compile everything with just a couple of instructions: It is possible to compile everything with just a couple of instructions:
\begin{bash} \begin{bash}
asn1c -pdu=%\emph{Rectangle}% *.asn asn1c -pdu=%\emph{Rectangle}% *.asn
make -f Makefile.am.example # If you use `make` make -f converter-example.mk # If you use `make`
\end{bash} \end{bash}
or or
\begin{bash} \begin{bash}
......
...@@ -31,8 +31,8 @@ else ...@@ -31,8 +31,8 @@ else
asn1c ${EFFECTIVE_CMDOPTS} || exit $? asn1c ${EFFECTIVE_CMDOPTS} || exit $?
fi fi
if test ! -f Makefile.am.example ; then if test ! -f converter-example.mk ; then
echo "Makefile.am.example is missing" echo "converter-example.mk is missing"
exit 1 exit 1
fi fi
...@@ -45,7 +45,7 @@ test -n "$TITLE" && EXTRA_CFLAGS="-DASN_CONVERTER_TITLE=\"$TITLE\" ${EXTRA_CFLAG ...@@ -45,7 +45,7 @@ test -n "$TITLE" && EXTRA_CFLAGS="-DASN_CONVERTER_TITLE=\"$TITLE\" ${EXTRA_CFLAG
echo "CFLAGS += ${EXTRA_CFLAGS}" echo "CFLAGS += ${EXTRA_CFLAGS}"
echo "begin: ${ASN_PDU}.c maybe-wip-pause all" echo "begin: ${ASN_PDU}.c maybe-wip-pause all"
echo echo
echo "-include Makefile.am.example" echo "-include converter-example.mk"
echo echo
echo "${ASN_PDU}.c: $0 ${ASN_MODULES}" echo "${ASN_PDU}.c: $0 ${ASN_MODULES}"
echo " make regen-makefile" echo " make regen-makefile"
...@@ -147,7 +147,7 @@ test -n "$TITLE" && EXTRA_CFLAGS="-DASN_CONVERTER_TITLE=\"$TITLE\" ${EXTRA_CFLAG ...@@ -147,7 +147,7 @@ test -n "$TITLE" && EXTRA_CFLAGS="-DASN_CONVERTER_TITLE=\"$TITLE\" ${EXTRA_CFLAG
echo ' rm -f $(ASN_MODULE_SRCS)' echo ' rm -f $(ASN_MODULE_SRCS)'
echo ' rm -f $(ASN_MODULE_HDRS)' echo ' rm -f $(ASN_MODULE_HDRS)'
echo ' rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)' echo ' rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)'
echo " rm -f Makefile.am.example" echo " rm -f converter-example.mk"
} > Makefile } > Makefile
echo echo
......
...@@ -2,7 +2,7 @@ ASN_PROGRAM = 1609-2-dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = 1609-2-dump
CFLAGS += -DASN_CONVERTER_TITLE="IEEE 1609.2-2016 decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DASN_CONVERTER_TITLE="IEEE 1609.2-2016 decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: Certificate.c maybe-wip-pause all begin: Certificate.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
Certificate.c: ../sample.makefile.regen ../IEEE-1609.2-2016.asn1 Certificate.c: ../sample.makefile.regen ../IEEE-1609.2-2016.asn1
make regen-makefile make regen-makefile
...@@ -104,4 +104,4 @@ distclean: clean ...@@ -104,4 +104,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -2,7 +2,7 @@ ASN_PROGRAM = j2735-dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = j2735-dump
CFLAGS += -DASN_CONVERTER_TITLE="J2735 DSRC decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DASN_CONVERTER_TITLE="J2735 DSRC decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: MessageFrame.c maybe-wip-pause all begin: MessageFrame.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
MessageFrame.c: ../sample.makefile.regen ../J2735_201603.asn1 MessageFrame.c: ../sample.makefile.regen ../J2735_201603.asn1
make regen-makefile make regen-makefile
...@@ -104,4 +104,4 @@ distclean: clean ...@@ -104,4 +104,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -2,7 +2,7 @@ ASN_PROGRAM = ldap3dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = ldap3dump
CFLAGS += -DASN_CONVERTER_TITLE="Lightweight Directory Access Protocol V3 decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DASN_CONVERTER_TITLE="Lightweight Directory Access Protocol V3 decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: LDAPMessage.c maybe-wip-pause all begin: LDAPMessage.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
LDAPMessage.c: ../sample.makefile.regen ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1 LDAPMessage.c: ../sample.makefile.regen ../rfc4511-Lightweight-Directory-Access-Protocol-V3.asn1
make regen-makefile make regen-makefile
...@@ -104,4 +104,4 @@ distclean: clean ...@@ -104,4 +104,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -2,7 +2,7 @@ ASN_PROGRAM = megaco-dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = megaco-dump
CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: MegacoMessage.c maybe-wip-pause all begin: MegacoMessage.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
MegacoMessage.c: ../sample.makefile.regen ../rfc3525-MEDIA-GATEWAY-CONTROL.asn1 MegacoMessage.c: ../sample.makefile.regen ../rfc3525-MEDIA-GATEWAY-CONTROL.asn1
make regen-makefile make regen-makefile
...@@ -103,4 +103,4 @@ distclean: clean ...@@ -103,4 +103,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -2,7 +2,7 @@ ASN_PROGRAM = x509dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = x509dump
CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: Certificate.c maybe-wip-pause all begin: Certificate.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
Certificate.c: ../sample.makefile.regen ../rfc3280-*.asn1 Certificate.c: ../sample.makefile.regen ../rfc3280-*.asn1
make regen-makefile make regen-makefile
...@@ -103,4 +103,4 @@ distclean: clean ...@@ -103,4 +103,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -2,7 +2,7 @@ ASN_PROGRAM = rrc-dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = rrc-dump
CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: DL-DCCH-Message.c maybe-wip-pause all begin: DL-DCCH-Message.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
DL-DCCH-Message.c: ../sample.makefile.regen ../rrc-7.1.0.asn1 DL-DCCH-Message.c: ../sample.makefile.regen ../rrc-7.1.0.asn1
make regen-makefile make regen-makefile
...@@ -103,4 +103,4 @@ distclean: clean ...@@ -103,4 +103,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -2,7 +2,7 @@ ASN_PROGRAM = tap3dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = tap3dump
CFLAGS += -DASN_CONVERTER_TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DASN_CONVERTER_TITLE="GSM TAP3 (Transferred Account Procedure, Version 3) decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: DataInterChange.c maybe-wip-pause all begin: DataInterChange.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
DataInterChange.c: ../sample.makefile.regen ../tap3.asn1 DataInterChange.c: ../sample.makefile.regen ../tap3.asn1
make regen-makefile make regen-makefile
...@@ -104,4 +104,4 @@ distclean: clean ...@@ -104,4 +104,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -2,7 +2,7 @@ ASN_PROGRAM = ulp-dump ...@@ -2,7 +2,7 @@ ASN_PROGRAM = ulp-dump
CFLAGS += -DASN_CONVERTER_TITLE="OMA UserPlane Location Protocol decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE CFLAGS += -DASN_CONVERTER_TITLE="OMA UserPlane Location Protocol decoder" -DHAVE_CONFIG_H -DJUNKTEST -D_DEFAULT_SOURCE
begin: ULP-PDU.c maybe-wip-pause all begin: ULP-PDU.c maybe-wip-pause all
-include Makefile.am.example -include converter-example.mk
ULP-PDU.c: ../sample.makefile.regen ../ulp.asn1 ULP-PDU.c: ../sample.makefile.regen ../ulp.asn1
make regen-makefile make regen-makefile
...@@ -104,4 +104,4 @@ distclean: clean ...@@ -104,4 +104,4 @@ distclean: clean
rm -f $(ASN_MODULE_SRCS) rm -f $(ASN_MODULE_SRCS)
rm -f $(ASN_MODULE_HDRS) rm -f $(ASN_MODULE_HDRS)
rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS) rm -f $(ASN_PROGRAM_SRCS) $(ASN_PROGRAM_HDRS)
rm -f Makefile.am.example rm -f converter-example.mk
...@@ -160,13 +160,14 @@ asn1c__save_library_makefile(arg_t *arg, const asn1c_dep_chainset *deps, ...@@ -160,13 +160,14 @@ asn1c__save_library_makefile(arg_t *arg, const asn1c_dep_chainset *deps,
} }
static int static int
asn1c__save_example_makefile(arg_t *arg, const asn1c_dep_chainset *deps, const char *datadir, asn1c__save_example_mk_makefile(arg_t *arg, const asn1c_dep_chainset *deps, const char *datadir,
const char *destdir, const char *makefile_name, const char *destdir, const char *makefile_name,
const char *library_makefile_name, int argc, const char *library_makefile_name, int argc,
char **argv) { char **argv) {
FILE *mkf; FILE *mkf;
asn1c_dep_chain *dlist = asn1c_deps_flatten(deps, FDEP_CONVERTER); asn1c_dep_chain *dlist = asn1c_deps_flatten(deps, FDEP_CONVERTER);
/* Generate converter-example.mk snippet */
mkf = asn1c_open_file(destdir, makefile_name, "", 0); mkf = asn1c_open_file(destdir, makefile_name, "", 0);
if(mkf == NULL) { if(mkf == NULL) {
perror(makefile_name); perror(makefile_name);
...@@ -228,6 +229,7 @@ asn1c__save_example_makefile(arg_t *arg, const asn1c_dep_chainset *deps, const c ...@@ -228,6 +229,7 @@ asn1c__save_example_makefile(arg_t *arg, const asn1c_dep_chainset *deps, const c
fclose(mkf); fclose(mkf);
safe_fprintf(stderr, "Generated %s%s\n", destdir, makefile_name); safe_fprintf(stderr, "Generated %s%s\n", destdir, makefile_name);
return 0; return 0;
} }
...@@ -246,7 +248,7 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir, const char *destdir, ...@@ -246,7 +248,7 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir, const char *destdir,
int argc, int optc, char **argv) { int argc, int optc, char **argv) {
int ret = -1; int ret = -1;
const char* program_makefile = "Makefile.am.example"; const char* program_makefile = "converter-example.mk";
const char* library_makefile = "Makefile.am.libasncodec"; const char* library_makefile = "Makefile.am.libasncodec";
/* /*
...@@ -291,7 +293,7 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir, const char *destdir, ...@@ -291,7 +293,7 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir, const char *destdir,
if(ret) break; if(ret) break;
if(arg->flags & A1C_GEN_EXAMPLE) { if(arg->flags & A1C_GEN_EXAMPLE) {
ret = asn1c__save_example_makefile(arg, deps, datadir, destdir, ret = asn1c__save_example_mk_makefile(arg, deps, datadir, destdir,
program_makefile, program_makefile,
library_makefile, argc, argv); library_makefile, argc, argv);
if(ret) break; if(ret) break;
......
...@@ -85,7 +85,7 @@ enum asn1c_flags { ...@@ -85,7 +85,7 @@ enum asn1c_flags {
*/ */
A1C_GEN_PER = 0x80000, A1C_GEN_PER = 0x80000,
/* /*
* Generate converter-example.c and Makefile.am.example * Generate converter-example.c and converter-example.mk
*/ */
A1C_GEN_EXAMPLE = 0x100000, A1C_GEN_EXAMPLE = 0x100000,
}; };
......
...@@ -8,7 +8,7 @@ top_builddir=${top_builddir:-../..} ...@@ -8,7 +8,7 @@ top_builddir=${top_builddir:-../..}
top_srcdir=${top_srcdir:-../..} top_srcdir=${top_srcdir:-../..}
cleanup() { cleanup() {
rm -rf *.[acho] Makefile.am.* *.txt *.asn rm -rf *.[acho] Makefile.am.* *.mk *.txt *.asn
rm -f converter-example rm -f converter-example
} }
...@@ -34,12 +34,12 @@ verify() { ...@@ -34,12 +34,12 @@ verify() {
{ {
echo "$asncmd" echo "$asncmd"
echo "${MAKE:-make} -f Makefile.am.example" echo "${MAKE:-make} -f converter-example.mk"
} > status.txt } > status.txt
echo "Module DEFINITIONS::=BEGIN T::=$type END" > test.asn echo "Module DEFINITIONS::=BEGIN T::=$type END" > test.asn
$asncmd $asncmd
CFLAGS=-O0 ${MAKE:-make} -f Makefile.am.example | tail -10 CFLAGS=-O0 ${MAKE:-make} -f converter-example.mk | tail -10
} }
verify_type_with_variants() { verify_type_with_variants() {
......
...@@ -84,7 +84,7 @@ ASN_PROGRAM_SRCS = ${source_short} ...@@ -84,7 +84,7 @@ ASN_PROGRAM_SRCS = ${source_short}
CC ?= ${CC} CC ?= ${CC}
CXX ?= ${CXX} CXX ?= ${CXX}
-include Makefile.am.example -include converter-example.mk
all: compiled-module all: compiled-module
\$(MAKE) check-program \$(MAKE) check-program
......
...@@ -286,7 +286,7 @@ asn_compile() { ...@@ -286,7 +286,7 @@ asn_compile() {
echo "ASN_PROGRAM = random-test-driver" echo "ASN_PROGRAM = random-test-driver"
echo "ASN_PROGRAM_SRCS = random-test-driver.c" echo "ASN_PROGRAM_SRCS = random-test-driver.c"
echo echo
echo "include Makefile.am.example" echo "include converter-example.mk"
echo echo
echo "all-tests-succeeded: ${abs_top_builddir}/asn1c/asn1c \$(ASN_PROGRAM_SRCS) \$(ASN_MODULE_SRCS) \$(ASN_MODULE_HDRS)" echo "all-tests-succeeded: ${abs_top_builddir}/asn1c/asn1c \$(ASN_PROGRAM_SRCS) \$(ASN_MODULE_SRCS) \$(ASN_MODULE_HDRS)"
echo " @rm -f \$@" echo " @rm -f \$@"
...@@ -295,7 +295,7 @@ asn_compile() { ...@@ -295,7 +295,7 @@ asn_compile() {
echo " @exit 1" echo " @exit 1"
echo echo
} > Makefile } > Makefile
echo "Makefile.am.example -> Makefile" echo "converter-example.mk -> Makefile"
} }
# Make up to four different passes: # Make up to four different passes:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment