diff --git a/boom/Makefile b/boom/Makefile index da39b1f..3b7b4e7 100644 --- a/boom/Makefile +++ b/boom/Makefile @@ -1,25 +1,28 @@ DIST = dk MANU = avx johanson murata panasonic stackpole tdk yageo -EQU = dist/all.equ -INV = dist/all.inv -DSC = dist/all.dsc -CHR = $(foreach m,$(MANU),manu/$(m)/$(m).chr) +EQU = $(shell ./boom-config equ) +INV = $(shell ./boom-config inv) +DSC = $(shell ./boom-config dsc) +CHR = $(shell ./boom-config chr) -DB = $(EQU) $(INV) $(DSC) $(CHR) \ - $(DIST:%=dist/%/db/*.equ) \ - $(DIST:%=dist/%/db/*.inv) \ - $(DIST:%=dist/%/db/*.dsc) +DB = $(EQU) $(INV) $(DSC) $(CHR) .PHONY: all spotless tar count -all: +all: boom-config + +boom-config: boom-config.in Makefile + sed 's/##DIST##/$(DIST)/;s/##MANU##/$(MANU)/' boom-config.in \ + >$@ || { rm -f $@; exit 1; } + chmod 755 boom-config spotless: + rm -f boom-config tar: - tar cfj boom-db.tar.bz2 $(DB) + tar cfj boom-db.tar.bz2 boom-config $(DB) count: perl ./count.pl $(CHR) diff --git a/boom/boom-config.in b/boom/boom-config.in new file mode 100644 index 0000000..256aa08 --- /dev/null +++ b/boom/boom-config.in @@ -0,0 +1,25 @@ +#!/bin/sh + +DIST="##DIST##" +MANU="##MANU##" + +base=`which "$0"` +base=`dirname "$base"` +[ "$base" = "${base#/}" ] && base=`pwd`/$base +[ . -ef "$base" ] && base=. + +while [ "$1" ]; do + case "$1" in + equ) + for n in $DIST; do echo "$base/dist/$n/db/all.equ"; done;; + inv) + for n in $DIST; do echo "$base/dist/$n/db/all.inv"; done;; + dsc) + for n in $DIST; do echo "$base/dist/$n/db/all.dsc"; done;; + chr) + for n in $MANU; do echo "$base/manu/$n/$n.chr"; done;; + esac + shift +done + +exit 0 diff --git a/boom/test/Makefile b/boom/test/Makefile index 642c5aa..156442c 100644 --- a/boom/test/Makefile +++ b/boom/test/Makefile @@ -2,12 +2,10 @@ BOOM=PATH=/home/moko/svn.openmoko.org/trunk/eda/boom:../boom:$$PATH boom KITS = 1 -MANU = avx johanson murata panasonic stackpole tdk yageo - -EQU = ../dist/all.equ -INV = ../dist/all.inv -DSC = ../dist/all.dsc -CHR = $(foreach m,$(MANU),../manu/$(m)/$(m).chr) +EQU = $(shell ../boom-config equ) +INV = $(shell ../boom-config inv) +DSC = $(shell ../boom-config dsc) +CHR = $(shell ../boom-config chr) .PHONY: all show again spotless