Skip to content

Commit b7d4757

Browse files
committed
Update Makefile
1 parent 8970b09 commit b7d4757

1 file changed

Lines changed: 10 additions & 4 deletions

File tree

Makefile

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,10 @@ JENA_VERSION := 6.0.0
2929
JENA_DIR := apache-jena-$(JENA_VERSION)
3030
JENA_ARCHIVE := $(JENA_DIR).tar.gz
3131
JENA_URL := https://archive.apache.org/dist/jena/binaries/$(JENA_ARCHIVE)
32-
RIOT := ./$(JENA_DIR)/bin/riot
32+
LOCAL_RIOT := ./$(JENA_DIR)/bin/riot
33+
34+
# Use system riot if available, otherwise fall back to local
35+
RIOT := $(shell command -v riot 2>/dev/null || echo "$(LOCAL_RIOT)")
3336

3437
### Configuration
3538

@@ -108,15 +111,18 @@ registry/obo_context.jsonld: registry/ontologies.yml
108111
registry/obo_prefixes.ttl: registry/ontologies.yml
109112
./util/make-shacl-prefixes.py $< > $@.tmp && mv $@.tmp $@
110113

111-
# Download and extract Jena
112-
$(RIOT): $(JENA_DIR)/bin/riot
113-
$(JENA_DIR)/bin/riot: $(JENA_ARCHIVE)
114+
# Only built if RIOT resolved to the local path
115+
$(LOCAL_RIOT): $(JENA_ARCHIVE)
114116
tar -xzf $(JENA_ARCHIVE)
115117
touch $@
116118

117119
$(JENA_ARCHIVE):
118120
curl -fL $(JENA_URL) -o $(JENA_ARCHIVE)
119121

122+
# If RIOT is the system one, this is a no-op (file already exists)
123+
$(shell command -v riot 2>/dev/null):
124+
@true
125+
120126
# Use Apache-Jena RIOT to convert jsonld to n-triples
121127
# NOTE: UGLY HACK. If there is a problem then Jena will write WARN message (to stdout!!!), there appears to
122128
# be no way to get it to flag this even with strict and check options, so we do a check with grep, ugh.

0 commit comments

Comments
 (0)