Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
asn1c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
qwebaby3
asn1c
Commits
ffa71587
Commit
ffa71587
authored
20 years ago
by
Lev Walkin
Browse files
Options
Downloads
Patches
Plain Diff
better dependency tracking
parent
fc0d66f0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
asn1c/tests/check-assembly.sh
+51
-23
51 additions, 23 deletions
asn1c/tests/check-assembly.sh
with
51 additions
and
23 deletions
asn1c/tests/check-assembly.sh
+
51
−
23
View file @
ffa71587
...
...
@@ -5,6 +5,11 @@
# test-* directories, do lots of other magic stuff and exit cleanly.
#
if
[
"x
$1
"
=
"x"
]
;
then
echo
"Usage:
$0
<check-NN.c>"
exit
fi
# Compute the .asn1 spec name by the given file name.
source
=
$(
echo
"
$1
"
|
sed
-e
's/.*\///'
)
testno
=
`
echo
"
$source
"
|
cut
-f2
-d
'-'
|
cut
-f1
-d
'.'
`
...
...
@@ -17,45 +22,68 @@ IFS="."
set
$args
shift
IFS
=
$OFS
AFLAGS
=
"
$@
"
touch
${
testdir
}
-FAILED
# Create this file to ease post mortem analysis
if
[
!
-d
$testdir
]
;
then
mkdir
$testdir
||
exit
$?
fi
cd
$testdir
||
exit
$?
ln
-fs
../
$source
||
exit
$?
# Compile the corresponding .asn1 spec.
set
-x
../../asn1c
\
-S
../../../skeletons
\
-Wdebug-compiler
"
$@
"
\
../../../tests/
${
testno
}
-
*
.asn1
||
exit
$?
set
+x
asn_module
=
$(
echo
../../../tests/
${
testno
}
-
*
.asn1
)
# Create a Makefile for the project.
cat
>
Makefile
<<
EOM
# This file is autogenerated by ../
$0
COMMON_FLAGS= -I. -DEMIT_ASN_DEBUG
CFLAGS=
\$
{COMMON_FLAGS}
${
CFLAGS
}
CXXFLAGS=
\$
{COMMON_FLAGS}
${
CXXFLAGS
}
SRCS=`echo *.c*`
OBJS1=
\$
{SRCS:.c=.o}
OBJS=
\$
{OBJS1:.cc=.o}
check-executable:
\$
{OBJS}
\$
(CC)
\$
(CFLAGS) -o check-executable
\$
(OBJS)
.SUFFIXES:
.SUFFIXES: .c .cc .o
.c.o:
\$
(CC)
\$
(CFLAGS) -o
\$
@ -c
\$
<
.cc.o:
\$
(CXX)
\$
(CXXFLAGS) -o
\$
@ -c
\$
<
check: check-executable
all: check-executable
check-executable: compiled-module object-files
\$
(CC)
\$
(CFLAGS) -o check-executable *.o
# Cannot track dependencies automatically because files are not known beforehand
object-files: *.c*
@for sfile in *.c; do
\\
ofile=
\`
echo "
\$\$
sfile" | sed -e 's/
\.
c[c]*
\$\$
/.o/'
\`
;
\\
if [ "
\$\$
sfile" -nt "
\$\$
ofile" ]; then
\\
echo "
\$
(CC)
\$
(CFLAGS) -o
\$\$
ofile -c
\$\$
sfile";
\\
\$
(CC)
\$
(CFLAGS) -o
\$\$
ofile -c
\$\$
sfile;
\\
fi;
\\
done
@for sfile in *.cc; do
\\
ofile=
\`
echo "
\$\$
sfile" | sed -e 's/
\.
c[c]*
\$\$
/.o/'
\`
;
\\
if [ "
\$\$
sfile" -nt "
\$\$
ofile" ]; then
\\
echo "
\$
(CXX)
\$
(CXXFLAGS) -o
\$\$
ofile -c
\$\$
sfile";
\\
\$
(CXX)
\$
(CXXFLAGS) -o
\$\$
ofile -c
\$\$
sfile;
\\
fi;
\\
done
@touch object-files
# Compile the corresponding .asn1 spec.
compiled-module:
${
asn_module
}
../../asn1c
../../asn1c -S ../../../skeletons -Wdebug-compiler
\\
${
AFLAGS
}
${
asn_module
}
@touch compiled-module
check-succeeded: check-executable
@rm -f check-succeeded
./check-executable
@touch check-succeeded
check: check-succeeded
clean:
@rm -f *.o
EOM
# Perform building and checking
make check
||
exit
$?
# Perform building and checking
make check
||
exit
$?
# Uncomment this to jeopardize debugging
# make clean
rm
-f
../
${
testdir
}
-FAILED
exit
0
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment