Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
frama-c
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
pub
frama-c
Commits
343a7815
Commit
343a7815
authored
2 years ago
by
Patrick Baudin
Browse files
Options
Downloads
Patches
Plain Diff
[Headers] minor changes
parent
5bc7f09f
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
share/Makefile.headers
+51
-39
51 additions, 39 deletions
share/Makefile.headers
with
51 additions
and
39 deletions
share/Makefile.headers
+
51
−
39
View file @
343a7815
...
...
@@ -30,7 +30,9 @@
# Must be unset (for external plugins) and set (for FRAMA-C kernel)
FRAMAC_HDRCK
?=
# Can be set to no
HDRCK
?=
frama-c-hdrck
# Can be set to no/yes
# - yes: adds "-exit-on-warning" option to "frama-c-hdrck"
HEADER_STRICT
?=
yes
...
...
@@ -67,6 +69,13 @@ HEADER_SAVE_SPEC?=no
# Extra parameters for "frama-c-hdrck"
HDRCK_EXTRA
?=
##########################################################################
## Tools
GIT
?=
git
DUNE
?=
dune
TEE
?=
tee
##########################################################################
## Command used to execute hdrck
...
...
@@ -74,113 +83,116 @@ HDRCK_EXTRA?=
ifeq
($(FRAMAC_HDRCK),)
# HDRCK is external
HDRCK
:=
frama-c-hdrck
HDRCK
.CMD
:=
$(
HDRCK
)
else
# HDRCK is internal
HDRCK
:=
dune
exec
--root
$(
FRAMAC_HDRCK_SRC
)
--
frama-c-hdrck
HDRCK
.CMD
:=
$(
DUNE
)
exec
--root
$(
FRAMAC_HDRCK_SRC
)
--
$(
HDRCK
)
$(FRAMAC_HDRCK)
:
$(FRAMAC_HDRCK_SRC)
/hdrck.ml
dune
build
--root
$(
FRAMAC_HDRCK_SRC
)
hdrck.exe
$(FRAMAC_HDRCK)
:
tools/hdrck
/hdrck.ml
$(
DUNE
)
build
--root
$(
FRAMAC_HDRCK_SRC
)
hdrck.exe
endif
HDRCK
_
OPTS
:=
--stdin
HDRCK
.
OPTS
:=
--stdin
######################################################################
## Identifies how to get the header specification (from git/find/cat)
## and updates HDRCK_OPTS variable
## and updates HDRCK.OPTS variable
HDRCK.FILE_LIST
=
$(
GIT
)
ls-files
-z
HDRCK.FILE_ATTR
=
$(
GIT
)
check-attr
--stdin
-z
header_spec
ifeq
($(HEADER_SPEC),)
H
EADER_
HAS_GIT
:=
$(
wildcard .git
)
ifneq
($(H
EADER_
HAS_GIT),)
H
DRCK.
HAS_GIT
:=
$(
wildcard .git
)
ifneq
($(H
DRCK.
HAS_GIT),)
# From git (including git work-trees)
HDRCK
_
SPEC
:=
git ls-files
-z
| git check-attr
--stdin
-z
header_spec
HDRCK
_
OPTS
+=
-z
HDRCK
.
SPEC
:=
$(
HDRCK.FILE_LIST
)
|
$(
HDRCK.FILE_ATTR
)
HDRCK
.
OPTS
+=
-z
else
# Note: in such a case, GIT is required...
HDRCK
_
SPEC
:=
HDRCK
.
SPEC
:=
endif
# H
EADER_
HAS_GIT
endif
# H
DRCK.
HAS_GIT
else
# HEADER_SPEC
ifeq
($(HEADER_SAVE_SPEC),yes)
H
EADER_
HAS_GIT
:=
$(
wildcard .git
)
ifneq
($(H
EADER_
HAS_GIT),)
H
DRCK.
HAS_GIT
:=
$(
wildcard .git
)
ifneq
($(H
DRCK.
HAS_GIT),)
# From git (including git work-trees)
HDRCK
_
SPEC
:=
git ls-files
-z
| git check-attr
--stdin
-z
header_spec |
tee
$(
HEADER_SPEC
)
HDRCK
_
OPTS
+=
-z
HDRCK
.
SPEC
:=
$(
HDRCK.FILE_LIST
)
|
$(
HDRCK.FILE_ATTR
)
|
$(
TEE
)
$(
HEADER_SPEC
)
HDRCK
.
OPTS
+=
-z
else
# Note: in such a case, GIT is required...
HDRCK
_
SPEC
:=
HDRCK
.
SPEC
:=
endif
# H
EADER_
HAS_GIT
endif
# H
DRCK.
HAS_GIT
else
# HEADER_SAVE_SPEC
# From a file
HDRCK
_
SPEC
:=
cat
$(
HEADER_SPEC
)
HDRCK
.
SPEC
:=
cat
$(
HEADER_SPEC
)
# The file format can be overloaded in using the var HDRCK_EXTRA
HDRCK
_
OPTS
+=
-spec-format
3-zeros
HDRCK
.
OPTS
+=
-spec-format
3-zeros
endif
# HEADER_SAVE_SPEC
endif
# HEADER_SPEC
################################
## Updates HDRCK
_
OPTS variable
## Updates HDRCK
.
OPTS variable
ifneq
($(HEADER_DISTRIB_FILE),)
# Adds the option "-distrib-file"
HDRCK
_
OPTS
+=
-distrib-file
$(
HEADER_DISTRIB_FILE
)
HDRCK
.
OPTS
+=
-distrib-file
$(
HEADER_DISTRIB_FILE
)
endif
ifneq
($(HEADER_EXCEPTIONS),)
# Adds the option "-header-except-file"
HDRCK
_
OPTS
+=
-header-except-file
$(
HEADER_EXCEPTIONS
)
HDRCK
.
OPTS
+=
-header-except-file
$(
HEADER_EXCEPTIONS
)
endif
ifneq
($(HEADER_REPO),)
# Adds the option "-C"
HDRCK
_
OPTS
+=
-C
$(
HEADER_REPO
)
HDRCK
.
OPTS
+=
-C
$(
HEADER_REPO
)
endif
ifeq
($(HEADER_STRICT),yes)
# Adds the option "-exit-on-warning"
HDRCK
_
OPTS
+=
-exit-on-warning
HDRCK
.
OPTS
+=
-exit-on-warning
endif
#####################################
## Identifies where are the headers
## and updates HDRCK
_
OPTS variable
## and updates HDRCK
.
OPTS variable
ifeq
($(HEADER_OPEN_SOURCE),yes)
HDRCK
_
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
addsuffix /open-source,
$(
HEADER_DIRS
)))
HDRCK
.
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
addsuffix /open-source,
$(
HEADER_DIRS
)))
else
ifeq
($(HEADER_OPEN_SOURCE),no)
HDRCK
_
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
addsuffix /close-source,
$(
HEADER_DIRS
)))
HDRCK
.
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
addsuffix /close-source,
$(
HEADER_DIRS
)))
else
ifeq
($(HEADER_OPEN_SOURCE),)
HDRCK
_
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
HEADER_DIRS
))
HDRCK
.
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
HEADER_DIRS
))
else
HDRCK
_
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
addsuffix /
$(
HEADER_OPEN_SOURCE
)
,
$(
HEADER_DIRS
)))
HDRCK
.
OPTS
+=
$(
addprefix
-header-dirs
=
,
$(
addsuffix /
$(
HEADER_OPEN_SOURCE
)
,
$(
HEADER_DIRS
)))
endif
endif
endif
#################################
ifeq
($(HDRCK
_
SPEC),)
ifeq
($(HDRCK
.
SPEC),)
.PHONY
:
check-headers
check-headers
:
$(FRAMAC_HDRCK)
...
...
@@ -194,20 +206,19 @@ else
.PHONY
:
check-headers
check-headers
:
$(FRAMAC_HDRCK)
$(
HDRCK
_
SPEC
)
|
$(
HDRCK
)
$(
HDRCK
_
OPTS
)
$(
HDRCK_EXTRA
)
$(
HDRCK
.
SPEC
)
|
$(
HDRCK
.CMD
)
$(
HDRCK
.
OPTS
)
$(
HDRCK_EXTRA
)
.PHONY
:
headers
headers
:
$(FRAMAC_HDRCK)
$(
HDRCK
_
SPEC
)
|
$(
HDRCK
)
-update
$(
HDRCK
_
OPTS
)
$(
HDRCK_EXTRA
)
$(
HDRCK
.
SPEC
)
|
$(
HDRCK
.CMD
)
-update
$(
HDRCK
.
OPTS
)
$(
HDRCK_EXTRA
)
endif
# $(HDRCK
_
SPEC)
endif
# $(HDRCK
.
SPEC)
#################################
.PHONY
:
headers.info
headers.info
:
echo
"FRAMAC_HDRCK='
$(
FRAMAC_HDRCK
)
'"
echo
"HEADER_HAS_GIT='
$(
HEADER_HAS_GIT
)
'"
echo
"HEADER_OPEN_SOURCE='
$(
HEADER_OPEN_SOURCE
)
'"
echo
"HEADER_STRICT='
$(
HEADER_STRICT
)
'"
echo
"HEADER_DIRS='
$(
HEADER_STRICT
)
'"
...
...
@@ -215,9 +226,10 @@ headers.info:
echo
"HEADER_EXCEPTIONS='
$(
HEADER_EXCEPTIONS
)
'"
echo
"HEADER_REPO='
$(
HEADER_REPO
)
'"
echo
"HEADER_SPEC='
$(
HEADER_SPEC
)
'"
echo
"HDRCK='
$(
HDRCK
)
'"
echo
"HDRCK_SPEC='
$(
HDRCK_SPEC
)
'"
echo
"HDRCK_OPTS='
$(
HDRCK_OPTS
)
'"
echo
"HDRCK.HAS_GIT='
$(
HDRCK.HAS_GIT
)
'"
echo
"HDRCK.CMD='
$(
HDRCK.CMD
)
'"
echo
"HDRCK.SPEC='
$(
HDRCK.SPEC
)
'"
echo
"HDRCK.OPTS='
$(
HDRCK.OPTS
)
'"
###############################################################################
...
...
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