-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathMakefile
32 lines (24 loc) · 1.42 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
.PHONY: all environment compile-models clean
# Assuming 'all' should build everything. If 'environment' is a task that should be run,
# you need to add a corresponding recipe for it.
all: compile-models
# MODEL_SOURCES will find all .ttl files in the models directory.
MODEL_SOURCES := $(wildcard models/*.ttl)
# COMPILED_MODELS will be the list of files but in the models/compiled folder.
COMPILED_MODELS := $(patsubst models/%.ttl,models/compiled/%.ttl,$(MODEL_SOURCES))
.ontoenv:
ontoenv init models ontologies
# Rule to compile each model.
# The prerequisite 'models/%.ttl' means it will match each .ttl file in the models directory.
# 'tools/compile.py' ensures the compile script is present, but should be a prerequisite only if you want to track changes on it.
# 'ontologies/*.ttl' captures changes in any .ttl file in the ontologies directory.
models/compiled/%.ttl: models/%.ttl tools/compile.py .ontoenv
#ontoenv refresh
-uv run python tools/compile.py -r -i -o $@ $<
# The compile-models target will "make" all of the COMPILED_MODELS.
compile-models: $(COMPILED_MODELS)
install-kernel:
python -m ipykernel install --user --name=python3
# Rule to clean up the compiled models.
clean:
rm -rf models/compiled/*.ttl .ontoenv