diff options
author | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-01-15 22:00:50 -0500 |
---|---|---|
committer | Eugeniy Mikhailov <evgmik@gmail.com> | 2014-01-15 22:02:13 -0500 |
commit | c5b79fc8b83f298da56e2f24b830babc1ce2e514 (patch) | |
tree | f9e40659607137b071c34e6d516f67be4dd7d260 | |
parent | 1ea23bda1842020eed05dadcd71ed744e1d64454 (diff) | |
download | makefile_templates-c5b79fc8b83f298da56e2f24b830babc1ce2e514.tar.gz makefile_templates-c5b79fc8b83f298da56e2f24b830babc1ce2e514.zip |
added some helper make file for svg and raw pdf sources
-rw-r--r-- | pic_pdf_compatible.mk | 27 | ||||
-rw-r--r-- | pic_source_dir/Makefile | 26 | ||||
-rw-r--r-- | pic_source_subdir/Makefile | 26 | ||||
-rw-r--r-- | pic_sources.mk | 23 | ||||
-rw-r--r-- | pic_svg.mk | 23 |
5 files changed, 125 insertions, 0 deletions
diff --git a/pic_pdf_compatible.mk b/pic_pdf_compatible.mk new file mode 100644 index 0000000..259b567 --- /dev/null +++ b/pic_pdf_compatible.mk @@ -0,0 +1,27 @@ +# -*- make -*- + +CLEAN_TARGETS += clean_pdf_compatible +REAL_CLEAN_TARGETS += real_clean_pdf_compatible + +pdf_compatible_files = \ + $(wildcard *.pdf) \ + $(wildcard *.png) \ + $(wildcard *.jpg) + +copied_pdf_compatible_files = $(pdf_compatible_files:%=$(pics_destdir)/%) + +copy_pdf_compatible_files: dest_dir_pdf_compatible $(copied_pdf_compatible_files) + +$(copied_pdf_compatible_files): $(pics_destdir)/% : % + $(INSTALL) -m 0644 $< $@ + +clean_pdf_compatible: + +real_clean_pdf_compatible: +ifneq ($(strip $(copied_pdf_compatible_files)),) + rm -f $(copied_pdf_compatible_files) +endif + +dest_dir_pdf_compatible: + $(INSTALL) -d -m 0755 $(pics_destdir) + diff --git a/pic_source_dir/Makefile b/pic_source_dir/Makefile new file mode 100644 index 0000000..8832758 --- /dev/null +++ b/pic_source_dir/Makefile @@ -0,0 +1,26 @@ +# -*- make -*- + + +# Default value so one can compile this standalone +TOPDIR ?= ../.. +include ./local.mk +include $(TOPDIR)/common.mk +include $(MAKEINCLUDE_DIR)/pic_pdf_compatible.mk +include $(MAKEINCLUDE_DIR)/pic_svg.mk +include $(MAKEINCLUDE_DIR)/subdirs.mk + +dest_dir = $(DESTDIR)$(PREFIX)/$(PACKAGE_DIR) + +.DEFAULT_GOAL := all + +all: compile install + +compile: subdirs $(REQUIRED_TARGETS) + +clean: subdirs $(CLEAN_TARGETS) + +real_clean: subdirs clean $(REAL_CLEAN_TARGETS) + +install: subdirs $(INSTALL_TARGETS) + + diff --git a/pic_source_subdir/Makefile b/pic_source_subdir/Makefile new file mode 100644 index 0000000..aa08d03 --- /dev/null +++ b/pic_source_subdir/Makefile @@ -0,0 +1,26 @@ +# -*- make -*- + + +# Default value so one can compile this standalone +TOPDIR ?= .. +include ./local.mk +include $(TOPDIR)/common.mk +include $(MAKEINCLUDE_DIR)/pic_pdf_compatible.mk +include $(MAKEINCLUDE_DIR)/pic_svg.mk +include $(MAKEINCLUDE_DIR)/subdirs.mk + +dest_dir = $(DESTDIR)$(PREFIX)/$(PACKAGE_DIR) + +.DEFAULT_GOAL := all + +all: compile install + +compile: subdirs $(REQUIRED_TARGETS) + +clean: subdirs $(CLEAN_TARGETS) + +real_clean: subdirs clean $(REAL_CLEAN_TARGETS) + +install: subdirs $(INSTALL_TARGETS) + + diff --git a/pic_sources.mk b/pic_sources.mk new file mode 100644 index 0000000..da23718 --- /dev/null +++ b/pic_sources.mk @@ -0,0 +1,23 @@ +# -*- make -*- + +TOPDIR ?= ../../.. +pics_destdir ?= ../../pics +MAKEINCLUDE_DIR ?= $(TOPDIR)/makefile_templates + +# sources_dirs = pics_pdf_compatible pics_svg_sources plots +sources_dirs = pics_pdf_compatible + +compile_pics_in_sources_dirs: $(sources_dirs) + +# $(sources_dirs)/Makefile: + # echo no $@ + +pics_pdf_compatible: pics_pdf_compatible/Makefile + $(MAKE) -C $@ $(MAKECMDGOALS) + + +pics_pdf_compatible/Makefile: + ln -s $(MAKEINCLUDE_DIR)/pic_pdf_compatible.mk $@ + + +.PHONY: $(sources_dirs) diff --git a/pic_svg.mk b/pic_svg.mk new file mode 100644 index 0000000..cfb5053 --- /dev/null +++ b/pic_svg.mk @@ -0,0 +1,23 @@ +# -*- make -*- + +CLEAN_TARGETS += clean_pdf_svg_targets +REAL_CLEAN_TARGETS += real_clean_pdf_svg_targets + +svg_sources = $(wildcard *.svg) +pdf_svg = $(svg_sources:%.svg=$(pics_destdir)/%.pdf) + +copy_pdf_compatible_files: dest_dir_svg $(pdf_svg) + +$(pdf_svg): $(pics_destdir)/%.pdf : %.svg + inkscape --export-pdf=$@ $< + +clean_pdf_svg_targets: + +real_clean_pdf_svg_targets: +ifneq ($(strip $(pdf_svg)),) + rm -f $(pdf_svg) +endif + +dest_dir_svg: + $(INSTALL) -d -m 0755 $(pics_destdir) + |