From e324adc35a0c28aeabe6366bba9e36fd9653298a Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Fri, 21 Dec 2012 00:41:19 -0300 Subject: [PATCH] add title pages to the catalogs, with useful information like the creation date --- common/Makefile.title | 15 +++++++++++++++ common/title.fig | 22 ++++++++++++++++++++++ components/Makefile | 14 +++++++++++--- modules/Makefile | 14 +++++++++++--- 4 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 common/Makefile.title create mode 100644 common/title.fig diff --git a/common/Makefile.title b/common/Makefile.title new file mode 100644 index 0000000..5f8c45a --- /dev/null +++ b/common/Makefile.title @@ -0,0 +1,15 @@ +SHELL = /bin/bash + +COMMIT_DATE := $(shell date -u +'%F %T UTC' \ + -d "`git show --pretty=format:'%ci' | sed q`") +GIT_HASH := $(shell git rev-parse HEAD) +GIT_STATUS := $(shell [ -z "`git status -s -uno`" ] || echo +) + +title.ps: ../common/title.fig + fig2dev -L ps $< | \ + sed -e "s||$(TITLE_NAME)|" \ + -e "s//`date -u +'%F %T UTC'`/" \ + -e "s//$(GIT_HASH)$(GIT_STATUS)/" \ + -e "s//$(COMMIT_DATE)/" \ + -e "s||$(TITLE_FILE)|" >$@; \ + [ "$${PIPESTATUS[*]}" = "0 0" ] || { rm -f $@ exit 1; } diff --git a/common/title.fig b/common/title.fig new file mode 100644 index 0000000..f0f4971 --- /dev/null +++ b/common/title.fig @@ -0,0 +1,22 @@ +#FIG 3.2 Produced by xfig version 3.2.5b +Portrait +Center +Metric +A4 +100.00 +Single +-2 +1200 2 +4 0 0 50 -1 18 36 0.0000 4 450 4350 450 1800 \001 +4 0 0 50 -1 18 18 0.0000 4 285 2100 450 6075 Git repository:\001 +4 0 0 50 -1 12 18 0.0000 4 255 8100 450 6390 git://projects.qi-hardware.com/kicad-libs.git\001 +4 0 0 50 -1 18 18 0.0000 4 225 975 450 6975 HEAD:\001 +4 0 0 50 -1 12 18 0.0000 4 165 1980 450 7245 \001 +4 0 0 50 -1 12 18 0.0000 4 165 1980 450 7560 \001 +4 0 0 50 -1 18 18 0.0000 4 285 1860 450 8145 This catalog:\001 +4 0 0 50 -1 19 18 0.0000 4 285 2895 450 2250 (for use with KiCad)\001 +4 0 0 50 -1 14 18 0.0000 4 270 4140 450 4185 http://qi-hardware.com/\001 +4 0 0 50 -1 18 25 0.0000 4 315 2520 450 3825 Qi-Hardware\001 +4 0 0 50 -1 12 18 0.0000 4 255 8460 450 8460 http://downloads.qi-hardware.com/people/werner/\001 +4 0 0 50 -1 12 18 0.0000 4 255 2880 675 8775 tmp/\001 +4 0 0 50 -1 12 18 0.0000 4 165 1080 450 9090 \001 diff --git a/components/Makefile b/components/Makefile index 6d089d8..49c12f1 100644 --- a/components/Makefile +++ b/components/Makefile @@ -4,8 +4,15 @@ # Note that we don't have the concept of a "library of everything" so far. # +SHELL = /bin/bash + GEN = gencon.lib +TITLE_NAME = SYMBOLS/COMPONENTS +TITLE_FILE = kicad-libs-components.pdf + +include ../common/Makefile.title + .PHONY: all sch catalog view upload missing clean spotless all: $(GEN) @@ -19,8 +26,9 @@ sch: $(GEN) DESCR-dcm: *.dcm ../scripts/dcm2desc -L . >$@ || { rm -f $@; exit 1; } -catalog catalog.pdf: HIERARCHY DESCR-dcm *.lib $(GEN) - genkicat -p -L . HIERARCHY DESCR-dcm >catalog.pdf || \ +catalog catalog.pdf: HIERARCHY DESCR-dcm *.lib $(GEN) title.ps + genkicat -p -L . -t title.ps HIERARCHY DESCR-dcm \ + >catalog.pdf || \ { rm -f catalog.pdf; exit 1; } view: catalog.pdf @@ -39,7 +47,7 @@ missing: $(GEN) # ./mkloe clean: - rm -f DESCR-dcm + rm -f DESCR-dcm title.ps spotless: clean rm -f catalog.pdf $(GEN) diff --git a/modules/Makefile b/modules/Makefile index a3b3d3b..528580c 100644 --- a/modules/Makefile +++ b/modules/Makefile @@ -18,6 +18,13 @@ MODULES=8_10-card 8_10-socket-ra \ xtal-2 xtal-4 \ zx62-b-5pa zx62m-b-5p +SHELL = /bin/bash + +TITLE_NAME = FOOTPRINTS/MODULES +TITLE_FILE = kicad-libs-modules.pdf + +include ../common/Makefile.title + .SUFFIXES: .fpd .mod .PHONY: all brd catalog view upload missing clean spotless @@ -33,9 +40,9 @@ modules.pro: Makefile brd: all modules.pro pcbnew `pwd`/modules.brd -catalog catalog.pdf: HIERARCHY $(MODULES:%=%.fpd) - genkicat -F -p $(MODULES:%=-l %.fpd) HIERARCHY DESCR \ - >catalog.pdf || \ +catalog catalog.pdf: HIERARCHY $(MODULES:%=%.fpd) title.ps + genkicat -F -p $(MODULES:%=-l %.fpd) -t title.ps \ + HIERARCHY DESCR >catalog.pdf || \ { rm -f catalog.pdf; exit 1; } view: catalog.pdf @@ -49,6 +56,7 @@ missing: clean: rm -f *~*.fpd + rm -f title.ps spotless: clean rm -f $(MODULES:%=%.mod)