-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
64 lines (47 loc) · 1.27 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
## CHANGE THIS
SCHEMA_NAME = schemaorg
RUN = poetry run
SRC = src
SCHEMA_DIR = $(SRC)/linkml
SCHEMA_ROOT = $(SCHEMA_DIR)/$(SCHEMA_NAME).yaml
DEST = project
PYMODEL = $(SRC)/$(SCHEMA_NAME)/datamodel
DOCDIR = docs
# basename of a YAML file in model/
.PHONY: all clean
help:
@echo "make all -- makes site locally"
@echo "make deploy -- deploys site"
@echo "make help -- this"
@echo ""
all: gen-project gendoc
%.yaml: gen-project
deploy: all mkd-gh-deploy
# generates all project files
gen-project: $(PYMODEL)
$(RUN) gen-project -d $(DEST) $(SCHEMA_ROOT) && mv $(DEST)/*.py $(PYMODEL)
test:
$(RUN) gen-project -d tmp $(SCHEMA_ROOT)
upgrade:
poetry add -D linkml@latest
# Test documentation locally
serve: mkd-serve
# Python datamodel
$(PYMODEL):
mkdir -p $@
$(DOCDIR):
mkdir -p $@
gendoc: $(DOCDIR)
cp $(SRC)/docs/*md $(DOCDIR) ; \
$(RUN) gen-doc -d $(DOCDIR) $(SCHEMA_ROOT)
MKDOCS = $(RUN) mkdocs
mkd-%:
$(MKDOCS) $*
PROJECT_FOLDERS = sqlschema shex shacl protobuf prefixmap owl jsonschema jsonld graphql excel
git-add:
git add .gitignore Makefile LICENSE README.md mkdocs.yml poetry.lock project.Makefile pyproject.toml src/linkml/*yaml src/*/datamodel/*py
git add $(patsubst %, project/%, $(PROJECT_FOLDERS))
clean:
rm -rf $(DEST)
rm -rf tmp
include project.Makefile