WEB_DIR=/home/kas/html/heater/ WEB_FILES=pcb-back.png pcb-front.png schematics.png GERBER_FILES=\ heater-panel.top.gbr \ heater-panel.bottom.gbr \ heater-panel.topmask.gbr \ heater-panel.bottommask.gbr \ heater-panel.topsilk.gbr \ heater-panel.bottomsilk.gbr \ heater-panel.plated-drill.cnc all: @echo "Usage: make [clean|web|gerber|fab|heater.pcb]" clean: rm -f heater.cmd heater.jpg heater.net heater.new.pcb heater.pcb- \ heater.png heater.ps heater.sch~ pcb-back.png pcb-front.png \ schematics.png *.gbr *.cnc web: $(WEB_FILES) test -d $(WEB_DIR) && install -m 644 $(WEB_FILES) $(WEB_DIR) heater.pcb: heater.sch heater.prj gsch2pcb heater.prj pcb-front.png: heater.pcb pcb -x png --dpi 200 --photo-mode heater.pcb \ && mv heater.png $@ pcb-back.png: heater.pcb pcb -x png --dpi 200 --photo-mode --photo-flip-y heater.pcb \ && mv heater.png $@ schematics.png: heater.sch gschem -s image.scm heater.sch -o schematics.png gerber: $(GERBER_FILES) $(GERBER_FILES): heater-panel.pcb pcb -x gerber heater-panel.pcb fab: $(GERBER_FILES) @sh -c 'D=heater-`date +\%Y\%m\%d-\%H\%M` && mkdir $$D && \ cp heater-panel.top.gbr $$D/heater.gtl && \ cp heater-panel.bottom.gbr $$D/heater.gbl && \ cp heater-panel.topmask.gbr $$D/heater.gts && \ cp heater-panel.bottommask.gbr $$D/heater.gbs && \ cp heater-panel.topsilk.gbr $$D/heater.gto && \ cp heater-panel.bottomsilk.gbr $$D/heater.gbo && \ cp heater-panel.plated-drill.cnc $$D/heater.txt && \ zip -r $$D.zip $$D && \ echo "Done. Output in $$D.zip."; \ echo "You may also want to do git tag gerber-fab-$$D" ' .PHONY: gerber