1
0
mirror of git://projects.qi-hardware.com/ben-wpan.git synced 2024-06-16 13:54:31 +03:00

consolidated atben/Makefile and atusb/Makefile into common template

- makefiles/Makefile.kicad: common template for (some) KiCad projects
- atben/Makefile, atusb/Makefile: use makefiles/Makefile.kicad
This commit is contained in:
Werner Almesberger 2011-03-22 10:49:14 -03:00
parent 0960497602
commit 6caa0d36ab
3 changed files with 142 additions and 230 deletions

View File

@ -1,123 +1,9 @@
PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones
CPTX = ../../eda-tools/mlztx/cptx
GMERGE = ../../eda-tools/gerber/gmerge
PRETTYGERBV=../../eda-tools/gerber/prettygerbv
NAME = atben
VERSION = 110314
DIR = $(NAME)
SCH=$(shell pwd)/$(NAME).sch
BRD=$(shell pwd)/$(NAME).brd
.PHONY: all gen generate sch brd xpdf front back clean
.PHONY: gerber gerbv
all:
@echo "make what ? target: gen sch brd xpdf"
@exit 1
gen generate:
eeschema --plot=ps $(SCH)
# need scripts
sch:
eeschema $(SCH)
brd:
pcbnew $(BRD)
xpdf:
xpdf $(NAME).pdf
front: $(NAME)-Front.ps
lpr $<
back: $(NAME)-Back.ps
lpr $<
include ../makefiles/Makefile.kicad
# Copy text from front copper to front silk screen
cptx:
$(CPTX) -i $(NAME).brd 15 51950 30550 21 51950 30550
# --- Industrial production ---------------------------------------------------
PCB_FILES = README-PCB $(NAME)-PCB_Edges.dxf $(NAME).drl \
$(NAME)-SilkS_Front.gto $(NAME)-Mask_Front.gts \
$(NAME)-Front.gtl $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs \
$(NAME)-PCB_Edges.gbr
gerber:
pcbnew --plot=gerber --origin=aux \
-l `pcbnew --list-layers $(BRD) | tr '\012' ,` \
--fill-all-zones --exclude-pcb-edge \
$(BRD)
$(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \
|| { rm -rf _tmp; exit 1; }
mv _tmp $(NAME)-SilkS_Front.gto
fab: gerber
pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD)
pcbnew --drill --origin=aux $(BRD)
mkdir -p fab
tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \
$(PCB_FILES:%=$(DIR)/%)
cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \
$(PCB_FILES:%=$(DIR)/%)
gerbv:
gerbv $(NAME)-SilkS_Front.gto \
$(NAME)-SoldP_Front.gtp \
$(NAME)-Front.gtl \
$(NAME)-Mask_Front.gts \
$(NAME)-Mask_Back.gbs \
$(NAME)-Back.gbl
upload:
qippl fab/$(NAME)-pcb-$(VERSION).tar.gz \
fab/$(NAME)-pcb-$(VERSION).zip wpan/fab
# --- Overviews images --------------------------------------------------------
overview: gerber
$(PRETTYGERBV) $(NAME) all overview.png
uoverview: overview
qippl overview.png wpan/tmp/$(NAME)-$(VERSION)-overview.png
# --- DIY production (toner transfer) -----------------------------------------
#
# Postscript for production of front/back layer, using the toner transfer
# method. Note that other artwork transfer methods may require different
# mirror settings.
#
# We use --ps-pads-drill-opt=none to avoid having any hole before drilling,
# which yields the best results with a CNC drill. For manual drilling, "real"
# would be preferrable. Do not use "small", for this created holes that are
# larger (!) than designed.
#
%-Front.ps: %.brd
$(PLOT_BRD) -l Front --mirror $<
%-Back.ps: %.brd
$(PLOT_BRD) -l Back $<
# --- Cleanup -----------------------------------------------------------------
clean:
rm -f $(NAME)-Front.ps $(NAME)-Back.ps
rm -f $(NAME).drl $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf
rm -f $(NAME)-Front.gtl $(NAME)-Mask_Front.gts
rm -f $(NAME)-SilkS_Front.gto $(NAME)-SoldP_Front.gtp
rm -f $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs
rm -f $(NAME)-SilkS_Back.gbo $(NAME)-SoldP_Back.gbp
rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr
rm -f overview.png
spotless: clean
rm -f '$$'savepcb.000 '$$'savepcb.brd
rm -f $(NAME)-cache.lib $(NAME).000 $(NAME).bak
rm -f $(NAME).net

View File

@ -1,122 +1,10 @@
PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones
CPTX = ../../eda-tools/mlztx/cptx
GMERGE = ../../eda-tools/gerber/gmerge
PRETTYGERBV=../../eda-tools/gerber/prettygerbv
NAME = atusb
VERSION = 110314
DIR = $(NAME)
SCH=$(shell pwd)/$(NAME).sch
BRD=$(shell pwd)/$(NAME).brd
.PHONY: all gen generate sch brd xpdf front back clean
.PHONY: gerber gerbv fab
all:
@echo "make what ? target: gen sch brd xpdf front back clean"
@exit 1
gen generate:
eeschema --plot=ps $(SCH)
# need scripts
sch:
eeschema $(SCH)
brd:
pcbnew $(BRD)
xpdf:
xpdf $(NAME).pdf
front: $(NAME)-Front.ps
lpr $<
back: $(NAME)-Back.ps
lpr $<
include ../makefiles/Makefile.kicad
cptx:
$(CPTX) -i $(NAME).brd 0 47000 48100 21 46811 40591
# --- DIY production (toner transfer) -----------------------------------------
#
# Postscript for production of front/back layer, using the toner transfer
# method. Note that other artwork transfer methods may require different
# mirror settings.
#
# We use --ps-pads-drill-opt=none to avoid having any hole before drilling,
# which yields the best results with a CNC drill. For manual drilling, "real"
# would be preferrable. Do not use "small", for this created holes that are
# larger (!) than designed.
#
%-Front.ps: %.brd
$(PLOT_BRD) -l Front --mirror $<
%-Back.ps: %.brd
$(PLOT_BRD) -l Back $<
# --- Industrial production ---------------------------------------------------
PCB_FILES = README-PCB $(NAME)-PCB_Edges.dxf $(NAME).drl \
$(NAME)-SilkS_Front.gto $(NAME)-Mask_Front.gts \
$(NAME)-Front.gtl $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs \
$(NAME)-PCB_Edges.gbr
gerber:
pcbnew --plot=gerber --origin=aux \
-l `pcbnew --list-layers $(BRD) | tr '\012' ,` \
--fill-all-zones --exclude-pcb-edge \
$(BRD)
$(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \
|| { rm -rf _tmp; exit 1; }
mv _tmp $(NAME)-SilkS_Front.gto
fab: gerber
pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD)
pcbnew --drill --origin=aux $(BRD)
mkdir -p fab
tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \
$(PCB_FILES:%=$(DIR)/%)
cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \
$(PCB_FILES:%=$(DIR)/%)
gerbv:
gerbv $(NAME)-SilkS_Front.gto \
$(NAME)-SoldP_Front.gtp \
$(NAME)-Front.gtl \
$(NAME)-Mask_Front.gts \
$(NAME)-Mask_Back.gbs \
$(NAME)-Back.gbl
upload:
qippl fab/$(NAME)-pcb-$(VERSION).tar.gz \
fab/$(NAME)-pcb-$(VERSION).zip wpan/fab
# --- Overview images ---------------------------------------------------------
overview: gerber
$(PRETTYGERBV) $(NAME) all overview.png
uoverview: overview
qippl overview.png wpan/tmp/$(NAME)-$(VERSION)-overview.png
# --- Cleanup -----------------------------------------------------------------
clean:
rm -f $(NAME)-Front.ps $(NAME)-Back.ps
rm -f $(NAME).drl $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf
rm -f $(NAME)-Front.gtl $(NAME)-Mask_Front.gts
rm -f $(NAME)-SilkS_Front.gto $(NAME)-SoldP_Front.gtp
rm -f $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs
rm -f $(NAME)-SilkS_Back.gbo $(NAME)-SoldP_Back.gbp
rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr
rm -f overview.png
spotless: clean
rm -f '$$'savepcb.brd
rm -f $(NAME)-cache.bak atrf.bak usb.bak
rm -f $(NAME).000
rm -f $(NAME).net
spotless::
rm -f atrf.bak usb.bak

138
makefiles/Makefile.kicad Normal file
View File

@ -0,0 +1,138 @@
#
# Makefile.kicad - Makefile template for KiCAD projects
#
# Written 2011 by Werner Almesberger
# Copyright 2011 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.
#
#
# Define before including this template:
#
# NAME project name
# VERSION "release" version number
#
PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones
CPTX = ../../eda-tools/mlztx/cptx
GMERGE = ../../eda-tools/gerber/gmerge
PRETTYGERBV=../../eda-tools/gerber/prettygerbv
DIR = $(shell pwd | sed 's|.*/||')
SCH=$(shell pwd)/$(NAME).sch
BRD=$(shell pwd)/$(NAME).brd
.PHONY: all gen generate sch brd xpdf front back clean
.PHONY: gerber gerbv fab
all:
@echo "make what ? target: gen sch brd xpdf front back clean"
@exit 1
gen generate:
eeschema --plot=ps $(SCH)
# need scripts
sch:
eeschema $(SCH)
brd:
pcbnew $(BRD)
xpdf:
xpdf $(NAME).pdf
front: $(NAME)-Front.ps
lpr $<
back: $(NAME)-Back.ps
lpr $<
# --- DIY production (toner transfer) -----------------------------------------
#
# Postscript for production of front/back layer, using the toner transfer
# method. Note that other artwork transfer methods may require different
# mirror settings.
#
# We use --ps-pads-drill-opt=none to avoid having any hole before drilling,
# which yields the best results with a CNC drill. For manual drilling, "real"
# would be preferrable. Do not use "small", for this created holes that are
# larger (!) than designed.
#
%-Front.ps: %.brd
$(PLOT_BRD) -l Front --mirror $<
%-Back.ps: %.brd
$(PLOT_BRD) -l Back $<
# --- Industrial production ---------------------------------------------------
PCB_FILES = README-PCB $(NAME)-PCB_Edges.dxf $(NAME).drl \
$(NAME)-SilkS_Front.gto $(NAME)-Mask_Front.gts \
$(NAME)-Front.gtl $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs \
$(NAME)-PCB_Edges.gbr
gerber:
pcbnew --plot=gerber --origin=aux \
-l `pcbnew --list-layers $(BRD) | tr '\012' ,` \
--fill-all-zones --exclude-pcb-edge \
$(BRD)
$(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \
|| { rm -rf _tmp; exit 1; }
mv _tmp $(NAME)-SilkS_Front.gto
fab: gerber
pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD)
pcbnew --drill --origin=aux $(BRD)
mkdir -p fab
tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \
$(PCB_FILES:%=$(DIR)/%)
cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \
$(PCB_FILES:%=$(DIR)/%)
gerbv:
gerbv $(NAME)-SilkS_Front.gto \
$(NAME)-SoldP_Front.gtp \
$(NAME)-Front.gtl \
$(NAME)-Mask_Front.gts \
$(NAME)-Mask_Back.gbs \
$(NAME)-Back.gbl
upload:
qippl fab/$(NAME)-pcb-$(VERSION).tar.gz \
fab/$(NAME)-pcb-$(VERSION).zip wpan/fab
# --- Overview images ---------------------------------------------------------
overview: gerber
$(PRETTYGERBV) $(NAME) all overview.png
uoverview: overview
qippl overview.png wpan/tmp/$(NAME)-$(VERSION)-overview.png
# --- Cleanup -----------------------------------------------------------------
clean::
rm -f $(NAME)-Front.ps $(NAME)-Back.ps
rm -f $(NAME).drl $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf
rm -f $(NAME)-Front.gtl $(NAME)-Mask_Front.gts
rm -f $(NAME)-SilkS_Front.gto $(NAME)-SoldP_Front.gtp
rm -f $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs
rm -f $(NAME)-SilkS_Back.gbo $(NAME)-SoldP_Back.gbp
rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr
rm -f overview.png
spotless:: clean
rm -f '$$'savepcb.000 '$$'savepcb.brd
rm -f $(NAME)-cache.lib $(NAME)-cache.bak
rm -f $(NAME).000
rm -f $(NAME).net