-
Notifications
You must be signed in to change notification settings - Fork 2
/
project.Makefile
37 lines (28 loc) · 1.26 KB
/
project.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
## Add your own custom Makefile targets here
.PHONY: careful-clean clean-examples clean-examples all-all
clean-examples: clean-tsv-yaml
rm -rf examples/output
examples-all: clean-examples tsv-data-to-yaml examples/output
all-all: careful-clean gen-project gendoc test-python examples-all
careful-clean:
rm -rf $(DEST) # project
rm -rf tmp
rm -fr docs/*
# rm -fr $(PYMODEL)/* # src/"mifc"/datamodel/*
rm -rf $(PYMODEL)/$(SCHEMA_NAME).* # todo do not make this target via point-and-click in an IDE! It will try to delete the whole project because PYMODEL and SCHEMA_NAME will be undefined
rm -rf examples/output/*
.PHONY: tsv-data-to-yaml
tsv-data-to-yaml: $(patsubst src/data/examples/TSV/%.tsv,src/data/examples/valid/%.yaml,$(wildcard src/data/examples/TSV/*.tsv))
src/data/examples/valid/%.yaml: src/data/examples/TSV/%.tsv
@echo Converting $< to $@
$(eval INDEX_SLOT=$(shell echo $(notdir $<) | cut -d'-' -f2))
poetry run linkml-convert \
--schema src/mifc/schema/mifc.yaml \
--output $@ \
--target-class Container \
--index-slot $(INDEX_SLOT) $<
.PHONY: clean-tsv-yaml
clean-tsv-yaml:
@echo Removing corresponding YAML files...
@$(foreach file,$(wildcard src/data/examples/TSV/*.tsv),\
rm -f src/data/examples/valid/$(notdir $(basename $(file))).yaml;)