Makefile 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. all : ../o/t/index.json ../o/p/index.xml ../o/p/url.cdb ../o/p/url.old.cdb ../o/p/t.cdb ../o/p/t.old.cdb
  2. clean :
  3. find ../o -type f -delete
  4. ../o/p/id.cdb : $(wildcard var/db/p/*.s)
  5. awk '/\(id / {printf "%s ", $$2} /\(link / {print $$2}' $^ | tr -d '")' | cdb -cem $@
  6. ../o/p/id.old.cdb : $(wildcard var/db/p-*.s)
  7. awk '/\(id / {printf "%s ", $$2} /\(link / {print $$2}' $^ | tr -d '")' | cdb -cem $@
  8. ../o/p/url.cdb : ../o/p/id.cdb
  9. cdb -dm $^ | awk '// {print $$2, $$1}' | cdb -cem $@
  10. ../o/p/url.old.cdb : ../o/p/id.old.cdb
  11. cdb -dm $^ | awk '// {print $$2, $$1}' | cdb -cem $@
  12. ../o/p/t.cdb : $(wildcard var/db/p/*.s)
  13. fgrep ' (categories ' $^ | tr -d ')' | tr ' ' '\n' | fgrep -v '(categories' | sort | uniq -c | awk 'NR>1{print $$2, " ", $$1}' | cdb -cem $@
  14. ../o/p/t.old.cdb : $(wildcard var/db/p-*.s)
  15. fgrep ' (categories ' $^ | tr -d ')' | tr ' ' '\n' | fgrep -v '(categories' | sort | uniq -c | awk 'NR>1{print $$2, " ", $$1}' | cdb -cem $@
  16. ../o/p/.count : ../o/p/id.cdb ../o/p/id.old.cdb
  17. cdb -s ../o/p/id.cdb | awk '/number of records:/ {print $$4}' > $@
  18. ../o/.head.xml : etc/config.s ../o/p/.count
  19. cat $^ > $@
  20. ../o/t/index.json : ../o/p/t.old.cdb ../o/p/t.cdb
  21. cdb -lm ../o/p/t.cdb > $@
  22. cdb -lm ../o/p/t.old.cdb >> $@
  23. ../o/p/index.xml : ../o/.head.xml $(wildcard var/db/p/*.s)
  24. cat $^ > $@