From cce90811d991ce9e69f5cf0f2febfdfab181cf91 Mon Sep 17 00:00:00 2001 From: Werner Almesberger Date: Thu, 20 Dec 2012 22:40:09 -0300 Subject: [PATCH] modules/: "make brd" opens pcbnew for footprint examination The profile is automatically generated from the list of modules. --- modules/Makefile | 11 +++++++++-- modules/template.pro | 22 ++++++++++++++++++++++ scripts/modules-pro | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 64 insertions(+), 2 deletions(-) create mode 100644 modules/template.pro create mode 100755 scripts/modules-pro diff --git a/modules/Makefile b/modules/Makefile index 98cd685..a3b3d3b 100644 --- a/modules/Makefile +++ b/modules/Makefile @@ -19,13 +19,20 @@ MODULES=8_10-card 8_10-socket-ra \ zx62-b-5pa zx62m-b-5p .SUFFIXES: .fpd .mod -.PHONY: all catalog view upload missing clean spotless +.PHONY: all brd catalog view upload missing clean spotless all: $(MODULES:%=%.mod) .fpd.mod: fped -k $< $@ +modules.pro: Makefile + ../scripts/modules-pro template.pro $(MODULES) >$@ || \ + { rm -f $@; exit 1; } + +brd: all modules.pro + pcbnew `pwd`/modules.brd + catalog catalog.pdf: HIERARCHY $(MODULES:%=%.fpd) genkicat -F -p $(MODULES:%=-l %.fpd) HIERARCHY DESCR \ >catalog.pdf || \ @@ -45,4 +52,4 @@ clean: spotless: clean rm -f $(MODULES:%=%.mod) - + rm -f modules.pro diff --git a/modules/template.pro b/modules/template.pro new file mode 100644 index 0000000..463b596 --- /dev/null +++ b/modules/template.pro @@ -0,0 +1,22 @@ +update=Thu Dec 20 21:59:41 2012 +last_client=pcbnew +[pcbnew] +version=1 +LastNetListRead= +PadDrlX=320 +PadDimH=600 +PadDimV=600 +BoardThickness=630 +TxtPcbV=800 +TxtPcbH=600 +TxtModV=600 +TxtModH=600 +TxtModW=120 +VEgarde=100 +DrawLar=150 +EdgeLar=150 +TxtLar=120 +MSegLar=150 +[pcbnew/libraries] +LibDir= +LibName1=qfn diff --git a/scripts/modules-pro b/scripts/modules-pro new file mode 100755 index 0000000..c14a661 --- /dev/null +++ b/scripts/modules-pro @@ -0,0 +1,33 @@ +#!/bin/sh -e +# +# modules-pro - Merge template and list of libraries to a profile +# +# Copyright 2012 by Werner Almesberger +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# + + +usage() +{ + echo "usage: $0 template.pro module-basename ..." 1>&2 + exit 1 +} + + +scan_fped() +{ + for n in "$@"; do + fped -k $n - | sed '/^\$MODULE /s///p;d' >>_tmp2 + done +} + + +[ -r "$1" ] || usage +sed /LibName1/Q "$1" +shift + +echo "$@" | tr ' ' '\012' | sort -f | awk '{ n++; print "LibName" n "=" $0 }'