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
c56b5664
Commit
c56b5664
authored
Jul 05, 2017
by
Lev Walkin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
refactor autogeneration
parent
221ce933
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
24 deletions
+26
-24
asn1c/tests/check-assembly.sh
asn1c/tests/check-assembly.sh
+26
-24
No files found.
asn1c/tests/check-assembly.sh
View file @
c56b5664
...
...
@@ -49,14 +49,11 @@ ln -fns "../${source_full}" "${testdir}"
asn_module
=
$(
echo
"
${
abs_top_srcdir
}
/tests/
${
testno
}
"
-
*
.asn1
)
# Create a BSD or GNU Makefile for the project.
produce_makefile
()
{
local
make_type
=
$1
local
make_file
=
"
$testdir
/
${
make_type
}
makefile"
AUTOGENERATED
=
"# This file is autogenerated by
$0
${
source_full
}
${
AFLAGS
}
"
#
1/3 part of the Makefile.
cat
>
"
${
make_file
}
"
<<
PREAMBLE
# This file is autogenerated by ../
$0
#
Create a common Makefile for the project
cat
<<
TARGETS
> "
${
testdir
}
/Makefile.targets"
${
AUTOGENERATED
}
COMMON_FLAGS= -I. -I
${
abs_top_srcdir
}
/skeletons
CFLAGS =
\$
{COMMON_FLAGS}
${
CFLAGS
:-}
-g -O0
...
...
@@ -66,21 +63,6 @@ LDFLAGS = ${LDFLAGS:-}
CC ?=
${
CC
}
PREAMBLE
# 2/3 part of the Makefile.
if
[
${
make_type
}
=
"BSD"
]
;
then
cat
>>
${
make_file
}
<<-
OBJECTS
SRCS!=find . -name
\*
.c
OBJS=
\$
{SRCS:.c=.o}
OBJECTS
else
echo
'OBJS=$(patsubst %.c,%.o,$(wildcard *.c))'
>>
${
make_file
}
fi
# 3/3 part of the Makefile.
cat
>>
"
${
make_file
}
"
<<
TARGETS
all: compiled-module
\$
(MAKE) check-executable
...
...
@@ -109,10 +91,30 @@ clean:
@rm -f *.o check-executable
TARGETS
# Create a BSD- or GNU-specific Makefile for the project.
produce_specific_makefile
()
{
local
make_type
=
$1
local
make_file
=
"
$testdir
/
${
make_type
}
makefile"
if
[
${
make_type
}
=
"BSD"
]
;
then
cat
<<-
OBJECTS
>>
${
make_file
}
${
AUTOGENERATED
}
SRCS!=find . -name
\*
.c
OBJS=
\$
{SRCS:.c=.o}
.sinclude Makefile.targets
OBJECTS
else
cat
<<-
OBJECTS
>>
${
make_file
}
${
AUTOGENERATED
}
OBJS=
\$
(patsubst %.c,%.o,
\$
(wildcard *.c))
-include Makefile.targets
OBJECTS
fi
}
produce_makefile BSD
produce_makefile GNU
produce_
specific_
makefile BSD
produce_
specific_
makefile GNU
# Perform building and checking
${
TEST_DRIVER
}
make
-C
"
$testdir
"
check
...
...
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