Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
COLIBRI
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
pub
COLIBRI
Commits
383bdf22
Commit
383bdf22
authored
1 year ago
by
Christophe Junke
Browse files
Options
Downloads
Patches
Plain Diff
reorganize scripts as Makefile rules
parent
387a1107
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!42
Cleanup build scripts and git repository
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
Makefile
+134
-15
134 additions, 15 deletions
Makefile
bundle.sh
+0
-13
0 additions, 13 deletions
bundle.sh
with
134 additions
and
28 deletions
Makefile
+
134
−
15
View file @
383bdf22
.PHONY
:
build install
PREFIX
=
ECLIPSEBIN
=
build
:
rm
-f
Src/COLIBRI/lib/v7/x86_64_linux/
*
Src/COLIBRI/simplex_ocaml.pl
(
cd
Src/COLIBRI/simplex_ocaml
;
ECLIPSEBIN
=
$(
ECLIPSEBIN
)
dune build simplex_ocaml_mod_v7.so simplex_ocaml.pl
)
(
cd
Src/COLIBRI/simplex_ocaml
;
cp
_build/default/simplex_ocaml.pl ..
)
mkdir
-p
Src/COLIBRI/lib/v7/x86_64_linux
(
cd
Src/COLIBRI/simplex_ocaml
;
cp
_build/default/simplex_ocaml_mod_v7.so ../lib/v7/x86_64_linux/simplex_ocaml.so
)
(
cd
Src/Floats
;
g++
-fPIC
-O
-D__LINUX__
-I
$(
ECLIPSEBIN
)
/include/x86_64_linux
-shared
EclipseInterfaceSimFloat2.2.cpp Floatcpp-3.0_SimFloat2.2.cpp
-o
../COLIBRI/lib/v7/x86_64_linux/float_util.so
)
ocamlopt
-o
compile_colibri unix.cmxa compile_colibri.ml
.PHONY
:
all install clean clean_install simplex simplex_epilog
# Bundle prefix, override to specify a different directory
BUNDLE
?=
$(
PWD
)
/bundle
# Which eclipse version to use, among {v5|v7}
# (v5 is currently broken)
ECL_VERSION
?=
v7
all
:
build
# ==================================================
# MACRO
# ==================================================
# Target of copy dependencies are added to this variable.
COPY_DEPS
:=
define
add_copy_rule
COPY_DEPS
+=
$(
2
)
$(2)
:
$(1)
mkdir
-p
$(
dir
$(
2
))
cp
$(
1
)
$(
2
)
endef
# Add a rule to copy a file from a source to a destination, while
# ensuring that the target directory exists.
#
# $(1): source
# $(2): destination
#
define
require_copy
$(
eval
$(
call add_copy_rule,
$(
1
)
,
$(
2
)))
endef
# ==================================================
# CONFIGURATION
# ==================================================
ROOT
:=
$(
realpath
Src/
)
COLIBRI
:=
$(
ROOT
)
/COLIBRI
SIMPLEX_BUILD
:=
$(
COLIBRI
)
/simplex_ocaml/_build/default
$(
call
require_copy,
$(
SIMPLEX_BUILD
)
/simplex_ocaml.pl,
$(
COLIBRI
)
/simplex_ocaml.pl
)
ifeq
($(ECL_VERSION),v7)
export
ECLIPSEBIN
=
$(
PWD
)
/Bin/ECLIPSE_V7.0_45
LIBDIR
=
$(
COLIBRI
)
/lib/v7
SIMPLEX
:=
simplex_ocaml_mod_v7.so
FLOAT_LIB
:=
$(
LIBDIR
)
/x86_64_linux/float_util.so
$(
call
require_copy,
$(
SIMPLEX_BUILD
)
/simplex_ocaml_mod_v7.so,
$(
LIBDIR
)
/x86_64_linux/simplex_ocaml.so
)
endif
ifeq
($(ECL_VERSION),v5)
export
ECLIPSEBIN
=
LIBDIR
=
$(
COLIBRI
)
/lib/v5
SIMPLEX
:=
simplex_ocaml_mod.so
FLOAT_LIB
:=
$(
LIBDIR
)
/x86_64_linux/float_util.so
$(
call
require_copy,
$(
SIMPLEX_BUILD
)
/simplex_ocaml_mod.so,
$(
LIBDIR
)
/x86_64_linux/simplex_ocaml.so
)
endif
# ==================================================
# INFOS
# ==================================================
$(info
BUNDLE
=
$(
BUNDLE
)
)
$(info
ECL_VERSION
=
$(
ECL_VERSION
)
)
$(info
COLIBRI
=
$(
COLIBRI
)
)
$(info
ECLIPSEBIN
=
$(
ECLIPSEBIN
)
)
# ==================================================
# SIMPLEX_OCAML
# ==================================================
simplex
:
$(ECLIPSEBIN)
cd
$(
COLIBRI
)
/simplex_ocaml
&&
dune build
$(
SIMPLEX
)
simplex_ocaml.pl
simplex_epilog
:
simplex $(COPY_DEPS)
@
true
# ==================================================
# FLOAT LIBRARY
# ==================================================
CPP_FLAGS
:=
-fPIC
-O
-D__LINUX__
-shared
CPP_FLAGS
+=
-I
$(
ECLIPSEBIN
)
/include/x86_64_linux
CPP_FILES
:=
\
$(
ROOT
)
/Floats/EclipseInterfaceSimFloat2.2.cpp
\
$(
ROOT
)
/Floats/Floatcpp-3.0_SimFloat2.2.cpp
$(FLOAT_LIB)
:
$(CPP_FILES)
g++
$(
CPP_FLAGS
)
$(
CPP_FILES
)
-o
$@
# ==================================================
# BUILD
# ==================================================
clean
:
rm
-rf
$(
LIBDIR
)
rm
-f
$(
COLIBRI
)
/simplex_ocaml.pl
rm
-f
$(
FLOAT_LIB
)
rm
-f
compile_colibri
compile_colibri
:
compile_colibri.ml
ocamlopt
-o
$@
unix.cmxa
$^
build
:
simplex_epilog $(FLOAT_LIB) compile_colibri
./compile_colibri
--eclipsedir
$(
ECLIPSEBIN
)
install
:
./bundle.sh
$(
PREFIX
)
# ==================================================
# INSTALL
# ==================================================
BUNDLE_SRC
:=
\
Src/COLIBRI/col_solve.eco
\
Src/COLIBRI/filter_smtlib_file
\
Src/COLIBRI/filter_smtlib_file.exe
$(BUNDLE)/colibri.exe
:
colibri_for_bundle.ml
ocamlopt
-o
$@
unix.cmxa
$^
chmod
u+x
$@
clean_install
:
rm
-fr
$(
BUNDLE
)
$(BUNDLE)
:
mkdir
-p
$(
BUNDLE
)
install
:
$(BUNDLE) $(BUNDLE)/colibri.exe
cp
$(
BUNDLE
)
/colibri.exe
$(
BUNDLE
)
/colibri
mkdir
-p
$(
BUNDLE
)
/COLIBRI/lib/
cp
-ra
$(
LIBDIR
)
$(
BUNDLE
)
/COLIBRI/lib/
cp
-ra
$(
BUNDLE_SRC
)
$(
BUNDLE
)
/COLIBRI/
cp
-ra
compile_flag.pl
$(
BUNDLE
)
/COLIBRI/
cp
-ra
version
$(
BUNDLE
)
/
cp
-ra
$(
ECLIPSEBIN
)
$(
BUNDLE
)
/ECLIPSE/
This diff is collapsed.
Click to expand it.
bundle.sh
deleted
100755 → 0
+
0
−
13
View file @
387a1107
#!/bin/sh
PREFIX
=
$1
rm
-fr
$PREFIX
mkdir
-p
$PREFIX
/COLIBRI/lib/
cp
-ra
Src/COLIBRI/lib/v7
$PREFIX
/COLIBRI/lib/
cp
-ra
Src/COLIBRI/col_solve.eco Src/COLIBRI/filter_smtlib_file Src/COLIBRI/filter_smtlib_file.exe
$PREFIX
/COLIBRI/
cp
-ra
compile_flag.pl
$PREFIX
/COLIBRI/
cp
-ra
version
$PREFIX
/
ocamlopt unix.cmxa
-o
$PREFIX
/colibri.exe colibri_for_bundle.ml
cp
$PREFIX
/colibri.exe
$PREFIX
/colibri
chmod
u+x
$PREFIX
/colibri
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