]> www.fi.muni.cz Git - openparking.git/blob - board/Makefile
Infinite reads handling
[openparking.git] / board / Makefile
1 WEB_DIR=/home/kas/html/board/
2 WEB_FILES=pcb-back.png pcb-front.png schematics.png handlebar.png
3 GERBER_FILES=\
4         board.top.gbr \
5         board.bottom.gbr \
6         board.topmask.gbr \
7         board.bottommask.gbr \
8         board.topsilk.gbr \
9         board.bottomsilk.gbr \
10         board.outline.gbr \
11         board.plated-drill.cnc
12
13 all:
14         @echo "Usage: make [clean|web|gerber|fab|board.pcb]"
15
16 clean:
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
20
21 web: $(WEB_FILES)
22         test -d $(WEB_DIR) && install -m 644 $(WEB_FILES) $(WEB_DIR)
23
24 board.pcb: board.sch board.prj
25         gsch2pcb board.prj
26
27 pcb-front.png: board.pcb
28         pcb -x png --dpi 150 --photo-mode board.pcb \
29                 && mv board.png $@
30
31 pcb-back.png: board.pcb
32         pcb -x png --dpi 150 --photo-mode --photo-flip-x board.pcb \
33                 && mv board.png $@
34
35 schematics.png: board.sch
36         gschem -s image.scm board.sch -o schematics.png
37
38 handlebar-big.png: handlebar.sch
39         gschem -s image.scm handlebar.sch -o handlebar-big.png
40
41 handlebar.png: handlebar-big.png
42         convert -crop 450x300+320+170 handlebar-big.png handlebar.png
43
44 gerber: $(GERBER_FILES)
45
46 $(GERBER_FILES): board.pcb
47         pcb -x gerber board.pcb
48
49 fab: $(GERBER_FILES)
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" '
62
63 .PHONY: gerber