Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
dune-common
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
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
Core Modules
dune-common
Commits
32510cd3
Commit
32510cd3
authored
15 years ago
by
Christian Engwer
Browse files
Options
Downloads
Patches
Plain Diff
towards a general doxyfile generator
[[Imported from SVN: r5682]]
parent
25a4fe68
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/dunedoxynize
+109
-17
109 additions, 17 deletions
bin/dunedoxynize
with
109 additions
and
17 deletions
bin/dunedoxynize
+
109
−
17
View file @
32510cd3
#!/bin/bash
#!/bin/sh
export
DOXYOUT
=
${
1
:-
doc
/doxygen/Doxyfile.in
}
shift
export
DOXYDIR
=
doc/doxygen/
find_doxystyle
()
{
for
i
in
`
dirname
$0
`
/../doc/doxygen/Doxystyle
`
dirname
$0
`
/../share/dune-common/doc/doxygen/Doxystyle
;
do
if
test
-f
$i
;
then
if
[
-f
"
$i
"
]
;
then
export
DOXYSTYLE
=
$i
return
return
0
fi
done
echo
"Error: dunedoxynize global style not found"
exit
1
return
1
}
test_doxylocal
()
{
while
[
-n
"
$1
"
]
;
do
if
[
-f
"
$1
/dune.module"
]
;
then
return
0
fi
shift
done
return
1
}
STUB
=
doc/doxygen/Doxylocal
if
!
test
-f
$STUB
;
then
exit
0
parse_doxyfile
()
{
# Doxylocal is used _as is_
if
[
"
$2
"
=
"Doxylocal"
]
;
then
cat
$1
/
$DOXYDIR
/
$2
return
fi
local
FILE
=
$1
/
$DOXYDIR
/
$2
local
FOUND
=
0
local
line
# find lines that match the pattern
set
`
grep
-n
'^ *\(INPUT\|EXCLUDE\|PREDEFINED\) *[+=]'
$FILE
|
cut
-d
:
-f1
`
# search lines in $@ and proceeding lines
grep
-n
.
$FILE
|
sed
-e
's/\\/\\\\/g'
|
while
read
line
;
do
if
[
"
${
line
%%
:
*
}
"
-eq
"
${
1
:-
0
}
"
]
;
then
FOUND
=
1
# subst = by += if necessary
start
=
"
${
line
%%=*
}
"
case
"
$start
"
in
*
+
)
;;
*
)
line
=
"
$start
+=
${
line
#*=
}
"
;;
esac
shift
fi
if
[
$FOUND
-eq
1
]
;
then
echo
"
$line
"
else
continue
fi
# check for trailing '\'
case
"
$line
"
in
*
\\
)
FOUND
=
1
;;
*
)
FOUND
=
0
;;
esac
done
|
sed
-e
's/^[0-9]*://'
}
parse_doxylocal
()
{
if
echo
$1
|
grep
-q
"^/"
;
then
srcdir
=
$1
/
$DOXYDIR
top_srcdir
=
$1
parse_doxyfile
$1
$2
|
sed
-e
"s!@
\(
abs_
\)
*srcdir@!
$srcdir
!"
-e
"s!@
\(
abs_
\)
*top_srcdir@!
$top_srcdir
!"
;
else
parse_doxyfile
$1
$2
fi
}
get_module_name
()
{
grep
"^Module:"
$1
/dune.module |
sed
-e
's/^Module: *//'
}
generate_doxyout
()
{
echo
"Generating
$DOXYOUT
from "
echo
" global style"
cat
$DOXYSTYLE
>
$DOXYOUT
while
[
-n
"
$1
"
]
;
do
for
DOXY
in
Doxylocal Doxyfile.in Doxyfile
;
do
if
[
-f
"
$1
/
$DOXYDIR
/
$DOXY
"
]
;
then
echo
" and
`
get_module_name
$1
`
config"
parse_doxylocal
$1
$DOXY
>>
$DOXYOUT
break
fi
done
shift
done
echo
" ... done"
}
# make sure we are in dune module
if
!
[
-f
dune.module
]
;
then
echo
"Error: dunedoxynize must be called from the top_srcdir of your module"
exit
1
fi
# search for doxygen style
if
!
find_doxystyle
;
then
echo
"Error: dunedoxynize global style not found"
exit
1
fi
if
!
test
-f
configure.ac
;
then
echo
dunedoxynize must be called from the top_srcdir of your module
# make sure that there is at least one Doxylocal file
if
!
test_doxylocal
"
${
@
:-
.
}
"
||
[
$#
-eq
0
]
;
then
echo
"Error: you didn't supply any valid Doxylocal file"
exit
1
fi
echo
"Generating doc/doygen/Doxyfile.in from "
find_doxystyle
echo
" global style"
cat
$DOXYSTYLE
>
doc/doxygen/Doxyfile.in
echo
" and
$STUB
"
cat
$STUB
>>
doc/doxygen/Doxyfile.in
echo
" ... done"
generate_doxyout
"
${
@
:-
.
}
"
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