root/hardware/pr1-basic/trunk/Makefile

Revision 440, 2.3 kB (checked in by dpenev, 1 year ago)

DPN first commit

Line 
1 # Makefile for PR1-basic
2 # Based on Ivan Danov's Makefile for bf1
3 #
4 #       make pcb
5 #               to make pcb from sch
6 #       make schpdf
7 #               to make schematic pdf
8 #       make pcbpdf
9 #               to make pcb pdf
10 #       make [partslist1|partslist2|partslist3|bom|bom2|drc|drc2]
11 #               run gnetlist with selected backend
12 #       make clean
13 #               clean temporary files
14
15 PROJECT = pr1-basic
16
17 FILES = pr1-basic
18
19
20 PCB_PRINT_OPTIONS = --drill-helper --outline --ps-color --media A4
21
22 SCH = $(addsuffix .sch,$(FILES))
23 SCHPDF = $(addsuffix .sch.pdf,$(PROJECT))
24 PCBPDF = $(addsuffix .pcb.pdf,$(PROJECT))
25 PCB = $(addsuffix .pcb,$(PROJECT))
26 BOM = $(addsuffix .bom,$(PROJECT))
27 BOM2 = $(addsuffix .bom2,$(PROJECT))
28 DRC = $(addsuffix .drc,$(PROJECT))
29 DRC2 = $(addsuffix .drc2,$(PROJECT))
30 PARTSLIST1 = $(addsuffix .partslist1,$(PROJECT))
31 PARTSLIST2 = $(addsuffix .partslist2,$(PROJECT))
32 PARTSLIST3 = $(addsuffix .partslist3,$(PROJECT))
33
34 ALL = $(PARTSLIST3) $(DRC) $(DRC2)
35
36 DATE = $(shell date +"%y-%m-%d.%H%M")
37
38 all: $(ALL)
39
40 schpdf: 
41         gschem -o $(PROJECT).sch.ps -s gschem-print.scm $(PROJECT).sch
42         ps2pdf13 $(PROJECT).sch.ps $(SCHPDF)
43         rm $(PROJECT).sch.ps
44
45 pcbpdf:
46         pcb -x ps $(PCB_PRINT_OPTIONS) $(PROJECT).pcb
47         ps2pdf13 $(PROJECT).ps $(PCBPDF)
48         rm $(PROJECT).ps
49
50 partslist: $(PARTSLIST3)
51
52 partslist1: $(PARTSLIST1)
53
54 partslist2: $(PARTSLIST2)
55
56 partslist3: $(PARTSLIST3)
57
58 bom: $(BOM)
59
60 bom2: $(BOM2)
61
62 drc: $(DRC)
63
64 drc2: $(DRC2)
65
66 pcb: $(PCB)
67
68 %.pcb: $(SCH) Makefile
69         gsch2pcb -v -v -d pkg/newlib -o $(PROJECT) $(filter %.sch,$^) > make_pcb.log 2>&1
70
71 %.drc: $(SCH) Makefile
72         echo "DRC is broken, fix it if you know how"
73         #gnetlist -g drc $(filter %.sch,$^) -o $@
74
75 %.drc2: $(SCH) Makefile
76         gnetlist -g drc2 $(filter %.sch,$^) -o $@
77
78 %.bom: $(SCH) Makefile
79         gnetlist -g bom $(filter %.sch,$^) -o $@
80
81 %.bom2: $(SCH) Makefile
82         gnetlist -g bom2 $(filter %.sch,$^) -o $@
83
84 %.partslist1: $(SCH) Makefile
85         gnetlist -g partslist1 $(filter %.sch,$^) -o $@
86
87 %.partslist2: $(SCH) Makefile
88         gnetlist -g partslist2 $(filter %.sch,$^) -o $@
89
90 %.partslist3: $(SCH) Makefile
91         gnetlist -g partslist3 $(filter %.sch,$^) -o $@
92
93 clean:
94         $(RM) $(ALL)
95         $(RM) *.sch~ *.log
96         $(RM) $(BOM)
97         $(RM) $(BOM2)
98         $(RM) $(DRC)
99         $(RM) $(DRC2)
100         $(RM) $(PARTSLIST1)
101         $(RM) $(PARTSLIST2)
102         $(RM) $(PARTSLIST3)
103         $(RM) $(SCHPS)
104         $(RM) $(SCHPDF)
105         $(RM) $(PCBPDF)
106         $(RM) $(PROJECT).cmd
107         $(RM) $(PROJECT).ps
108         $(RM) $(PROJECT).sch.ps
109         $(RM) $(PROJECT).pcb.bak*
110         $(RM) *.pcb~    #DPN
111         $(RM) \#*\#
112         $(RM) *new.pcb
Note: See TracBrowser for help on using the browser.