Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Template Coq-Project
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Monitor
Service Desk
Analyze
Contributor analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Max Ole Elliger
Template Coq-Project
Commits
d113f960
Commit
d113f960
authored
1 year ago
by
Max Ole Elliger
Browse files
Options
Downloads
Plain Diff
Merge branch 'more_folder_extension' into 'main'
Improved Makefile structure See merge request oc59yqul/template_coq!3
parents
4fe47f9f
1475e10a
Branches
main
No related tags found
1 merge request
!3
Improved Makefile structure
Pipeline
#122704
passed
1 year ago
Stage: build
Changes
2
Pipelines
3
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+1
-0
1 addition, 0 deletions
.gitignore
Makefile
+71
-25
71 additions, 25 deletions
Makefile
with
72 additions
and
25 deletions
.gitignore
+
1
−
0
View file @
d113f960
...
...
@@ -12,5 +12,6 @@ lia.cache
Makefile.coq
Makefile.coq.conf
.Makefile.coq.d
.coq-html.mk
public/*
_CoqProject
This diff is collapsed.
Click to expand it.
Makefile
+
71
−
25
View file @
d113f960
#TODO: Die folgenden 4 Zeilen konfigurieren.
SRC
:=
src
MODULES
:=
LIB
:=
CoMoProj
HTML
:=
public
# Configuration
VS
:=
$(
MODULES:%
=
$(
SRC
)
/%.v
)
#TODO Change the following lines for configuration.
PROJNAME
=
CoMoProj
HTMLDIR
=
public/
COMPONENTS
:=
src:SRC
.PHONY
:
all html coq clean clean_html clean_all
COQDOC_FLAGS
=
--utf8
all
:
coq html _CoqProject
html
:
coq $(SRC)
mkdir
-p
public
coqdoc
-R
$(
SRC
)
$(
LIB
)
$(
VS
)
-d
$(
HTML
)
\
-utf8
--lib-name
File
--toc
coq
:
Makefile.coq
$(
MAKE
)
-f
Makefile.coq all
clean
:
$(SRC)
rm
-f
$(
SRC
)
/
*
.vo
rm
-f
$(
SRC
)
/
*
.vok
rm
-f
$(
SRC
)
/
*
.vos
rm
-f
$(
SRC
)
/
*
.glob
rm
-f
$(
SRC
)
/.
*
.aux
Makefile.coq
:
_CoqProject Makefile
coq_makefile
-f
$<
-o
$@
GENERATED_HTML
=
.coq-html.mk
clean
:
Makefile.coq $(SRC)
$(
MAKE
)
-f
$<
cleanall
rm
-f
Makefile.coq
rm
-f
Makefile.coq.conf
rm
-f
.Makefile.coq.d
rm
-f
_CoqProject
clean_html
:
clean
rm
-f
-r
$(
HTML
)
clean_html
:
clean $(HTMLDIR)
rm
-f
$(
GENERATED_HTML
)
rm
-f
-r
$(
HTMLDIR
)
clean_all
:
clean clean_html
$(SRC)
:
mkdir
-p
$(
SRC
)
define
GENCoqPr
BEGIN { RS="[[
:
space:]]"; FS=":" }
\
{
\
dirname = $$1;
\
libname = $$2;
\
print "-R " dirname " " libname;
\
find = "find " dirname " -name '*.v' -maxdepth 1";
\
while ((find | getline) > 0) {
\
print;
\
}
\
close(find);
\
}
endef
_CoqProject
:
Makefile
echo
"-R
$(
SRC
)
$(
LIB
)
\n\n
$(
SRC
)
"
>
_CoqProject
echo
$(
COMPONENTS
)
|
awk
'
$(
GENCoqPr
)
'
>
$@
$(HTMLDIR)
:
mkdir
-p
$(
HTMLDIR
)
html
:
$(HTMLDIR)/toc.html
Makefile.coq
:
Makefile $(VS) $(SRC)
@
coq_makefile
-o
Makefile.coq
-R
$(
SRC
)
$(
LIB
)
$(
VS
)
define
GENIndex
BEGIN
{
\
print
"<html><body><h1>Table of Contents for $(PROJNAME)</h1>"
;
\
}\
{\
printf(
"<h2><a href=\"%s.html\">%s</a></h2>\n"
,
$$1,
$$1);\
}
endef
$(HTMLDIR)/toc.html
:
$(HTMLDIR)
find
$(
HTMLDIR
)
-name
'*.html'
-print0
| xargs
-0
basename
-a
-s
.html |
grep
-Fxv
'toc'
|
sort
|
awk
'
$(
GENIndex
)
'
>
$@
define
GENMakefile
BEGIN { RS="[[
:
space:]]"; FS=":" }
\
{
\
dirname = $$1;
\
libname = $$2;
\
find = "find " dirname " -name '*.v' -maxdepth 1";
\
while ((find | getline line) > 0) {
\
match(line
,
/
\/
([^
\/
]+).v/
,
part);
\
html = HTMLDIR libname "." part[1] ".html";
\
print html ": " line " " HTMLDIR;
\
print "
\t
coqdoc -o $$@ $$< --lib-name $(PROJNAME) $(COQDOC_FLAGS)";
\
htmls = htmls " " html;
\
}
\
close(find);
\
}
\
END {
\
print "html:" htmls;
\
print HTMLDIR "/toc.html: " htmls;
\
}
endef
$(GENERATED_HTML)
:
Makefile $(HTMLDIR)
echo
$(
COMPONENTS
)
|
awk
-v
HTMLDIR
=
"
$(
HTMLDIR
)
"
'
$(
GENMakefile
)
'
>
$@
-include
$(GENERATED_HTML)
.PHONY
:
all html coq clean clean_html clean_all
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