fiatlux/pcb/Makefile

56 lines
2.1 KiB
Makefile
Raw Normal View History

2022-05-22 22:01:00 +00:00
.NOTPARALLEL: gen/fab/$(BOARD)-F_Cu.gbr gen/fab/$(BOARD)-B_Cu.gbr gen/fab/$(BOARD)-F_Mask.gbr gen/fab/$(BOARD)-B_Mask.gbr gen/fab/$(BOARD)-F_Paste.gbr gen/fab/$(BOARD)-B_Paste.gbr gen/fab/$(BOARD)-F_SilkS.gbr gen/fab/$(BOARD)-B_SilkS.gbr
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
all: test fab doc pcb
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
test: gen/$(BOARD)-drc.txt gen/$(BOARD)-erc.txt
pcb: $(BOARD)_pcb.zip
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
doc: gen/$(BOARD).pdf gen/$(BOARD)-front.svg gen/$(BOARD)-back.svg
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
fab: test gen/$(BOARD)_fab.zip gen/$(BOARD).csv gen/$(BOARD)-top-pos.csv
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
$(BOARD)_pcb.zip: fab doc
@mkdir -p gen
cd gen; zip -r ../$(BOARD)_pcb.zip $(BOARD)_fab.zip $(BOARD).csv $(BOARD)-top-pos.csv $(BOARD)-front.svg $(BOARD)-back.svg $(BOARD).pdf
cd gen; zip -r ../$(BOARD)_debug.zip .
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/$(BOARD)_fab.zip: gen/fab/$(BOARD)-F_Cu.gbr gen/fab/$(BOARD)-B_Cu.gbr gen/fab/$(BOARD)-F_Mask.gbr gen/fab/$(BOARD)-B_Mask.gbr
gen/$(BOARD)_fab.zip: gen/fab/$(BOARD)-F_Paste.gbr gen/fab/$(BOARD)-B_Paste.gbr gen/fab/$(BOARD)-F_SilkS.gbr gen/fab/$(BOARD)-B_SilkS.gbr
2021-07-12 18:51:38 +00:00
@mkdir -p gen/fab
2022-05-22 22:01:00 +00:00
cd gen/fab; zip -r ../$(BOARD)_fab.zip *.gbr
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/$(BOARD)-erc.txt: $(BOARD).kiplot.yaml $(BOARD).kicad_pro $(BOARD).kicad_pcb
2021-07-12 18:51:38 +00:00
@mkdir -p gen
2022-05-22 22:01:00 +00:00
kibot -d gen -c $(BOARD).kiplot.yaml -s update_xml,run_drc -i
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/$(BOARD)-drc.txt: $(BOARD).kiplot.yaml $(BOARD).kicad_pro $(BOARD).kicad_sch
2021-07-12 18:51:38 +00:00
@mkdir -p gen
2022-05-22 22:01:00 +00:00
kibot -d gen -c $(BOARD).kiplot.yaml -s update_xml,run_erc -i
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/fab/%.gbr: $(BOARD).kiplot.yaml $(BOARD).kicad_pro $(BOARD).kicad_pcb
2021-07-12 18:51:38 +00:00
@mkdir -p gen
2022-05-22 22:01:00 +00:00
kibot -d gen -c $(BOARD).kiplot.yaml -s all print_front gerbers
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/$(BOARD)-top-pos.csv: $(BOARD).kiplot.yaml $(BOARD).kicad_pro $(BOARD).kicad_pcb
2021-07-12 18:51:38 +00:00
@mkdir -p gen
2022-05-22 22:01:00 +00:00
kibot -d gen -c $(BOARD).kiplot.yaml -s all print_front position
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/$(BOARD).csv: $(BOARD).kiplot.yaml $(BOARD).kicad_pro $(BOARD).kicad_pcb
2021-07-12 18:51:38 +00:00
@mkdir -p gen
2022-05-22 22:01:00 +00:00
kibot -d gen -c $(BOARD).kiplot.yaml -s all print_front bom
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/$(BOARD).pdf: $(BOARD).kiplot.yaml $(BOARD).kicad_pro $(BOARD).kicad_sch
2021-07-12 18:51:38 +00:00
@mkdir -p gen
2022-05-22 22:01:00 +00:00
kibot -d gen -c $(BOARD).kiplot.yaml -s run_drc,run_erc print_sch
2021-07-12 18:51:38 +00:00
2022-05-22 22:01:00 +00:00
gen/$(BOARD)-front.svg: $(BOARD).kicad_pcb
2021-07-12 18:51:38 +00:00
@mkdir -p gen
pcbdraw --libs default $< $@
2022-05-22 22:01:00 +00:00
gen/$(BOARD)-back.svg: $(BOARD).kicad_pcb
2021-07-12 18:51:38 +00:00
@mkdir -p gen
pcbdraw --libs default --back $< $@
clean:
@rm -rf gen