diff --git a/ivette/Makefile b/ivette/Makefile index cefa700bb4bedc2794841313cbecbace333f60ac..43855397156de5c6cab553abccabc14e41164f7d 100644 --- a/ivette/Makefile +++ b/ivette/Makefile @@ -31,13 +31,16 @@ DOME_CUSTOM_ENTRIES= yes COPYRIGHT=CEA LIST / LSL # -------------------------------------------------------------------------- -.PHONY: all app dev pkg doc serve dist lint fixlint checkcase +# -------------------------------------------------------------------------- +# --- Ivette Compilation +# -------------------------------------------------------------------------- + +.PHONY: all app dev lint checkcase tsc all: pkg lint app app: dome-app dev: dome-dev -dist: dist-dir dome-dist lint: dome-pkg dome-templ checkcase @echo "[Ivette] running typechecker & linter" @@ -68,10 +71,24 @@ help:: @echo "Ivette installation configuration variables" @echo " - PREFIX: used to customize installation path" +# -------------------------------------------------------------------------- +# --- Ivette Distribution +# -------------------------------------------------------------------------- + +.PHONY: dist dist-dir + +dist-dir: + @echo "Cleaning dist" + @rm -fr dist + +dist: dist-dir dome-dist + # -------------------------------------------------------------------------- # --- Ivette Package Loader # -------------------------------------------------------------------------- +.PHONY: pkg + LOADER=src/renderer/loader.ts SANDBOX=src/renderer/sandbox.ts PACKAGES=$(shell find src -name "pkg.json") @@ -158,6 +175,8 @@ include $(DOME)/template/makefile # --- Ivette Installation # -------------------------------------------------------------------------- +.PHONY: install + BINDIR=$(PREFIX)/bin LIBDIR=$(PREFIX)/lib @@ -189,8 +208,7 @@ endif IVETTE_DIST=$(wildcard dist/linux-unpacked dist/mac dist/mac-arm64) -ifdef LIBDIR -ifdef BINDIR +ifdef PREFIX ifeq ($(IVETTE_DIST),dist/linux-unpacked) install: @@ -217,15 +235,19 @@ install: @exit 1 endif -endif +else + +install: + @echo "PREFIX not defined" + @exit 1 + endif # -------------------------------------------------------------------------- # --- Ivette Un-Installation # -------------------------------------------------------------------------- -ifdef LIBDIR -ifdef BINDIR +ifdef PREFIX uninstall: @echo "Uninstall Ivette" @@ -235,6 +257,5 @@ uninstall: @rm -f $(BINDIR)/ivette endif -endif # -------------------------------------------------------------------------- diff --git a/ivette/ivette-opam.sh b/ivette/ivette-opam.sh new file mode 100755 index 0000000000000000000000000000000000000000..da24175d949f06035cb71839333d3e3f9d725ac0 --- /dev/null +++ b/ivette/ivette-opam.sh @@ -0,0 +1,90 @@ +#!/bin/zsh +########################################################################## +# # +# This file is part of Frama-C. # +# # +# Copyright (C) 2007-2022 # +# CEA (Commissariat à l'énergie atomique et aux énergies # +# alternatives) # +# # +# you can redistribute it and/or modify it under the terms of the GNU # +# Lesser General Public License as published by the Free Software # +# Foundation, version 2.1. # +# # +# It is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU Lesser General Public License for more details. # +# # +# See the GNU Lesser General Public License version 2.1 # +# for more details (enclosed in the file licenses/LGPLv2.1). # +# # +########################################################################## + +echo "Building Ivette" +PWD=`pwd` + +# -------------------------------------------------------------------------- +echo "[1/3] Configuring" +# -------------------------------------------------------------------------- + +NODEJS=`node --version` +case $NODEJS in + v16.*) + echo " - node $NODEJS found" + ;; + *) + echo "Ivette requires node version 16 to be installed." + echo "Tip: install nvm and run 'nvm use 16'" + exit 1 ;; +esac + +SELF=`dirname $0` +cd $SELF/.. +PREFIX=`pwd` + +if [ -f $PREFIX/lib/frama-c/ivette.tgz ] +then + echo " - prefix $PREFIX" +else + echo "Ivette archive not found ($PREFIX)" + exit 1 +fi + +# -------------------------------------------------------------------------- +echo "[2/3] Compiling Ivette" +# -------------------------------------------------------------------------- + +TMPDIR=`mktemp -d -t ivette` +cd $TMPDIR +tar zxf $PREFIX/lib/frama-c/ivette.tgz +cd ivette +make dist +if [ "$?" != "0" ] +then + echo "Compilation Failed" + rm -fr $TMPDIR + exit 2 +fi + +# -------------------------------------------------------------------------- +echo "[3/3] Finalizing Installation" +# -------------------------------------------------------------------------- + +make PREFIX=$PREFIX install +if [ "$?" != "0" ] +then + echo "Installation Failed" + rm -fr $TMPDIR + exit 3 +fi +cd $PWD +rm -fr $TMPDIR +rm -f $PREFIX/lib/frama-c/ivette.tgz + +# -------------------------------------------------------------------------- +echo "Launching Ivette..." +# -------------------------------------------------------------------------- +exec $PREFIX/bin/ivette $* + +# -------------------------------------------------------------------------- diff --git a/opam/opam b/opam/opam index 73a337edef9c7df53ff31ab401769c9f4b6ed1de..292d092707476bfc4a7ccdb8e5106ec5b50d0ddd 100644 --- a/opam/opam +++ b/opam/opam @@ -94,6 +94,7 @@ build: [ install: [ [make "PREFIX=%{prefix}%" "MANDIR=%{mandir}%" "install"] [make "PREFIX=%{prefix}%" "-C" "doc" "install"] {with-doc} + [make "PREFIX=%{prefix}%" "-f" "ivette/makefile.install"] ] run-test: [