Warp-SE/Makefile

69 lines
2.2 KiB
Makefile
Raw Normal View History

2023-11-27 11:43:52 +00:00
KICAD = /Applications/KiCad/KiCad.app/Contents/MacOS/kicad-cli
LAYERS = F.Cu,In1.Cu,In2.Cu,B.Cu,F.Paste,F.SilkS,B.SilkS,F.Mask,B.Mask,Edge.Cuts
2024-03-29 08:02:32 +00:00
PYTHON = python3
BOM_SCRIPT = ../GW_KiCADBuild/export_bom.py
2023-11-27 11:43:52 +00:00
F_PCB = $@/../WarpSE.kicad_pcb
F_SCH = $@/../WarpSE.kicad_sch
2024-03-29 08:02:32 +00:00
F_NETLIST = $@/WarpSE-NET.xml
F_BOM = $@/WarpSE-BOM.csv
2023-11-27 11:43:52 +00:00
F_POS = $@/WarpSE-top-pos.csv
F_ZIP = $@/WarpSE.4410A-gerber.zip
2024-03-29 08:02:32 +00:00
F_STENCIL = gerber/WarpSE.4410A-stencil.zip
2023-11-27 11:43:52 +00:00
F_SCHPDF = $@/WarpSE.4410A-Schematic.pdf
F_PCBPDF = $@/WarpSE.4410A-Placement.pdf
OPT_GERBER = -l $(LAYERS) --subtract-soldermask --no-netlist --no-x2
CMD_GERBER = pcb export gerbers $(OPT_GERBER) -o $@/ $(F_PCB)
CMD_DRILL = pcb export drill -o $@/ $(F_PCB)
2024-03-29 08:02:32 +00:00
CMD_NETLIST = sch export netlist --format kicadxml -o $(F_NETLIST) $(F_SCH)
2023-11-27 11:43:52 +00:00
OPT_POS = --smd-only --units mm --side front --format csv
CMD_POS = pcb export pos $(OPT_POS) -o $(F_POS) $(F_PCB)
CMD_SCHPDF = sch export pdf --black-and-white --no-background-color -o $(F_SCHPDF) $(F_SCH)
CMD_PCBPDF = pcb export pdf --black-and-white -l F.Fab,Edge.Cuts -o $(F_PCBPDF) $(F_PCB)
2024-03-29 08:02:32 +00:00
.PHONY: all clean gerber stencil Documentation rom
all: gerber stencil Documentation rom
2023-11-27 11:43:52 +00:00
clean:
rm -fr gerber/
2024-03-29 08:02:32 +00:00
rm -fr rom/
2023-11-27 11:43:52 +00:00
rm -f Documentation/WarpSE.4410A-Schematic.pdf
rm -f Documentation/WarpSE.4410A-Placement.pdf
gerber:
mkdir -p $@
$(KICAD) $(CMD_GERBER)
$(KICAD) $(CMD_DRILL)
$(KICAD) $(CMD_POS)
2024-03-29 08:02:32 +00:00
$(KICAD) $(CMD_NETLIST)
2023-11-27 11:43:52 +00:00
sed -i '' 's/PosX/MidX/g' $(F_POS)
sed -i '' 's/PosY/MidY/g' $(F_POS)
sed -i '' 's/Rot/Rotation/g' $(F_POS)
2024-03-29 08:02:32 +00:00
$(PYTHON) $(BOM_SCRIPT) $(F_NETLIST) $(F_BOM)
rm -f $(F_ZIP)
2023-11-27 11:43:52 +00:00
zip -r $(F_ZIP) $@/
2024-03-29 08:02:32 +00:00
stencil: gerber
zip $(F_STENCIL) -xi gerber/WarpSE-F_Paste.gtp
2023-11-27 11:43:52 +00:00
Documentation:
mkdir -p $@
$(KICAD) $(CMD_SCHPDF)
$(KICAD) $(CMD_PCBPDF)
2024-03-29 08:02:32 +00:00
rom:
rm -fr rom/
2023-11-27 11:43:52 +00:00
mkdir -p $@
2024-03-29 08:02:32 +00:00
mkdir -p $@/build
mkdir -p $@/bin
../romtools/bin/bytesplit romsrc/se.bin 2 rom/build/warpse_1508_preswap.bin rom/build/warpse_0700_preswap.bin
../romtools/bin/romswap 11,9,8,13,0,1,14,17,2,3,18,10,12,7,6,5,15,4,16 7,6,5,4,3,2,1,0 rom/build/warpse_1508_preswap.bin rom/bin/warpse_1508.bin
../romtools/bin/romswap 14,13,8,9,18,15,11,10,12,7,16,17,0,1,2,3,4,5,6 7,6,5,4,3,2,1,0 rom/build/warpse_0700_preswap.bin rom/bin/warpse_0700.bin