mirror of https://github.com/fredrikekre/Runic.jl
5 changed files with 24 additions and 26 deletions
@ -1,26 +1,18 @@ |
|||||||
JULIA ?= /opt/julia/julia-c/bin/julia |
JULIA ?= /opt/julia/julia-c/bin/julia |
||||||
JULIAC ?= $(shell $(JULIA) -e 'print(normpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "juliac.jl")))') |
JULIAC ?= $(shell $(JULIA) -e 'print(normpath(joinpath(Sys.BINDIR, Base.DATAROOTDIR, "julia", "juliac.jl")))') |
||||||
RUNIC_SRCFILES := $(wildcard ../src/*.jl) |
|
||||||
|
|
||||||
runicc: runicc.jl $(RUNIC_SRCFILES) invalidate-precompile-cache |
RUNIC_FILES := $(wildcard ../src/*.jl) ../Project.toml |
||||||
$(JULIA) $(JULIAC) --output-exe $@ --trim=unsafe-warn $< |
|
||||||
|
|
||||||
clean: |
runicc: runicc.jl Project.toml Manifest.toml $(RUNIC_FILES) |
||||||
rm runicc |
$(JULIA) --project=. $(JULIAC) --output-exe $@ --trim=unsafe-warn $< |
||||||
|
|
||||||
|
Manifest.toml: Project.toml ../Project.toml |
||||||
|
$(JULIA) --project=. -e 'using Pkg; Pkg.instantiate()' |
||||||
|
|
||||||
# Prune cached precompile files for Runic. This is needed because there are
|
clean: |
||||||
# (compile time) branches in the Runic source code which depends on whether
|
-rm -f runicc Manifest.toml |
||||||
# Runic is compiled or not. It looks like juliac will use existing cache files
|
|
||||||
# but not produce any so there is no need to prune them again after compilation
|
|
||||||
# to force regular usage to recompile.
|
|
||||||
invalidate-precompile-cache: |
|
||||||
$(JULIA) -e ' \
|
|
||||||
ji = Base.compilecache_path(Base.PkgId(Base.UUID("62bfec6d-59d7-401d-8490-b29ee721c001"), "Runic")); \
|
|
||||||
if ji !== nothing; \
|
|
||||||
isfile(ji) && (@info "Deleting precompile file $$(ji)"; rm(ji)); \
|
|
||||||
so = splitext(ji)[1] * "." * Base.BinaryPlatforms.platform_dlext(); \
|
|
||||||
isfile(so) && (@info "Deleting pkgimage file $$(so)"; rm(so)); \
|
|
||||||
end' |
|
||||||
|
|
||||||
|
print-%: |
||||||
|
@echo '$*=$($*)' |
||||||
|
|
||||||
.PHONY: invalidate-precompile-cache clean |
.PHONY: clean |
||||||
|
|||||||
@ -0,0 +1,8 @@ |
|||||||
|
[deps] |
||||||
|
Runic = "62bfec6d-59d7-401d-8490-b29ee721c001" |
||||||
|
|
||||||
|
[sources] |
||||||
|
Runic = {path = ".."} |
||||||
|
|
||||||
|
[preferences.Runic] |
||||||
|
juliac = true |
||||||
Loading…
Reference in new issue