summaryrefslogtreecommitdiff
path: root/Makefile
blob: cc6cfff895046a20f85490ab995804bf4006a254 (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. # TODO: resolve event:Event with prog:Programme being foaf:primaryTopic of <>
  6. htmlprogrammefiles = build/2014/europe/index.html
  7. htmlfiles = $(htmlprogrammefiles)
  8. getbase = $(shell perl -ne '/^\@base\s+<(http.+)>/ and print $$1 and exit;' "$1")
  9. all: $(textfiles) $(rdfxmlfiles) $(htmlfiles)
  10. clean:
  11. rm -rf build
  12. $(turtlefiles): build/%/index.ttl : data/%.ttl
  13. mkdir -p $(dir $@)
  14. cp $< $@
  15. # $(eval base = $(call getbase, $<))
  16. # rapper $(base:%=-I "%") -i turtle -o turtle "$<" > "$@"
  17. # perl -i -pe 's/ {4}/\t/g' "$@"
  18. $(textfiles): %.txt : %.ttl
  19. ln -fs $(notdir $<) $@
  20. $(rdfxmlfiles): %.rdf : %.ttl
  21. $(eval base = $(call getbase, $<))
  22. rapper $(base:%=-I "%") -i turtle -o rdfxml-abbrev "$<" > "$@"
  23. $(htmlprogrammefiles): %.html : %.ttl
  24. $(eval base = $(call getbase, $<))
  25. wget -O"$@" "http://programme.ecs.soton.ac.uk/tool.php?src=$(base)"
  26. perl -pi -e 's,$(base)\K,/index.txt,' "$@"