From b9dedea0998a51457a1670161c6631424a414b7d Mon Sep 17 00:00:00 2001 From: Josh Berdine Date: Thu, 7 May 2020 16:53:38 -0700 Subject: [PATCH] [sledge] Add fmt_all target to reformat no matter what dune thinks Summary: Dune does not track the ocamlformat binary as a dependency of the `fmt` rules, so when testing or upgrading ocamlformat, the existing `fmt` target is not reliable. Reviewed By: jvillard Differential Revision: D21441539 fbshipit-source-id: 40bea4447 --- sledge/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/sledge/Makefile b/sledge/Makefile index ccecdf939..5b9535ed0 100644 --- a/sledge/Makefile +++ b/sledge/Makefile @@ -71,6 +71,13 @@ fmt: clang-format -i model/llair_intrinsics.h model/cxxabi.cpp ${MAKE} -C test fmt +OCAMLFORMAT_EXE = ocamlformat +OCAMLFORMAT_ARGS = + +.PHONY: fmt_all +fmt_all: + parallel $(OCAMLFORMAT_EXE) $(OCAMLFORMAT_ARGS) -i ::: $(shell find * \( -name _build -or -name llvm \) -not -prune -or \( -name '*'.ml -or -name '*'.mli \) -print 2>/dev/null) + # print any variable for Makefile debugging print-%: @printf '$*='; printf '$($*)'; printf '\n'