ee = {{ eeĀ }} sch = {{ sch | ninja_path }} sch_files = {{ sch_files | ninja_path }} pcb = {{ pcb | ninja_path }} rule kicad-gerber description = kicad-gerber command = $ee kicad-gerber $ --output-dir $gerber_dir $ --pcb $pcb # mkdir -p $( # (cd $(GERBER_DIR); zip tmp.zip $(foreach GBR,$(GERBERS),$(notdir $(GBR)))) # mv $(GERBER_DIR)/tmp.zip $@ rule kicad-make-bom description = kicad-make-bom $out_dir command = $ee kicad-make-bom --sch $sch --out $out_dir $strategy rule part-create-distributor-search-list description = part-create-distributor-search-list distributor=$distributor $in_dir => $out_dir command = $ee part-create-distributor-search-list --in $in_dir --out $out_dir rule digikey-search-parts description = digikey-search-parts command = $ee digikey-search-parts --in $in_dir --out $out_dir rule digikey-normalize-facts description = digikey-normalize-facts command = $ee digikey-normalize-facts --in $in_dir --out $out_dir rule element14-search-parts description = element14-search-parts command = $ee element14-search-parts --in $in_dir --out $out_dir rule element14-normalize-facts description = element14-normalize-facts command = $ee element14-normalize-facts --in $in_dir --out $out_dir rule create-order description = create-order command = $ee create-order --schematic $sch_dir --part-db $part_dbs --out $out_dir rule import-parts-yaml description = import-parts-yaml $in command = $ee import-parts-yaml --in $in --out $out_dir {% if gerber_zip is defined %} build gerbers: phony {{ gerber_zip }} build {{ gerber_zip }}: kicad-gerber $pcb gerber_dir = {{ gerber_zip | parent_dir }} {%- endif %} build ee/sch/index.xml: kicad-make-bom $sch out_dir = ee/sch strategy = {{ "--strategy " + kicad_bom_strategy if kicad_bom_strategy else "" }} {%- for d in distributors %} # Distributor {{ d }} build ee/{{ d }}/search-list/index.xml: part-create-distributor-search-list ee/sch/index.xml in_dir = ee/sch out_dir = ee/{{ d }}/search-list build ee/{{ d }}/downloaded/index.xml: {{ d }}-search-parts ee/{{ d }}/search-list/index.xml in_dir = ee/{{ d }}/search-list out_dir = ee/{{ d }}/downloaded build ee/{{ d }}/normalized/index.xml: {{ d }}-normalize-facts ee/{{ d }}/downloaded/index.xml in_dir = ee/{{ d }}/downloaded out_dir = ee/{{ d }}/normalized default ee/{{ d }}/normalized/index.xml {%- endfor %} {%- for f in parts_yaml_files %} {% set out=(f | parent_dir) / (f | noext) / "index.xml" %} build {{ out }}: import-parts-yaml {{ f }} out_dir = {{ f | parent_dir }}/{{ f | noext }} # default {{ out }} {% endfor %} build ee/order/index.xml: create-order ee/sch/index.xml {%- for p in part_dbs %} {{ p / "index.xml" }}{% endfor %} sch_dir = ee/sch out_dir = ee/order part_dbs ={%- for p in part_dbs %} {{ p }}{% endfor %} default ee/order/index.xml