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