summaryrefslogtreecommitdiff
path: root/Makefile
blob: d68e7091f9f1b48e43eb5cb17f8165f3d22d8485 (plain)
  1. infiles := $(wildcard data/*.ttl data/*/*.ttl)
  2. turtlefiles := $(infiles:data/%.ttl=build/%/index.ttl)
  3. textfiles = $(turtlefiles:%.ttl=%.txt)
  4. rdfxmlfiles = $(turtlefiles:%.ttl=%.rdf)
  5. getbase = $(shell perl -ne '/^\@base\s+<(http.+)>/ and print $$1 and exit;' "$1")
  6. all: $(textfiles) $(rdfxmlfiles)
  7. clean:
  8. rm -rf build
  9. $(turtlefiles): build/%/index.ttl : data/%.ttl
  10. mkdir -p $(dir $@)
  11. $(eval base = $(call getbase, $<))
  12. rapper $(base:%=-I "%") -i turtle -o turtle "$<" > "$@"
  13. perl -i -pe 's/ {4}/\t/g' "$@"
  14. $(textfiles): %.txt : %.ttl
  15. ln -s $(notdir $<) $@
  16. $(rdfxmlfiles): %.rdf : %.ttl
  17. $(eval base = $(call getbase, $<))
  18. rapper $(base:%=-I "%") -i turtle -o rdfxml-abbrev "$<" > "$@"