]> www.fi.muni.cz Git - tinyboard.git/blob - Makefile
WIP: on-demand sleep modes
[tinyboard.git] / Makefile
1 WEB_DIR=/home/kas/html/tinyboard/
2 WEB_FILES=pcb-back.png pcb-front.png schematics.png schematics-power.png \
3         schematics-pin.png
4 GERBER_FILES=\
5         tinyboard-panel.top.gbr \
6         tinyboard-panel.bottom.gbr \
7         tinyboard-panel.topmask.gbr \
8         tinyboard-panel.bottommask.gbr \
9         tinyboard-panel.topsilk.gbr \
10         tinyboard-panel.bottomsilk.gbr \
11         tinyboard-panel.plated-drill.cnc
12
13 all:
14         @echo "Usage: make [clean|web|gerber|fab|tinyboard.pcb]"
15
16 clean:
17         rm -f tinyboard.cmd tinyboard.jpg tinyboard.net tinyboard.new.pcb tinyboard.pcb- \
18                 tinyboard.png tinyboard.ps tinyboard.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 tinyboard.pcb: tinyboard.sch tinyboard.prj
25         gsch2pcb tinyboard.prj
26
27 pcb-front.png: tinyboard.pcb
28         pcb -x png --dpi 200 --photo-mode tinyboard.pcb \
29                 && mv tinyboard.png $@
30
31 pcb-back.png: tinyboard.pcb
32         pcb -x png --dpi 200 --photo-mode --photo-flip-y tinyboard.pcb \
33                 && mv tinyboard.png $@
34
35 schematics.png: tinyboard.sch
36         gschem -s image.scm tinyboard.sch -o schematics.png
37
38 schematics-power.png: schematics.png
39         convert -crop 160x480+60+120 schematics.png $@
40
41 schematics-pin.png: schematics.png
42         convert -crop 570x218+400+90 schematics.png $@
43
44 gerber: $(GERBER_FILES)
45
46 $(GERBER_FILES): tinyboard-panel.pcb
47         pcb -x gerber tinyboard-panel.pcb
48
49 fab: $(GERBER_FILES)
50         @sh -c 'D=tinyboard-`date +\%Y\%m\%d-\%H\%M` && mkdir $$D && \
51                 cp tinyboard-panel.top.gbr $$D/tinyboard.gtl && \
52                 cp tinyboard-panel.bottom.gbr $$D/tinyboard.gbl && \
53                 cp tinyboard-panel.topmask.gbr $$D/tinyboard.gts && \
54                 cp tinyboard-panel.bottommask.gbr $$D/tinyboard.gbs && \
55                 cp tinyboard-panel.topsilk.gbr $$D/tinyboard.gto && \
56                 cp tinyboard-panel.bottomsilk.gbr $$D/tinyboard.gbo && \
57                 cp tinyboard-panel.plated-drill.cnc $$D/tinyboard.txt && \
58                 zip -r $$D.zip $$D && \
59                 echo "Done. Output in $$D.zip."; \
60                 echo "You may also want to do git tag gerber-fab-$$D" '
61
62 .PHONY: gerber