# Makefile for PR1-basic # Based on Ivan Danov's Makefile for bf1 # # make pcb # to make pcb from sch # make schpdf # to make schematic pdf # make pcbpdf # to make pcb pdf # make [partslist1|partslist2|partslist3|bom|bom2|drc|drc2] # run gnetlist with selected backend # make clean # clean temporary files PROJECT = pr1-basic FILES = pr1-basic PCB_PRINT_OPTIONS = --drill-helper --outline --ps-color --media A4 SCH = $(addsuffix .sch,$(FILES)) SCHPDF = $(addsuffix .sch.pdf,$(PROJECT)) PCBPDF = $(addsuffix .pcb.pdf,$(PROJECT)) PCB = $(addsuffix .pcb,$(PROJECT)) BOM = $(addsuffix .bom,$(PROJECT)) BOM2 = $(addsuffix .bom2,$(PROJECT)) DRC = $(addsuffix .drc,$(PROJECT)) DRC2 = $(addsuffix .drc2,$(PROJECT)) PARTSLIST1 = $(addsuffix .partslist1,$(PROJECT)) PARTSLIST2 = $(addsuffix .partslist2,$(PROJECT)) PARTSLIST3 = $(addsuffix .partslist3,$(PROJECT)) ALL = $(PARTSLIST3) $(DRC) $(DRC2) DATE = $(shell date +"%y-%m-%d.%H%M") all: $(ALL) schpdf: gschem -o $(PROJECT).sch.ps -s gschem-print.scm $(PROJECT).sch ps2pdf13 $(PROJECT).sch.ps $(SCHPDF) rm $(PROJECT).sch.ps pcbpdf: pcb -x ps $(PCB_PRINT_OPTIONS) $(PROJECT).pcb ps2pdf13 $(PROJECT).ps $(PCBPDF) rm $(PROJECT).ps partslist: $(PARTSLIST3) partslist1: $(PARTSLIST1) partslist2: $(PARTSLIST2) partslist3: $(PARTSLIST3) bom: $(BOM) bom2: $(BOM2) drc: $(DRC) drc2: $(DRC2) pcb: $(PCB) %.pcb: $(SCH) Makefile gsch2pcb -v -v -d pkg/newlib -o $(PROJECT) $(filter %.sch,$^) > make_pcb.log 2>&1 %.drc: $(SCH) Makefile echo "DRC is broken, fix it if you know how" #gnetlist -g drc $(filter %.sch,$^) -o $@ %.drc2: $(SCH) Makefile gnetlist -g drc2 $(filter %.sch,$^) -o $@ %.bom: $(SCH) Makefile gnetlist -g bom $(filter %.sch,$^) -o $@ %.bom2: $(SCH) Makefile gnetlist -g bom2 $(filter %.sch,$^) -o $@ %.partslist1: $(SCH) Makefile gnetlist -g partslist1 $(filter %.sch,$^) -o $@ %.partslist2: $(SCH) Makefile gnetlist -g partslist2 $(filter %.sch,$^) -o $@ %.partslist3: $(SCH) Makefile gnetlist -g partslist3 $(filter %.sch,$^) -o $@ clean: $(RM) $(ALL) $(RM) *.sch~ *.log $(RM) $(BOM) $(RM) $(BOM2) $(RM) $(DRC) $(RM) $(DRC2) $(RM) $(PARTSLIST1) $(RM) $(PARTSLIST2) $(RM) $(PARTSLIST3) $(RM) $(SCHPS) $(RM) $(SCHPDF) $(RM) $(PCBPDF) $(RM) $(PROJECT).cmd $(RM) $(PROJECT).ps $(RM) $(PROJECT).sch.ps $(RM) $(PROJECT).pcb.bak* $(RM) *.pcb~ #DPN $(RM) \#*\# $(RM) *new.pcb