Date:2011-03-22 14:49:14 (8 years 6 months ago)
Author:Werner Almesberger
Commit:6caa0d36ab55987c506d2d242aef978132ec6f09
Message:consolidated atben/Makefile and atusb/Makefile into common template

- makefiles/Makefile.kicad: common template for (some) KiCad projects
- atben/Makefile, atusb/Makefile: use makefiles/Makefile.kicad
Files: atben/Makefile (1 diff)
atusb/Makefile (1 diff)
makefiles/Makefile.kicad (1 diff)

Change Details

atben/Makefile
1PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones
2CPTX = ../../eda-tools/mlztx/cptx
3GMERGE = ../../eda-tools/gerber/gmerge
4PRETTYGERBV=../../eda-tools/gerber/prettygerbv
5
61NAME = atben
72VERSION = 110314
8DIR = $(NAME)
9
10SCH=$(shell pwd)/$(NAME).sch
11BRD=$(shell pwd)/$(NAME).brd
12
13.PHONY: all gen generate sch brd xpdf front back clean
14.PHONY: gerber gerbv
15
16all:
17        @echo "make what ? target: gen sch brd xpdf"
18        @exit 1
19
20gen generate:
21        eeschema --plot=ps $(SCH)
22        # need scripts
23
24sch:
25        eeschema $(SCH)
26
27brd:
28        pcbnew $(BRD)
293
30xpdf:
31        xpdf $(NAME).pdf
32
33front: $(NAME)-Front.ps
34        lpr $<
35
36back: $(NAME)-Back.ps
37        lpr $<
4include ../makefiles/Makefile.kicad
385
396# Copy text from front copper to front silk screen
407
418cptx:
429        $(CPTX) -i $(NAME).brd 15 51950 30550 21 51950 30550
43
44# --- Industrial production ---------------------------------------------------
45
46PCB_FILES = README-PCB $(NAME)-PCB_Edges.dxf $(NAME).drl \
47            $(NAME)-SilkS_Front.gto $(NAME)-Mask_Front.gts \
48            $(NAME)-Front.gtl $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs \
49            $(NAME)-PCB_Edges.gbr
50
51gerber:
52        pcbnew --plot=gerber --origin=aux \
53          -l `pcbnew --list-layers $(BRD) | tr '\012' ,` \
54          --fill-all-zones --exclude-pcb-edge \
55          $(BRD)
56        $(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \
57          || { rm -rf _tmp; exit 1; }
58        mv _tmp $(NAME)-SilkS_Front.gto
59
60fab: gerber
61        pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD)
62        pcbnew --drill --origin=aux $(BRD)
63        mkdir -p fab
64        tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \
65          $(PCB_FILES:%=$(DIR)/%)
66        cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \
67          $(PCB_FILES:%=$(DIR)/%)
68
69gerbv:
70        gerbv $(NAME)-SilkS_Front.gto \
71          $(NAME)-SoldP_Front.gtp \
72          $(NAME)-Front.gtl \
73          $(NAME)-Mask_Front.gts \
74          $(NAME)-Mask_Back.gbs \
75          $(NAME)-Back.gbl
76
77upload:
78        qippl fab/$(NAME)-pcb-$(VERSION).tar.gz \
79          fab/$(NAME)-pcb-$(VERSION).zip wpan/fab
80
81# --- Overviews images --------------------------------------------------------
82
83overview: gerber
84        $(PRETTYGERBV) $(NAME) all overview.png
85
86uoverview: overview
87        qippl overview.png wpan/tmp/$(NAME)-$(VERSION)-overview.png
88
89# --- DIY production (toner transfer) -----------------------------------------
90
91#
92# Postscript for production of front/back layer, using the toner transfer
93# method. Note that other artwork transfer methods may require different
94# mirror settings.
95#
96# We use --ps-pads-drill-opt=none to avoid having any hole before drilling,
97# which yields the best results with a CNC drill. For manual drilling, "real"
98# would be preferrable. Do not use "small", for this created holes that are
99# larger (!) than designed.
100#
101
102%-Front.ps: %.brd
103        $(PLOT_BRD) -l Front --mirror $<
104
105%-Back.ps: %.brd
106        $(PLOT_BRD) -l Back $<
107
108# --- Cleanup -----------------------------------------------------------------
109
110clean:
111        rm -f $(NAME)-Front.ps $(NAME)-Back.ps
112        rm -f $(NAME).drl $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf
113        rm -f $(NAME)-Front.gtl $(NAME)-Mask_Front.gts
114        rm -f $(NAME)-SilkS_Front.gto $(NAME)-SoldP_Front.gtp
115        rm -f $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs
116        rm -f $(NAME)-SilkS_Back.gbo $(NAME)-SoldP_Back.gbp
117        rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr
118        rm -f overview.png
119
120spotless: clean
121        rm -f '$$'savepcb.000 '$$'savepcb.brd
122        rm -f $(NAME)-cache.lib $(NAME).000 $(NAME).bak
123        rm -f $(NAME).net
atusb/Makefile
1PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones
2CPTX = ../../eda-tools/mlztx/cptx
3GMERGE = ../../eda-tools/gerber/gmerge
4PRETTYGERBV=../../eda-tools/gerber/prettygerbv
5
61NAME = atusb
72VERSION = 110314
8DIR = $(NAME)
9
10SCH=$(shell pwd)/$(NAME).sch
11BRD=$(shell pwd)/$(NAME).brd
12
13.PHONY: all gen generate sch brd xpdf front back clean
14.PHONY: gerber gerbv fab
15
16all:
17        @echo "make what ? target: gen sch brd xpdf front back clean"
18        @exit 1
19
20gen generate:
21        eeschema --plot=ps $(SCH)
22        # need scripts
23
24sch:
25        eeschema $(SCH)
263
27brd:
28        pcbnew $(BRD)
29
30xpdf:
31        xpdf $(NAME).pdf
32
33front: $(NAME)-Front.ps
34        lpr $<
35
36back: $(NAME)-Back.ps
37        lpr $<
4include ../makefiles/Makefile.kicad
385
396cptx:
407        $(CPTX) -i $(NAME).brd 0 47000 48100 21 46811 40591
418
42# --- DIY production (toner transfer) -----------------------------------------
43
44#
45# Postscript for production of front/back layer, using the toner transfer
46# method. Note that other artwork transfer methods may require different
47# mirror settings.
48#
49# We use --ps-pads-drill-opt=none to avoid having any hole before drilling,
50# which yields the best results with a CNC drill. For manual drilling, "real"
51# would be preferrable. Do not use "small", for this created holes that are
52# larger (!) than designed.
53#
54
55%-Front.ps: %.brd
56        $(PLOT_BRD) -l Front --mirror $<
57
58%-Back.ps: %.brd
59        $(PLOT_BRD) -l Back $<
60
61# --- Industrial production ---------------------------------------------------
62
63PCB_FILES = README-PCB $(NAME)-PCB_Edges.dxf $(NAME).drl \
64        $(NAME)-SilkS_Front.gto $(NAME)-Mask_Front.gts \
65        $(NAME)-Front.gtl $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs \
66        $(NAME)-PCB_Edges.gbr
67
68gerber:
69        pcbnew --plot=gerber --origin=aux \
70          -l `pcbnew --list-layers $(BRD) | tr '\012' ,` \
71          --fill-all-zones --exclude-pcb-edge \
72          $(BRD)
73        $(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \
74          || { rm -rf _tmp; exit 1; }
75        mv _tmp $(NAME)-SilkS_Front.gto
76
77fab: gerber
78        pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD)
79        pcbnew --drill --origin=aux $(BRD)
80        mkdir -p fab
81        tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \
82          $(PCB_FILES:%=$(DIR)/%)
83        cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \
84          $(PCB_FILES:%=$(DIR)/%)
85
86gerbv:
87        gerbv $(NAME)-SilkS_Front.gto \
88          $(NAME)-SoldP_Front.gtp \
89          $(NAME)-Front.gtl \
90          $(NAME)-Mask_Front.gts \
91          $(NAME)-Mask_Back.gbs \
92          $(NAME)-Back.gbl
93
94upload:
95        qippl fab/$(NAME)-pcb-$(VERSION).tar.gz \
96          fab/$(NAME)-pcb-$(VERSION).zip wpan/fab
97
98# --- Overview images ---------------------------------------------------------
99
100overview: gerber
101        $(PRETTYGERBV) $(NAME) all overview.png
102
103uoverview: overview
104        qippl overview.png wpan/tmp/$(NAME)-$(VERSION)-overview.png
105
106# --- Cleanup -----------------------------------------------------------------
107
108clean:
109        rm -f $(NAME)-Front.ps $(NAME)-Back.ps
110        rm -f $(NAME).drl $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf
111        rm -f $(NAME)-Front.gtl $(NAME)-Mask_Front.gts
112        rm -f $(NAME)-SilkS_Front.gto $(NAME)-SoldP_Front.gtp
113        rm -f $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs
114        rm -f $(NAME)-SilkS_Back.gbo $(NAME)-SoldP_Back.gbp
115        rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr
116        rm -f overview.png
117
118spotless: clean
119        rm -f '$$'savepcb.brd
120        rm -f $(NAME)-cache.bak atrf.bak usb.bak
121        rm -f $(NAME).000
122        rm -f $(NAME).net
9spotless::
10        rm -f atrf.bak usb.bak
makefiles/Makefile.kicad
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
21PLOT_BRD = pcbnew --plot=ps_a4 --ps-pads-drill-opt=none --fill-all-zones
22CPTX = ../../eda-tools/mlztx/cptx
23GMERGE = ../../eda-tools/gerber/gmerge
24PRETTYGERBV=../../eda-tools/gerber/prettygerbv
25
26DIR = $(shell pwd | sed 's|.*/||')
27
28SCH=$(shell pwd)/$(NAME).sch
29BRD=$(shell pwd)/$(NAME).brd
30
31
32.PHONY: all gen generate sch brd xpdf front back clean
33.PHONY: gerber gerbv fab
34
35all:
36        @echo "make what ? target: gen sch brd xpdf front back clean"
37        @exit 1
38
39gen generate:
40        eeschema --plot=ps $(SCH)
41        # need scripts
42
43sch:
44        eeschema $(SCH)
45
46brd:
47        pcbnew $(BRD)
48
49xpdf:
50        xpdf $(NAME).pdf
51
52front: $(NAME)-Front.ps
53        lpr $<
54
55back: $(NAME)-Back.ps
56        lpr $<
57
58# --- DIY production (toner transfer) -----------------------------------------
59
60#
61# Postscript for production of front/back layer, using the toner transfer
62# method. Note that other artwork transfer methods may require different
63# mirror settings.
64#
65# We use --ps-pads-drill-opt=none to avoid having any hole before drilling,
66# which yields the best results with a CNC drill. For manual drilling, "real"
67# would be preferrable. Do not use "small", for this created holes that are
68# larger (!) than designed.
69#
70
71%-Front.ps: %.brd
72        $(PLOT_BRD) -l Front --mirror $<
73
74%-Back.ps: %.brd
75        $(PLOT_BRD) -l Back $<
76
77# --- Industrial production ---------------------------------------------------
78
79PCB_FILES = README-PCB $(NAME)-PCB_Edges.dxf $(NAME).drl \
80        $(NAME)-SilkS_Front.gto $(NAME)-Mask_Front.gts \
81        $(NAME)-Front.gtl $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs \
82        $(NAME)-PCB_Edges.gbr
83
84gerber:
85        pcbnew --plot=gerber --origin=aux \
86          -l `pcbnew --list-layers $(BRD) | tr '\012' ,` \
87          --fill-all-zones --exclude-pcb-edge \
88          $(BRD)
89        $(GMERGE) $(NAME)-SilkS_Front.gto $(NAME)-Comments.gbr >_tmp \
90          || { rm -rf _tmp; exit 1; }
91        mv _tmp $(NAME)-SilkS_Front.gto
92
93fab: gerber
94        pcbnew --plot=dxf --origin=aux -l PCB_Edges $(BRD)
95        pcbnew --drill --origin=aux $(BRD)
96        mkdir -p fab
97        tar Ccfz .. fab/$(NAME)-pcb-$(VERSION).tar.gz \
98          $(PCB_FILES:%=$(DIR)/%)
99        cd ..; zip -l $(DIR)/fab/$(NAME)-pcb-$(VERSION).zip \
100          $(PCB_FILES:%=$(DIR)/%)
101
102gerbv:
103        gerbv $(NAME)-SilkS_Front.gto \
104          $(NAME)-SoldP_Front.gtp \
105          $(NAME)-Front.gtl \
106          $(NAME)-Mask_Front.gts \
107          $(NAME)-Mask_Back.gbs \
108          $(NAME)-Back.gbl
109
110upload:
111        qippl fab/$(NAME)-pcb-$(VERSION).tar.gz \
112          fab/$(NAME)-pcb-$(VERSION).zip wpan/fab
113
114# --- Overview images ---------------------------------------------------------
115
116overview: gerber
117        $(PRETTYGERBV) $(NAME) all overview.png
118
119uoverview: overview
120        qippl overview.png wpan/tmp/$(NAME)-$(VERSION)-overview.png
121
122# --- Cleanup -----------------------------------------------------------------
123
124clean::
125        rm -f $(NAME)-Front.ps $(NAME)-Back.ps
126        rm -f $(NAME).drl $(NAME)-PCB_Edges.gbr $(NAME)-PCB_Edges.dxf
127        rm -f $(NAME)-Front.gtl $(NAME)-Mask_Front.gts
128        rm -f $(NAME)-SilkS_Front.gto $(NAME)-SoldP_Front.gtp
129        rm -f $(NAME)-Back.gbl $(NAME)-Mask_Back.gbs
130        rm -f $(NAME)-SilkS_Back.gbo $(NAME)-SoldP_Back.gbp
131        rm -f $(NAME)-Comments.gbr $(NAME)-Drawings.gbr
132        rm -f overview.png
133
134spotless:: clean
135        rm -f '$$'savepcb.000 '$$'savepcb.brd
136        rm -f $(NAME)-cache.lib $(NAME)-cache.bak
137        rm -f $(NAME).000
138        rm -f $(NAME).net

Archive Download the corresponding diff file



interactive