-
Notifications
You must be signed in to change notification settings - Fork 16
/
Makefile
83 lines (61 loc) · 1.51 KB
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
NAME = buildbotics_controller
VERSION=13.0
SCHEMATICS = $(wildcard *.sch)
SYMBOLS = $(wildcard symbols/*.sym)
FOOTPRINTS = $(wildcard footprints/*.fp)
PDFS = $(patsubst %.sch,%.pdf,$(SCHEMATICS))
PDF=doc/$(NAME)-v$(VERSION).pdf
PCB_PDF=doc/$(NAME)-pcb-v$(VERSION).pdf
ifeq ($(PCB),)
PCB=pcb
endif
ifeq ($(SCHEM),)
ifeq ($(shell which gschem),)
SCHEM=lepton-schematic
SCH2PCB=lepton-sch2pcb
NETLIST=lepton-netlist
ATTRIB=lepton-attrib
else
SCHEM=gschem
SCH2PCB=gsch2pcb
NETLIST=gnetlist
ATTRIB=gattrib
endif
endif
all: drc
%.pdf: %.sch
$(SCHEM) -o $@ -s print.scm $<
%.ps: %.pcb
$(PCB) -x ps --psfile $@ $<
pdf: $(PDF) $(PCB_PDF)
$(PCB_PDF): $(NAME).ps
ps2pdf $< $@
$(PDF): $(PDFS)
gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=$@ $(PDFS)
rm $(PDFS)
view: $(PDF)
evince $(PDF)
schematics:
$(SCHEM) -q -- $(NAME).sch&
pcb:
$(PCB) $(NAME).pcb&
net: $(SCHEMATICS)
$(NETLIST) -g geda -o $(NAME).net $(NAME).sch
bom: $(SCHEMATICS)
$(NETLIST) -g partslist3 -o $(NAME).bom $(NAME).sch
drc:
$(NETLIST) -g drc2 -o - $(NAME).sch
attrib:
$(ATTRIB) $(SCHEMATICS)
layout: $(SCHEMATICS) $(FOOTPRINTS) $(SYMBOLS)
$(SCH2PCB) -v --elements-dir footprints/ $(NAME).sch -o $(NAME)
zip:
zip $(NAME).zip *.gbr *.cnc
clean-layout:
rm -f $(NAME).pcb $(NAME).new.pcb $(NAME).net $(NAME).cmd $(NAME).bom
tidy:
rm -f $(shell find . -name \*~ -o -name \#\* -o -name \*-) \
*.bak *.log *.backup $(NAME).ps PCB*.save
clean: tidy
rm -f *.cnc *.gbr $(NAME).zip $(NAME).net $(NAME).bom $(PDFS)
.SECONDARY: $(PDFS) $(NAME).ps