From 0b67e4fcc4af4c97586bd87c80d3d4595c02d6a5 Mon Sep 17 00:00:00 2001 From: Jason Gross Date: Wed, 30 Mar 2022 14:21:34 -0400 Subject: [PATCH] Use find for .v files when building without git (#55) Fixes #54 For https://github.com/coq/opam-coq-archive/pull/2137 --- Makefile | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index edf33c24..1ad5e50f 100644 --- a/Makefile +++ b/Makefile @@ -4,9 +4,16 @@ LIBDIR := $(shell cygpath -m "$$(pwd)" 2>/dev/null || pwd)/src/Rupicola/Lib ALLDIR := $(shell cygpath -m "$$(pwd)" 2>/dev/null || pwd)/src/Rupicola +# use git ls-files if we can to avoid building non-checked-in cruft; +# use find when building from a tarball +ifneq (,$(wildcard .git/)) +find_vs = $(shell git ls-files "$(1)/*.v") +else +find_vs = $(shell find "$(1)" -type f -name '*.v') +endif # absolute paths so that emacs compile mode knows where to find error -VS_LIB:=$(abspath $(shell git ls-files "$(LIBDIR)/*.v")) -VS_ALL:=$(abspath $(shell git ls-files "$(ALLDIR)/*.v")) +VS_LIB:=$(abspath $(call find_vs,$(LIBDIR))) +VS_ALL:=$(abspath $(call find_vs,$(ALLDIR))) all: Makefile.coq $(VS_ALL) rm -f .coqdeps.d