Skip to content

Commit

Permalink
Make build more portable.
Browse files Browse the repository at this point in the history
Signed-off-by: Karolis Petrauskas <[email protected]>
  • Loading branch information
kape1395 committed Dec 23, 2023
1 parent 512d89d commit 4a881d2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion deps/Makefile.post-install
Original file line number Diff line number Diff line change
@@ -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
9 changes: 4 additions & 5 deletions deps/isabelle/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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
6 changes: 3 additions & 3 deletions deps/isabelle/dune
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
; 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)))
(dirs Isabelle))

(install
(section (site (tlapm backends)))
(files ("Isabelle.post-install" as "Isabelle.post-install")))
(files ("Isabelle.exec-files" as "Isabelle.exec-files")))

0 comments on commit 4a881d2

Please sign in to comment.