-
Notifications
You must be signed in to change notification settings - Fork 1
/
Makefile
69 lines (56 loc) · 2.09 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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
## --------------------------
## Adjust if and as necessary
## --------------------------
ROBOT = ./bin/robot
DEPLOY_PATH = ./docs
ONTS = $(wildcard *.ofn)
PROFILES = Full DL EL RL QL
CATALOG = catalog-for-checks.xml
## --------------------------
## The following should adjust automatically.
## --------------------------
ROBOT_VERSION = `$(ROBOT) -V`
VERSIONED_ONTS = $(shell grep versionIRI *.owl | sed -e 's;.*phyloref.org/\(.*\)"/>;\1;')
VERSIONED_TARGETS = $(addprefix $(DEPLOY_PATH)/,$(VERSIONED_ONTS))
REPORTS = $(foreach f,$(ONTS:.ofn=.IsIn),$(addprefix $(f),$(PROFILES)))
## --------------------------
## Targets:
## - all: same as deploy
## - deploy: generate OWL and copy OFN and OWL to DEPLOY_PATH
## - deploy-versions: copy OFN and OWL to versioned directory under DEPLOY_PATH
## - check: check minimum profile requirements for primary ontologies
## - check-strict: check aspired-to profile requirements for primary ontologies
## - clean-checks: clean up profile validation reports
##
## Use make -k ("keep going") to run through all checks rather than stop
## after the first failure.
## --------------------------
all: deploy
deploy: $(addprefix $(DEPLOY_PATH)/,$(ONTS)) $(addprefix $(DEPLOY_PATH)/,$(ONTS:.ofn=.owl))
deploy-versions: $(ONTS:.ofn=.owl) $(VERSIONED_TARGETS)
check: check-tcan check-phyloref
check-strict: check-strict-tcan check-strict-phyloref
check-tcan: tcan.IsInDL
check-strict-tcan: check-tcan tcan.IsInEL
check-phyloref: phyloref.IsInFull
check-strict-phyloref: check-phyloref phyloref.IsInDL
clean-checks:
$(RM) $(REPORTS)
$(DEPLOY_PATH)/%.ofn : %.ofn
cp -p $< $@
$(DEPLOY_PATH)/%.owl : %.owl
cp -p $< $@
%.owl : %.ofn
$(ROBOT) \
annotate --input $< \
--annotation rdfs:comment "Generated by $(ROBOT_VERSION) from $<" \
convert --output $@
$(VERSIONED_TARGETS) : deploy
mkdir -p $(dir $@)
cp -p $(notdir $@) $@
cp -p $(notdir $(@:.owl=.ofn)) $(@:.owl=.ofn)
$(REPORTS) :
$(ROBOT) validate-profile --profile $(subst .IsIn,,$(suffix $@)) \
--input $(basename $@).ofn --output $@ \
--catalog $(CATALOG)
.PHONY: check check-strict check-tcan check-phyloref clean