Makefile 1.18 KB
Newer Older
Andy Li's avatar
Andy Li committed
1 2 3 4

all: build test

build:
Andy Li's avatar
Andy Li committed
5
	@dune build @install
Andy Li's avatar
Andy Li committed
6 7

test:
Andy Li's avatar
Andy Li committed
8
	@dune runtest --no-buffer
Andy Li's avatar
Andy Li committed
9 10

clean:
Andy Li's avatar
Andy Li committed
11
	@dune clean
Andy Li's avatar
Andy Li committed
12 13

doc:
Andy Li's avatar
Andy Li committed
14
	@dune build @doc
Andy Li's avatar
Andy Li committed
15

Andy Li's avatar
Andy Li committed
16 17
example-test:
	@dune exec example/ounit/QCheck_test.exe
Andy Li's avatar
Andy Li committed
18

Andy Li's avatar
Andy Li committed
19 20 21 22 23 24 25 26
example-ounit-test:
	@dune exec example/ounit/QCheck_ounit_test.exe

example-runner:
	@dune exec example/QCheck_runner_test.exe

example-alcotest:
	@dune exec example/alcotest/QCheck_alcotest_test.exe
Andy Li's avatar
Andy Li committed
27 28 29 30 31

VERSION=$(shell awk '/^version:/ {print $$2}' qcheck.opam)

update_next_tag:
	@echo "update version to $(VERSION)..."
Andy Li's avatar
Andy Li committed
32 33
	sed -i "s/NEXT_VERSION/$(VERSION)/g" `find src -name '*.ml' -or -name '*.mli'`
	sed -i "s/NEXT_RELEASE/$(VERSION)/g" `find src -name '*.ml' -or -name '*.mli'`
Andy Li's avatar
Andy Li committed
34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49

release: update_next_tag
	@echo "release version $(VERSION)..."
	git tag -f $(VERSION) ; git push origin :$(VERSION) ; git push origin $(VERSION)
	opam publish prepare https://github.com/c-cube/qcheck/archive/$(VERSION).tar.gz
	@echo "review the release, then type 'opam publish submit qcheck.$(VERSION)/'"


watch:
	while find src/ -print0 | xargs -0 inotifywait -e delete_self -e modify ; do \
		echo "============ at `date` ==========" ; \
		sleep 0.2; \
		make all; \
	done

.PHONY: benchs tests examples update_next_tag watch release