2016-02-19 16:36:03 -08:00
|
|
|
# Portions Copyright (c) 2015-present, Facebook, Inc. All rights reserved.
|
2016-03-03 07:59:12 +01:00
|
|
|
|
2016-05-22 01:23:48 +03:00
|
|
|
SHELL=bash -o pipefail
|
2016-05-09 14:08:55 -07:00
|
|
|
|
2016-03-03 07:59:12 +01:00
|
|
|
default: build test
|
|
|
|
|
|
2016-07-08 00:44:44 -07:00
|
|
|
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
|
2016-08-29 15:43:42 -07:00
|
|
|
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
|
2016-07-08 00:44:44 -07:00
|
|
|
ln -fs $(shell pwd)/_build/src/reup.sh $(shell pwd)/_build/bin/reup
|
|
|
|
|
|
2017-03-10 16:34:25 -08:00
|
|
|
precompile:
|
2016-07-04 23:17:56 -07:00
|
|
|
cp pkg/META.in pkg/META
|
2017-03-10 15:19:20 -08:00
|
|
|
ocamlbuild -package topkg pkg/build.native
|
|
|
|
|
|
2017-03-22 17:36:47 -07:00
|
|
|
build_without_utop: setup_convenient_bin_links precompile
|
2017-03-10 15:19:20 -08:00
|
|
|
./build.native build --utop false
|
2016-07-12 15:39:19 -07:00
|
|
|
chmod +x $(shell pwd)/_build/src/*.sh
|
2016-07-04 23:17:56 -07:00
|
|
|
ln -fs $(shell pwd)/_build/src/refmt_merlin_impl.sh refmt_merlin_impl.sh
|
|
|
|
|
|
2017-03-22 17:36:47 -07:00
|
|
|
build: setup_convenient_bin_links precompile
|
2017-03-10 15:19:20 -08:00
|
|
|
./build.native build --utop true
|
2016-07-12 15:39:19 -07:00
|
|
|
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
|
2017-01-25 17:34:04 -08:00
|
|
|
./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
|
|
|
|
|
|
2016-12-12 20:39:02 -08:00
|
|
|
test: build clean-tests
|
2016-08-11 22:57:48 -07:00
|
|
|
./miscTests/rtopIntegrationTest.sh
|
2016-09-23 20:00:09 -07:00
|
|
|
./miscTests/jsxPpxTest.sh
|
2016-02-19 16:36:03 -08:00
|
|
|
cd formatTest; ./test.sh
|
|
|
|
|
|
2016-12-12 20:39:02 -08:00
|
|
|
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
|
|
|
|
|
|
2017-03-22 17:36:47 -07:00
|
|
|
.PHONY: build clean
|
2016-02-19 16:36:03 -08:00
|
|
|
|
2016-10-03 00:20:19 -07:00
|
|
|
ROOT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
|
|
|
|
SUBSTS:=$(ROOT_DIR)/pkg/substs
|
|
|
|
|
|
2017-01-27 09:55:12 -08:00
|
|
|
pre_release:
|
2016-10-03 00:20:19 -07:00
|
|
|
ifndef version
|
2017-03-22 17:36:47 -07:00
|
|
|
$(error environment variable 'version' is undefined)
|
2016-10-03 00:20:19 -07:00
|
|
|
endif
|
2017-01-19 15:35:31 -08:00
|
|
|
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; \
|
2016-10-03 00:20:19 -07:00
|
|
|
$(SUBSTS) $(ROOT_DIR)/opam.in
|
2017-01-19 15:35:31 -08:00
|
|
|
|
2017-01-27 09:55:12 -08:00
|
|
|
.PHONY: pre_release
|
2017-01-19 15:35:31 -08:00
|
|
|
|
2017-02-21 14:39:00 -08:00
|
|
|
release_check:
|
2017-02-27 10:00:06 -08:00
|
|
|
./scripts/release-check.sh
|
2017-02-21 14:39:00 -08:00
|
|
|
|
|
|
|
|
release: release_check pre_release
|
2017-01-19 15:35:31 -08:00
|
|
|
git add package.json package.ml opam
|
2016-10-03 00:20:19 -07:00
|
|
|
git commit -m "Version $(version)"
|
|
|
|
|
git tag -a $(version) -m "Version $(version)."
|
2017-03-10 16:52:13 -08:00
|
|
|
git push "git@github.com:facebook/Reason.git" tag $(version)
|
2016-10-16 11:12:24 -07:00
|
|
|
git clean -fdx
|
2016-10-03 00:20:19 -07:00
|
|
|
npm publish --access public
|
2017-03-22 17:36:47 -07:00
|
|
|
./scripts/opam-release.sh
|
2016-02-19 16:36:03 -08:00
|
|
|
|
|
|
|
|
.PHONY: release
|