2010-12-28 18:05:44 +02:00
|
|
|
PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones
|
2011-03-14 18:17:01 +02:00
|
|
|
CPTX = ../../eda-tools/mlztx/cptx
|
2011-03-15 06:43:08 +02:00
|
|
|
GMERGE = ../../eda-tools/gerber/gmerge
|
2011-03-22 15:29:45 +02:00
|
|
|
PRETTYGERBV=../../eda-tools/gerber/prettygerbv
|
2010-12-28 18:02:43 +02:00
|
|
|
|
2011-01-18 03:35:55 +02:00
|
|
|
NAME = atusb
|
2011-03-15 02:43:53 +02:00
|
|
|
VERSION = 110314
|
2011-03-13 04:43:00 +02:00
|
|
|
DIR = $(NAME)
|
2011-01-18 03:35:55 +02:00
|
|
|
|
2011-03-22 07:21:26 +02:00
|
|
|
SCH=$(shell pwd)/$(NAME).sch
|
|
|
|
BRD=$(shell pwd)/$(NAME).brd
|
|
|
|
|
2010-12-28 04:50:00 +02:00
|
|
|
.PHONY: all gen generate sch brd xpdf front back clean
|
2011-03-13 04:43:00 +02:00
|
|
|
.PHONY: gerber gerbv fab
|
2010-08-22 22:06:43 +03:00
|
|
|
|
|
|
|
all:
|
2010-12-28 04:50:00 +02:00
|
|
|
@echo "make what ? target: gen sch brd xpdf front back clean"
|
2010-08-22 22:06:43 +03:00
|
|
|
@exit 1
|
|
|
|
|
|
|
|
gen generate:
|
2011-03-22 07:21:26 +02:00
|
|
|
eeschema --plot=ps $(SCH)
|
2010-08-22 22:06:43 +03:00
|
|
|
# need scripts
|
|
|
|
|
|
|
|
sch:
|
2011-03-22 07:21:26 +02:00
|
|
|
eeschema $(SCH)
|
2010-08-22 22:06:43 +03:00
|
|
|
|
|
|
|
brd:
|
2011-03-22 07:21:26 +02:00
|
|
|
pcbnew $(BRD)
|
2010-08-22 22:06:43 +03:00
|
|
|
|
|
|
|
xpdf:
|
2011-01-18 03:35:55 +02:00
|
|
|
xpdf $(NAME).pdf
|
2010-12-28 04:20:42 +02:00
|
|
|
|
2011-01-18 03:35:55 +02:00
|
|
|
front: $(NAME)-Front.ps
|
2010-12-28 04:20:42 +02:00
|
|
|
lpr $<
|
|
|
|
|
2011-01-18 03:35:55 +02:00
|
|
|
back: $(NAME)-Back.ps
|
2010-12-28 04:20:42 +02:00
|
|
|
lpr $<
|
|
|
|
|
2011-03-14 18:17:01 +02:00
|
|
|
cptx:
|
|
|
|
$(CPTX) -i $(NAME).brd 0 47000 48100 21 46811 40591
|
|
|
|
|
2011-03-13 04:43:00 +02:00
|
|
|
# --- DIY production (toner transfer) -----------------------------------------
|
|
|
|
|
2010-12-28 04:20:42 +02:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
2011-01-18 03:35:55 +02:00
|
|
|
%-Front.ps: %.brd
|
2010-12-28 18:02:43 +02:00
|
|
|
$(PLOT_BRD) -l Front --mirror $<
|
2010-12-28 04:20:42 +02:00
|
|
|
|
2011-01-18 03:35:55 +02:00
|
|
|
%-Back.ps: %.brd
|
2010-12-28 18:02:43 +02:00
|
|
|
$(PLOT_BRD) -l Back $<
|
2010-12-28 04:50:00 +02:00
|
|
|
|
2011-03-13 04:43:00 +02:00
|
|
|
# --- 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:
|
2011-03-14 18:24:09 +02:00
|
|
|
pcbnew --plot=gerber --origin=aux \
|
2011-03-22 07:21:26 +02:00
|
|
|
-l `pcbnew --list-layers $(BRD) | tr '\012' ,` \
|
|
|
|
--fill-all-zones --exclude-pcb-edge \
|
|
|
|
$(BRD)
|
2011-03-15 06:43:08 +02:00
|
|
|
$(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \
|
|
|
|
|| { rm -rf _tmp; exit 1; }
|
|
|
|
mv _tmp $(NAME)-SilkS_Front.gto
|
2011-03-13 04:43:00 +02:00
|
|
|
|
|
|
|
fab: gerber
|
2011-03-22 07:21:26 +02:00
|
|
|
pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD)
|
|
|
|
pcbnew --drill --origin=aux $(BRD)
|
2011-03-15 05:25:10 +02:00
|
|
|
mkdir -p fab
|
|
|
|
tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \
|
2011-03-14 05:33:40 +02:00
|
|
|
$(PCB_FILES:%=$(DIR)/%)
|
2011-03-15 05:25:10 +02:00
|
|
|
cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \
|
2011-03-13 04:43:00 +02:00
|
|
|
$(PCB_FILES:%=$(DIR)/%)
|
|
|
|
|
|
|
|
gerbv:
|
2011-03-15 06:43:08 +02:00
|
|
|
gerbv $(NAME)-SilkS_Front.gto \
|
2011-03-13 04:43:00 +02:00
|
|
|
$(NAME)-SoldP_Front.gtp \
|
|
|
|
$(NAME)-Front.gtl \
|
|
|
|
$(NAME)-Mask_Front.gts \
|
2011-03-22 15:03:19 +02:00
|
|
|
$(NAME)-Mask_Back.gbs \
|
2011-03-13 04:43:00 +02:00
|
|
|
$(NAME)-Back.gbl
|
|
|
|
|
2011-03-14 05:33:40 +02:00
|
|
|
upload:
|
2011-03-15 05:25:10 +02:00
|
|
|
qippl fab/$(NAME)-pcb-$(VERSION).tar.gz \
|
|
|
|
fab/$(NAME)-pcb-$(VERSION).zip wpan/fab
|
2011-03-14 05:33:40 +02:00
|
|
|
|
2011-03-22 15:29:45 +02:00
|
|
|
# --- Overview images ---------------------------------------------------------
|
|
|
|
|
|
|
|
overview: gerber
|
|
|
|
$(PRETTYGERBV) $(NAME) all overview.png
|
|
|
|
|
|
|
|
uoverview: overview
|
|
|
|
qippl overview.png wpan/tmp/$(NAME)-$(VERSION)-overview.png
|
|
|
|
|
2011-03-13 04:43:00 +02:00
|
|
|
# --- Cleanup -----------------------------------------------------------------
|
|
|
|
|
2010-12-28 04:50:00 +02:00
|
|
|
clean:
|
2011-01-18 03:35:55 +02:00
|
|
|
rm -f $(NAME)-Front.ps $(NAME)-Back.ps
|
2011-03-13 04:43:00 +02:00
|
|
|
rm -f $(NAME).drl $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf
|
2011-01-18 03:40:15 +02:00
|
|
|
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
|
2011-03-15 06:43:08 +02:00
|
|
|
rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr
|
2011-03-22 15:29:45 +02:00
|
|
|
rm -f overview.png
|
2011-03-15 05:25:10 +02:00
|
|
|
|
|
|
|
spotless: clean
|
|
|
|
rm -f '$$'savepcb.brd
|
|
|
|
rm -f $(NAME)-cache.bak atrf.bak usb.bak
|
|
|
|
rm -f $(NAME).000
|
|
|
|
rm -f $(NAME).net
|