https://gitlab.com/tezos/tezos
Revision 390ed13f40946dd158221e6c232610f34de9ad5b authored by Marge Bot on 15 May 2023, 22:34:03 UTC, committed by Marge Bot on 15 May 2023, 22:34:03 UTC
Co-authored-by: Jun Furuse <jun.furuse@dailambda.jp>

Approved-by: satos <sota.sato@dailambda.jp>
Approved-by: Nicolas Ayache <nicolas.ayache@nomadic-labs.com>
Approved-by: Jun Furuse <jun.furuse@gmail.com>

See merge request https://gitlab.com/tezos/tezos/-/merge_requests/8151
2 parent s b23c83a + 414ccd6
Raw File
Tip revision: 390ed13f40946dd158221e6c232610f34de9ad5b authored by Marge Bot on 15 May 2023, 22:34:03 UTC
Merge tezos/tezos!8151: Snoop: adds auto-build sub-command
Tip revision: 390ed13
Makefile
# To be able to bootstrap this, we don't use any tool to build (not dune in particular).
# This allows to run this before make build-deps as long as OCaml is installed.

SOURCE=JSON_AST.ml JSON_parser.mli JSON_parser.ml JSON_lexer.ml tezos_protocol.ml manifest.mli manifest.ml main.mli main.ml

.PHONY: all
all: manifest
	(cd .. && manifest/manifest)

_build/JSON_parser.ml _build/JSON_parser.mli: _build/JSON_parser.mly
	ocamlyacc $^

_build/JSON_lexer.ml: _build/JSON_lexer.mll
	ocamllex $^

# We compile files in the _build directory.
# But we prepend them with an OCaml compiler directive that ensures
# error messages are localized in the source directory.
_build/%: %
	@mkdir -p _build
	echo "# 1 \"$*\"" > $@
	cat $* >> $@

manifest: $(foreach file, $(SOURCE), _build/$(file))
	ocamlc -bin-annot -g -w @1..3@5..28@30..39@43@46..47@49..57@61..62 \
		-I _build str.cma $^ -o manifest

# Used in the CI.
.PHONY: check
check: all
	@git status | grep "nothing to commit" > /dev/null || ( \
	  echo "Repository not clean after 'make -C manifest'."; \
	  echo "You should not edit generated dune and .opam files directly."; \
	  echo "Edit manifest/main.ml instead."; \
	  echo "Then run 'make -C manifest' and commit the difference."; \
	  exit 1 \
	)

.PHONY: clean
clean:
	rm -rf _build manifest
back to top