Browse Source

juliac: check whether the configured julia binary supports trimming

pull/57/head
Fredrik Ekre 1 year ago
parent
commit
b78cfc1a61
No known key found for this signature in database
GPG Key ID: DE82E6D5E364C0A2
  1. 14
      juliac/Makefile

14
juliac/Makefile

@ -1,9 +1,9 @@ @@ -1,9 +1,9 @@
JULIA ?= /opt/julia/julia-c/bin/julia
JULIA ?= $(shell which julia)
JULIAC ?= $(shell $(JULIA) -e 'print(normpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "juliac.jl")))')
RUNIC_FILES := $(wildcard ../src/*.jl) ../Project.toml
runicc: runicc.jl Project.toml Manifest.toml $(RUNIC_FILES)
runicc: runicc.jl Project.toml Manifest.toml $(RUNIC_FILES) check-julia
$(JULIA) --project=. $(JULIAC) --output-exe $@ --trim=unsafe-warn $<
Manifest.toml: Project.toml ../Project.toml
@ -13,7 +13,15 @@ Manifest.toml: Project.toml ../Project.toml @@ -13,7 +13,15 @@ Manifest.toml: Project.toml ../Project.toml
clean:
-rm -f runicc Manifest.toml
check-julia:
@if ! $(JULIA) --help-hidden | grep -s -q '\-\-trim'; then \
echo "ERROR: The configured julia binary ($(JULIA)) does not support the --trim argument."; \
echo " Configure the binary using the JULIA variable (e.g. \`JULIA=/path/to/julia make ...\`)"; \
echo " or change how \`julia\` resolves in \`PATH\`."; \
exit 1; \
fi
print-%:
@echo '$*=$($*)'
.PHONY: clean
.PHONY: clean check-julia

Loading…
Cancel
Save