]> www.fi.muni.cz Git - openparking.git/blob - Makefile
df8eded6237449251e357b2c342eb33c36c02630
[openparking.git] / 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.plated-drill.cnc
11
12 all:
13         @echo "Usage: make [clean|web|gerber|fab|board.pcb]"
14
15 clean:
16         rm -f board.cmd board.jpg board.net board.new.pcb board.pcb- \
17                 board.png board.ps board.sch~ pcb-back.png pcb-front.png \
18                 schematics.png *.gbr *.cnc
19
20 web: $(WEB_FILES)
21         test -d $(WEB_DIR) && install -m 644 $(WEB_FILES) $(WEB_DIR)
22
23 board.pcb: board.sch board.prj
24         gsch2pcb board.prj
25
26 pcb-front.png: board.pcb
27         pcb -x png --dpi 150 --photo-mode board.pcb \
28                 && mv board.png $@
29
30 pcb-back.png: board.pcb
31         pcb -x png --dpi 150 --photo-mode --photo-flip-x board.pcb \
32                 && mv board.png $@
33
34 schematics.png: board.sch
35         gschem -s image.scm board.sch -o schematics.png
36
37 handlebar-big.png: handlebar.sch
38         gschem -s image.scm handlebar.sch -o handlebar-big.png
39
40 handlebar.png: handlebar-big.png
41         convert -crop 450x300+320+170 handlebar-big.png handlebar.png
42
43 gerber: $(GERBER_FILES)
44
45 $(GERBER_FILES): board.pcb
46         pcb -x gerber board.pcb
47
48 fab: $(GERBER_FILES)
49         @sh -c 'D=board-`date +\%Y\%m\%d-\%H\%M` && mkdir $$D && \
50                 cp board.top.gbr $$D/board.gtl && \
51                 cp board.bottom.gbr $$D/board.gbl && \
52                 cp board.topmask.gbr $$D/board.gts && \
53                 cp board.bottommask.gbr $$D/board.gbs && \
54                 cp board.topsilk.gbr $$D/board.gto && \
55                 cp board.bottomsilk.gbr $$D/board.gbo && \
56                 cp board.plated-drill.cnc $$D/board.txt && \
57                 zip -r $$D.zip $$D && \
58                 echo "Done. Output in $$D.zip."; \
59                 echo "You may also want to do git tag gerber-fab-$$D" '
60
61 .PHONY: gerber