Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
A
asn1c
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
asn1c
Commits
1029a6ec
Commit
1029a6ec
authored
Nov 14, 2017
by
Jon Ringle
Committed by
Lev Walkin
Nov 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Generate Makefile.am.asn1convert
This file can be included and transformed via automake
parent
3016fd59
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
67 additions
and
2 deletions
+67
-2
.gitignore
.gitignore
+2
-2
libasn1compiler/asn1c_save.c
libasn1compiler/asn1c_save.c
+65
-0
No files found.
.gitignore
View file @
1029a6ec
...
...
@@ -42,7 +42,7 @@ stamp-h*
# /tests/
/tests/tests-asn1c-smoke/Makefile.am.libasncodec
/tests/tests-asn1c-smoke/Makefile.am.
sample
/tests/tests-asn1c-smoke/Makefile.am.
asn1convert
/tests/tests-asn1c-smoke/converter-example.mk
/tests/tests-asn1c-smoke/*.[acho]
/tests/tests-asn1c-smoke/*.asn
...
...
@@ -77,7 +77,7 @@ doc/docsrc/*.xdv
/examples/sample.source.*/lib*.a
/examples/sample.source.*/.tmp.*
/examples/sample.source.*/Makefile.am.libasncodec
/examples/sample.source.*/Makefile.am.
example
/examples/sample.source.*/Makefile.am.
asn1convert
/examples/sample.source.*/converter-example.mk
!/examples/sample.source.*/Makefile
!/examples/sample.source.*/config.h
...
...
libasn1compiler/asn1c_save.c
View file @
1029a6ec
...
...
@@ -234,6 +234,66 @@ asn1c__save_example_mk_makefile(arg_t *arg, const asn1c_dep_chainset *deps, cons
}
static
int
asn1c__save_example_am_makefile
(
arg_t
*
arg
,
const
asn1c_dep_chainset
*
deps
,
const
char
*
datadir
,
const
char
*
destdir
,
const
char
*
makefile_name
,
const
char
*
library_makefile_name
,
int
argc
,
char
**
argv
)
{
FILE
*
mkf
;
asn1c_dep_chain
*
dlist
=
asn1c_deps_flatten
(
deps
,
FDEP_CONVERTER
);
/* Generate example.am snippet */
mkf
=
asn1c_open_file
(
destdir
,
makefile_name
,
""
,
0
);
if
(
mkf
==
NULL
)
{
perror
(
makefile_name
);
return
-
1
;
}
safe_fprintf
(
mkf
,
"include %s%s
\n\n
"
"bin_PROGRAMS += asn1convert
\n
"
"asn1convert_CFLAGS = $(ASN_MODULE_CFLAGS) %s%s
\n
"
"asn1convert_CPPFLAGS = -I$(top_srcdir)/%s
\n
"
"asn1convert_LDADD = libasncodec.la
\n
"
"asn1convert_SOURCES = "
,
destdir
,
library_makefile_name
,
(
arg
->
flags
&
A1C_PDU_TYPE
)
?
generate_pdu_C_definition
()
:
""
,
need_to_generate_pdu_collection
(
arg
)
?
"-DASN_PDU_COLLECTION "
:
""
,
destdir
);
if
(
dlist
)
{
for
(
size_t
i
=
0
;
i
<
dlist
->
deps_count
;
i
++
)
{
char
dstpath
[
PATH_MAX
];
int
ret
=
snprintf
(
dstpath
,
sizeof
(
dstpath
),
"%s/%s"
,
datadir
,
dlist
->
deps
[
i
]
->
filename
);
assert
(
ret
>
0
&&
(
size_t
)
ret
<
sizeof
(
dstpath
));
if
(
asn1c_copy_over
(
arg
,
destdir
,
dstpath
,
"implicit"
)
==
-
1
)
{
safe_fprintf
(
mkf
,
">>>ABORTED<<<"
);
fclose
(
mkf
);
return
-
1
;
}
safe_fprintf
(
mkf
,
"
\\\n\t
%s%s"
,
destdir
,
dlist
->
deps
[
i
]
->
filename
);
}
asn1c_dep_chain_free
(
dlist
);
}
if
(
need_to_generate_pdu_collection
(
arg
))
{
safe_fprintf
(
mkf
,
"
\\\n\t
%spdu_collection.c"
,
destdir
);
if
(
generate_pdu_collection_file
(
arg
,
destdir
))
return
-
1
;
}
safe_fprintf
(
mkf
,
"
\n
regen: regenerate-from-asn1-source
\n
"
"
\n
regenerate-from-asn1-source:
\n\t
"
);
for
(
int
i
=
0
;
i
<
argc
;
i
++
)
safe_fprintf
(
mkf
,
"%s%s"
,
i
?
" "
:
""
,
argv
[
i
]);
safe_fprintf
(
mkf
,
"
\n\n
"
);
fclose
(
mkf
);
safe_fprintf
(
stderr
,
"Generated %s%s
\n
"
,
destdir
,
makefile_name
);
return
0
;
}
can_generate_pdu_collection
(
arg_t
*
arg
)
{
abuf
*
buf
=
generate_pdu_collection
(
arg
);
if
(
!
buf
)
{
...
...
@@ -248,6 +308,7 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir, const char *destdir,
int
argc
,
int
optc
,
char
**
argv
)
{
int
ret
=
-
1
;
const
char
*
example_am_makefile
=
"Makefile.am.asn1convert"
;
const
char
*
program_makefile
=
"converter-example.mk"
;
const
char
*
library_makefile
=
"Makefile.am.libasncodec"
;
...
...
@@ -297,6 +358,10 @@ asn1c_save_compiled_output(arg_t *arg, const char *datadir, const char *destdir,
program_makefile
,
library_makefile
,
argc
,
argv
);
if
(
ret
)
break
;
ret
=
asn1c__save_example_am_makefile
(
arg
,
deps
,
datadir
,
destdir
,
example_am_makefile
,
library_makefile
,
argc
,
argv
);
if
(
ret
)
break
;
}
}
while
(
0
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment