SIGN IN SIGN UP
reasonml / reason UNCLAIMED

Simple, fast & type safe code that leverages the JavaScript & OCaml ecosystems

0 0 163 OCaml
2016-02-19 16:36:03 -08:00
# Portions Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
2016-05-22 01:23:48 +03:00
SHELL=bash -o pipefail
default: build test
setup_convenient_bin_links:
mkdir -p $(shell pwd)/_build/bin
ln -fs $(shell pwd)/_build/src/refmt_impl.native $(shell pwd)/_build/bin/refmt
ln -fs $(shell pwd)/_build/_reasonbuild/_build/myocamlbuild $(shell pwd)/_build/bin/reasonbuild
ln -fs $(shell pwd)/_build/src/ocamlmerlin_reason.native $(shell pwd)/_build/bin/ocamlmerlin-reason
ln -fs $(shell pwd)/_build/src/reason_format_type.native $(shell pwd)/_build/bin/refmttype
ln -fs $(shell pwd)/_build/src/rebuild.sh $(shell pwd)/_build/bin/rebuild
ln -fs $(shell pwd)/_build/src/redoc.sh $(shell pwd)/_build/bin/redoc
ln -fs $(shell pwd)/_build/src/refmt_impl.native $(shell pwd)/_build/bin/refmt
ln -fs $(shell pwd)/_build/src/refmt_merlin_impl.sh $(shell pwd)/_build/bin/refmt_merlin
ln -fs $(shell pwd)/_build/src/reopt.sh $(shell pwd)/_build/bin/reopt
ln -fs $(shell pwd)/_build/src/rec.sh $(shell pwd)/_build/bin/rec
ln -fs $(shell pwd)/_build/src/share.sh $(shell pwd)/_build/bin/share
ln -fs $(shell pwd)/_build/src/reup.sh $(shell pwd)/_build/bin/reup
2017-03-10 16:34:25 -08:00
precompile:
cp pkg/META.in pkg/META
ocamlbuild -package topkg pkg/build.native
build_without_utop: setup_convenient_bin_links precompile
./build.native build --utop false
chmod +x $(shell pwd)/_build/src/*.sh
ln -fs $(shell pwd)/_build/src/refmt_merlin_impl.sh refmt_merlin_impl.sh
build: setup_convenient_bin_links precompile
./build.native build --utop true
chmod +x $(shell pwd)/_build/src/*.sh
2016-04-20 14:23:56 -07:00
ln -fs $(shell pwd)/_build/src/refmt_merlin_impl.sh refmt_merlin_impl.sh
2016-02-19 16:36:03 -08:00
install:
opam pin add reason . -y
./refmt_impl.native --help=groff > $(shell opam config var man)/man1/refmt.1
2016-02-19 16:36:03 -08:00
run: build
rlwrap ocaml \
$(shell ocamlfind query -predicates byte,toploop -r -a-format \
findlib compiler-libs.common unix) \
_build/src/reason.cma _build/src/reason_toploop.cmo
run_utop: build
utop \
$(shell ocamlfind query -predicates byte,toploop -r -a-format \
compiler-libs.common) \
_build/src/reason.cma _build/src/reason_utop.cmo
test: build clean-tests
./miscTests/rtopIntegrationTest.sh
./miscTests/jsxPpxTest.sh
2016-02-19 16:36:03 -08:00
cd formatTest; ./test.sh
clean-tests:
rm -rf ./formatTest/**/actual_output
rm -f ./formatTest/failed_tests
clean: clean-tests
2016-02-19 16:36:03 -08:00
ocamlbuild -clean
.PHONY: build clean
2016-02-19 16:36:03 -08:00
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
SUBSTS:=$(ROOT_DIR)/pkg/substs
pre_release:
ifndef version
$(error environment variable 'version' is undefined)
endif
export git_version="$(shell git rev-parse --verify HEAD)"; \
export git_short_version="$(shell git rev-parse --short HEAD)"; \
$(SUBSTS) $(ROOT_DIR)/package.json.in; \
$(SUBSTS) $(ROOT_DIR)/package.ml.in; \
$(SUBSTS) $(ROOT_DIR)/opam.in
.PHONY: pre_release
release_check:
2017-02-27 10:00:06 -08:00
./scripts/release-check.sh
release: release_check pre_release
git add package.json package.ml opam
git commit -m "Version $(version)"
git tag -a $(version) -m "Version $(version)."
git push "git@github.com:facebook/Reason.git" tag $(version)
2016-10-16 11:12:24 -07:00
git clean -fdx
npm publish --access public
./scripts/opam-release.sh
2016-02-19 16:36:03 -08:00
.PHONY: release