Makefile 621 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. PATH_TO_DIA_FILES := ./
  2. SVG_FILES := $(patsubst %.dia,%.svg,$(addprefix svg/,$(wildcard *.dia)))
  3. PDF_FILES := $(patsubst %.dia,%.pdf,$(addprefix pdf/,$(wildcard *.dia)))
  4. INKSCAPE_VERSION=$(shell inkscape --version)
  5. ifeq ($(findstring Inkscape 1,$(INKSCAPE_VERSION)),Inkscape 1)
  6. INKSCAPE_EXPORT_ARG=-o
  7. else
  8. INKSCAPE_EXPORT_ARG=--export-pdf=
  9. endif
  10. all: svg pdf $(PDF_FILES) $(SVG_FILES)
  11. svg:
  12. mkdir -p svg
  13. pdf:
  14. mkdir -p pdf
  15. svg/%.svg: %.dia
  16. dia $< --export=$@
  17. pdf/%.pdf: svg/%.svg
  18. inkscape $< $(INKSCAPE_EXPORT_ARG)$@
  19. clean:
  20. rm -fr svg
  21. rm -fr pdf
  22. .PHONY: clean
  23. .PHONY: create_dirs
  24. .PHONY: all