From 4a881d2812d64381b6e83fde8882113a5a6dc676 Mon Sep 17 00:00:00 2001 From: Karolis Petrauskas Date: Sun, 24 Dec 2023 00:35:44 +0200 Subject: [PATCH] Make build more portable. Signed-off-by: Karolis Petrauskas --- deps/Makefile.post-install | 2 +- deps/isabelle/Makefile | 9 ++++----- deps/isabelle/dune | 6 +++--- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/deps/Makefile.post-install b/deps/Makefile.post-install index 700a9ebe..934b8608 100644 --- a/deps/Makefile.post-install +++ b/deps/Makefile.post-install @@ -1,3 +1,3 @@ all: chmod +x backends/bin/* - make -C backends -f Isabelle.post-install + cd backends && cat Isabelle.exec-files | xargs chmod +x diff --git a/deps/isabelle/Makefile b/deps/isabelle/Makefile index d05a6fbc..37c10717 100644 --- a/deps/isabelle/Makefile +++ b/deps/isabelle/Makefile @@ -31,7 +31,7 @@ PROJECT_ROOT=../.. CACHE_DIR=$(PROJECT_ROOT)/_build_cache -all: $(ISABELLE_DIR) $(ISABELLE_DIR)/src/TLA+ $(ISABELLE_DIR).no-links Isabelle.post-install +all: $(ISABELLE_DIR) $(ISABELLE_DIR)/src/TLA+ $(ISABELLE_DIR).no-links Isabelle.exec-files # Download the isabelle archive to the cache. $(CACHE_DIR)/$(ISABELLE_ARCHIVE): @@ -81,11 +81,10 @@ $(ISABELLE_DIR).no-links: $(ISABELLE_DIR) $(ISABELLE_DIR)/src/TLA+ # TODO: This is a workaround, because the dune install removes all the executable # flags (or sets on all the files). Here we generate a script to restore the flags. -Isabelle.post-install: $(ISABELLE_DIR).no-links - echo "FILES=$(shell find $(ISABELLE_DIR) -type f $(FIND_EXEC))" > $@ - echo "all:\n\t chmod +x \$$(FILES)" >> $@ +Isabelle.exec-files: $(ISABELLE_DIR).no-links + echo "$(shell find $(ISABELLE_DIR) -type f $(FIND_EXEC))" > $@ clean: - rm -rf $(ISABELLE_ARCHIVE) $(ISABELLE_DIR) $(ISABELLE_DIR).no-links Isabelle.post-install + rm -rf $(ISABELLE_ARCHIVE) $(ISABELLE_DIR) $(ISABELLE_DIR).no-links Isabelle.exec-files .PHONY: all clean diff --git a/deps/isabelle/dune b/deps/isabelle/dune index 963365f8..12ad3ce8 100644 --- a/deps/isabelle/dune +++ b/deps/isabelle/dune @@ -3,8 +3,8 @@ ; The generated heaps (Pure and TLA+) are in Isabelle/heaps/polyml-*/. (rule (deps "Makefile" (source_tree theories)) - (targets (dir Isabelle) "Isabelle.no-links" "Isabelle.post-install") - (action (run "make" "-C" "." "PROJECT_ROOT=%{project_root}" "Isabelle.no-links" "Isabelle.post-install"))) + (targets (dir Isabelle) "Isabelle.no-links" "Isabelle.exec-files") + (action (run "make" "-C" "." "PROJECT_ROOT=%{project_root}" "Isabelle.no-links" "Isabelle.exec-files"))) (install (section (site (tlapm backends))) @@ -12,4 +12,4 @@ (install (section (site (tlapm backends))) - (files ("Isabelle.post-install" as "Isabelle.post-install"))) + (files ("Isabelle.exec-files" as "Isabelle.exec-files")))