1 WEB_DIR=/home/kas/html/board/
2 WEB_FILES=pcb-back.png pcb-front.png schematics.png handlebar.png
11 board.plated-drill.cnc
14 @echo "Usage: make [clean|web|gerber|fab|board.pcb]"
17 rm -f board.cmd board.jpg board.net board.new.pcb board.pcb- \
18 board.png board.ps board.sch~ pcb-back.png pcb-front.png \
19 schematics.png *.gbr *.cnc
22 test -d $(WEB_DIR) && install -m 644 $(WEB_FILES) $(WEB_DIR)
24 board.pcb: board.sch board.prj
27 pcb-front.png: board.pcb
28 pcb -x png --dpi 150 --photo-mode board.pcb \
31 pcb-back.png: board.pcb
32 pcb -x png --dpi 150 --photo-mode --photo-flip-x board.pcb \
35 schematics.png: board.sch
36 gschem -s image.scm board.sch -o schematics.png
38 handlebar-big.png: handlebar.sch
39 gschem -s image.scm handlebar.sch -o handlebar-big.png
41 handlebar.png: handlebar-big.png
42 convert -crop 450x300+320+170 handlebar-big.png handlebar.png
44 gerber: $(GERBER_FILES)
46 $(GERBER_FILES): board.pcb
47 pcb -x gerber board.pcb
50 @sh -c 'D=board-`date +\%Y\%m\%d-\%H\%M` && mkdir $$D && \
51 cp board.top.gbr $$D/board.gtl && \
52 cp board.bottom.gbr $$D/board.gbl && \
53 cp board.topmask.gbr $$D/board.gts && \
54 cp board.bottommask.gbr $$D/board.gbs && \
55 cp board.topsilk.gbr $$D/board.gto && \
56 cp board.bottomsilk.gbr $$D/board.gbo && \
57 cp board.outline.gbr $$D/board.gko && \
58 cp board.plated-drill.cnc $$D/board.txt && \
59 zip -r $$D.zip $$D && \
60 echo "Done. Output in $$D.zip."; \
61 echo "You may also want to do git tag gerber-fab-$$D" '