Revision 4aa2697e433307fe5c25493c16d93f35ce9ca4d7 authored by Son HO on 01 September 2020, 11:59:04 UTC, committed by GitHub on 01 September 2020, 11:59:04 UTC
2 parent s b7867d2 + 7d6631d
Raw File
Makefile.opam
# Builds a source archive required for opam release in the current directory.
# The gcc-compatible snapshot is packaged as `hacl-star-raw`
# The OCaml bindings are packaged as `hacl-star`
#
# Before using, the version number needs to be set (to the same version) in
# 	* bindings/ocaml/hacl-star.opam
# 	* dist/hacl-star-raw.opam
# 	* dist/META
# and make sure the files in dist have been copied in dist/gcc-compatible
#
# A new `ocaml-vXX` Git tag should be created and the resulting archive uploaded to GitHub as a release.
# The opam-publish tool can be used to create a PR in ocaml/opam-repository to update the opam package:
#   `opam publish https://github.com/project-everest/hacl-star/releases/download/ocaml-vXX/hacl-star.XX.tar.gz`

VERSION=$(subst version: ,,$(shell grep "^version: " ../bindings/ocaml/hacl-star.opam))
ARCHIVE=$(subst VER,$(VERSION),hacl-star.VER.tar.gz)

all: release-hacl-star

prepare-raw:
	rm -rf raw && mkdir -p raw
	cp -r ../dist/gcc-compatible/* raw
	cp -r ../dist/kremlin raw
	sed -i 's/KREMLIN_HOME ?= ..\/kremlin/KREMLIN_HOME=kremlin/g' raw/Makefile
	make -C raw clean
	cd raw && rm -rf lib/*.cmx lib/*.cmi lib/*.cmo lib/*.o lib_gen/*.exe lib_gen/*.cmx lib_gen/*.cmi lib_gen/*.o libocamlevercrypt.a libevercrypt.so ocamlevercrypt.* dllocamlevercrypt.so

release-hacl-star: prepare-raw
	rm -rf hacl-star && mkdir -p hacl-star
	cp -r ../bindings/ocaml/* hacl-star
	rm -rf hacl-star/archive
	mv raw hacl-star/
	mv hacl-star/raw/hacl-star-raw.opam hacl-star/
	sed -i 's/make/make "-C" "raw"/g' hacl-star/hacl-star-raw.opam
	sed -i 's/"\.\/configure"/"sh" "-exc" "cd raw \&\& \.\/configure"/g' hacl-star/hacl-star-raw.opam
	cd hacl-star && dune clean
	cd hacl-star && tar -czvf ../$(ARCHIVE) .

clean:
	rm -rf raw hacl-star
back to top