]> www.fi.muni.cz Git - bike-lights.git/blob - schematics/Makefile
d987f9699f0457dcdef7354d7b5cac195ac63e97
[bike-lights.git] / schematics / Makefile
1 WEB_DIR=/home/kas/html/bike-lights/
2 WEB_FILES=pcb-back.png pcb-front.png
3 GERBER_FILES=\
4         lights.top.gbr \
5         lights.bottom.gbr \
6         lights.topmask.gbr \
7         lights.bottommask.gbr \
8         lights.topsilk.gbr \
9         lights.bottomsilk.gbr \
10         lights.plated-drill.cnc
11
12 all:
13         @echo "Usage: make [clean|web|gerber|fab|lights.pcb]"
14
15 clean:
16         rm -f lights.cmd lights.jpg lights.net lights.new.pcb lights.pcb- \
17                 lights.png lights.ps lights.sch~ pcb-back.png pcb-front.png \
18                 *.gbr *.cnc
19
20 web: pcb-back.png pcb-front.png
21         test -d $(WEB_DIR) && install -m 644 $(WEB_FILES) $(WEB_DIR)
22
23 lights.pcb: lights.sch lights.prj
24         gsch2pcb lights.prj
25
26 pcb-front.png: lights.pcb
27         pcb -x png --dpi 150 --photo-mode lights.pcb \
28                 && mv lights.png $@
29
30 pcb-back.png: lights.pcb
31         pcb -x png --dpi 150 --photo-mode --photo-flip-x lights.pcb \
32                 && mv lights.png $@
33
34 gerber: $(GERBER_FILES)
35
36 $(GERBER_FILES): lights.pcb
37         pcb -x gerber lights.pcb
38
39 fab: $(GERBER_FILES)
40         @sh -c 'D=bike-lights-`date +\%Y\%m\%d-\%H\%M` && mkdir $$D && \
41                 cp lights.top.gbr $$D/bike-lights.gtl && \
42                 cp lights.bottom.gbr $$D/bike-lights.gbl && \
43                 cp lights.topmask.gbr $$D/bike-lights.gts && \
44                 cp lights.bottommask.gbr $$D/bike-lights.gbs && \
45                 cp lights.topsilk.gbr $$D/bike-lights.gto && \
46                 cp lights.bottomsilk.gbr $$D/bike-lights.gbo && \
47                 cp lights.plated-drill.cnc $$D/bike-lights.txt && \
48                 zip -r $$D.zip $$D && \
49                 echo "Done. Output in $$D.zip."; \
50                 echo "You may also want to do git tag gerber-fab-$$D" '
51
52 .PHONY: gerber