IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
Source at commit 89bcd3cfa8c798405ce0f7626f2c12f098eacb63 created 12 years 11 months ago. By Werner Almesberger, tools/lib/atben.c (atben_open): corrected comment claiming the clock was 316 MHz | |
---|---|
1 | # |
2 | # Makefile.kicad - Makefile template for KiCAD projects |
3 | # |
4 | # Written 2011 by Werner Almesberger |
5 | # Copyright 2011 Werner Almesberger |
6 | # |
7 | # This program is free software; you can redistribute it and/or modify |
8 | # it under the terms of the GNU General Public License as published by |
9 | # the Free Software Foundation; either version 2 of the License, or |
10 | # (at your option) any later version. |
11 | # |
12 | |
13 | # |
14 | # Define before including this template: |
15 | # |
16 | # NAME project name |
17 | # VERSION "release" version number |
18 | # |
19 | |
20 | |
21 | PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones |
22 | CPTX = ../../eda-tools/mlztx/cptx |
23 | GMERGE = ../../eda-tools/fab/gmerge |
24 | DRL2GERBER = ../../eda-tools/fab/drl2gerber |
25 | PRETTYGERBV = ../../eda-tools/fab/prettygerbv |
26 | POS2FAB = ../../eda-tools/fab/pos2fab |
27 | FPDOC = PATH=$$PATH:../../eda-tools/fab:../../eda-tools/fpd2pdf fpdoc |
28 | |
29 | DIR = $(shell pwd | sed 's|.*/||') |
30 | |
31 | SCH=$(shell pwd)/$(NAME).sch |
32 | BRD=$(shell pwd)/$(NAME).brd |
33 | |
34 | |
35 | .PHONY: all gen generate sch brd xpdf front back clean |
36 | .PHONY: gerber gerbv fab fab-pcb fab-smt overview |
37 | |
38 | all: |
39 | @echo "make what ? target: gen sch brd xpdf front back clean" |
40 | @exit 1 |
41 | |
42 | gen generate: |
43 | eeschema --plot=ps $(SCH) |
44 | # need scripts |
45 | |
46 | sch: |
47 | eeschema $(SCH) |
48 | |
49 | brd: |
50 | pcbnew $(BRD) |
51 | |
52 | xpdf: |
53 | xpdf $(NAME).pdf |
54 | |
55 | front: $(NAME)-Front.ps |
56 | lpr $< |
57 | |
58 | back: $(NAME)-Back.ps |
59 | lpr $< |
60 | |
61 | # --- DIY production (toner transfer) ----------------------------------------- |
62 | |
63 | # |
64 | # Postscript for production of front/back layer, using the toner transfer |
65 | # method. Note that other artwork transfer methods may require different |
66 | # mirror settings. |
67 | # |
68 | # We use --ps-pads-drill-opt=none to avoid having any hole before drilling, |
69 | # which yields the best results with a CNC drill. For manual drilling, "real" |
70 | # would be preferrable. Do not use "small", for this created holes that are |
71 | # larger (!) than designed. |
72 | # |
73 | |
74 | %-Front.ps: %.brd |
75 | $(PLOT_BRD) -l Front --mirror $< |
76 | |
77 | %-Back.ps: %.brd |
78 | $(PLOT_BRD) -l Back $< |
79 | |
80 | # --- Industrial production --------------------------------------------------- |
81 | |
82 | GERBERS = $(NAME)-SilkS_Front.gto $(NAME)-Mask_Front.gts \ |
83 | $(NAME)-Front.gtl $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs \ |
84 | $(NAME)-PCB_Edges.gbr $(NAME)-SoldP_Front.gtp |
85 | |
86 | PCB_FILES = README-PCB $(NAME)-front.png $(NAME)-back.png \ |
87 | $(NAME)-PCB_Edges.dxf $(NAME).drl $(GERBERS) |
88 | |
89 | SMT_FILES = README-SMT $(NAME)-front.png $(NAME)-bom.csv $(NAME)-pos.csv \ |
90 | $(NAME)-footprints.pdf |
91 | |
92 | gerber: $(GERBERS) |
93 | |
94 | $(GERBERS): $(NAME).brd Makefile |
95 | pcbnew --plot=gerber --origin=aux \ |
96 | -l `pcbnew --list-layers $(BRD) | tr '\012' ,` \ |
97 | --fill-all-zones --exclude-pcb-edge \ |
98 | $(BRD) |
99 | $(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \ |
100 | || { rm -rf _tmp; exit 1; } |
101 | mv _tmp $(NAME)-SilkS_Front.gto |
102 | |
103 | fab: fab-pcb fab-smt |
104 | |
105 | $(NAME)-PCB_Edges.dxf: $(NAME).brd |
106 | pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD) |
107 | |
108 | $(NAME).drl: $(NAME).brd |
109 | pcbnew --drill --origin=aux $(BRD) |
110 | |
111 | fab-pcb: $(PCB_FILES) |
112 | mkdir -p fab |
113 | tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \ |
114 | $(PCB_FILES:%=$(DIR)/%) |
115 | cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \ |
116 | $(PCB_FILES:%=$(DIR)/%) |
117 | |
118 | gerbv: |
119 | gerbv $(NAME)-SilkS_Front.gto \ |
120 | $(NAME)-SoldP_Front.gtp \ |
121 | $(NAME)-Front.gtl \ |
122 | $(NAME)-Mask_Front.gts \ |
123 | $(NAME)-Mask_Back.gbs \ |
124 | $(NAME)-Back.gbl \ |
125 | $(NAME)-PCB_Edges.gbr |
126 | |
127 | $(NAME)Front.pos: |
128 | pcbnew --pos $(BRD) |
129 | |
130 | %-pos.csv: %Front.pos %.cmp |
131 | $(POS2FAB) $^ >$@ || { rm -f "$@"; exit 1; } |
132 | |
133 | ../bom/$(NAME)-bom.csv: |
134 | $(MAKE) -C ../bom $(NAME)-bom.csv |
135 | |
136 | %-bom.csv: ../bom/%-bom.csv |
137 | mv $< $@ |
138 | |
139 | %-footprints.pdf: %.pro %.cmp %Front.pos |
140 | $(FPDOC) -a FIDUCIAL $< "$@" || { rm -f "$@"; exit 1; } |
141 | |
142 | fab-smt: $(SMT_FILES) |
143 | mkdir -p fab |
144 | tar Ccfz .. fab/$(NAME)-smt-$(VERSION).tar.gz \ |
145 | $(SMT_FILES:%=$(DIR)/%) |
146 | cd ..; zip -l $(DIR)/fab/$(NAME)-smt-$(VERSION).zip \ |
147 | $(SMT_FILES:%=$(DIR)/%) |
148 | |
149 | upload: |
150 | qippl \ |
151 | fab/$(NAME)-pcb-$(VERSION).tar.gz \ |
152 | fab/$(NAME)-pcb-$(VERSION).zip \ |
153 | fab/$(NAME)-smt-$(VERSION).tar.gz \ |
154 | fab/$(NAME)-smt-$(VERSION).zip \ |
155 | wpan/fab |
156 | |
157 | # --- Overview images --------------------------------------------------------- |
158 | |
159 | %-Drill.gbr: %.drl |
160 | $(DRL2GERBER) $^ >$@ || { rm -f "$@"; exit 1; } |
161 | |
162 | $(NAME)-front.png: gerber $(NAME)-Drill.gbr |
163 | $(PRETTYGERBV) -d $(NAME)-Drill.gbr $(NAME) front \ |
164 | $(NAME)-front.png |
165 | |
166 | $(NAME)-back.png: gerber $(NAME)-Drill.gbr |
167 | $(PRETTYGERBV) -d $(NAME)-Drill.gbr $(NAME) back \ |
168 | $(NAME)-back.png |
169 | |
170 | $(NAME)-overview.png: gerber $(NAME)-Drill.gbr |
171 | $(PRETTYGERBV) -d $(NAME)-Drill.gbr $(NAME) all \ |
172 | $(NAME)-overview.png |
173 | |
174 | overview: $(NAME)-overview.png |
175 | display $(NAME)-overview.png |
176 | |
177 | uoverview: $(NAME)-overview.png |
178 | qippl $(NAME)-overview.png \ |
179 | wpan/tmp/$(NAME)-$(VERSION)-overview.png |
180 | |
181 | # --- Cleanup ----------------------------------------------------------------- |
182 | |
183 | clean:: |
184 | rm -f $(NAME)-Front.ps $(NAME)-Back.ps |
185 | rm -f $(NAME).drl $(NAME)-Drill.gbr |
186 | rm -f $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf |
187 | rm -f $(NAME)-Front.gtl $(NAME)-Mask_Front.gts |
188 | rm -f $(NAME)-SilkS_Front.gto $(NAME)-SoldP_Front.gtp |
189 | rm -f $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs |
190 | rm -f $(NAME)-SilkS_Back.gbo $(NAME)-SoldP_Back.gbp |
191 | rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr |
192 | rm -f $(NAME)-overview.png $(NAME)-front.png $(NAME)-back.png |
193 | rm -f $(NAME)Front.pos $(NAME)-pos.csv |
194 | rm -f $(NAME)-bom.csv $(NAME)-footprints.pdf |
195 | |
196 | spotless:: clean |
197 | rm -f '$$'savepcb.000 '$$'savepcb.brd |
198 | rm -f $(NAME)-cache.lib $(NAME)-cache.bak |
199 | rm -f $(NAME).000 |
200 | rm -f $(NAME).net |
201 |