Root/bacon/case/Makefile

1CAE_TOOLS = /home/qi/cae-tools
2CAMEO = $(CAE_TOOLS)/cameo
3SPOOL = $(CAE_TOOLS)/spool/spool
4CNGT = $(CAE_TOOLS)/cngt/cngt
5GP2RML = $(CAE_TOOLS)/gp2rml/gp2rml
6
7# #1: 5, 5
8# #2: 5, 45
9# #3: 65, 5
10# #3: 70, 45
11# Z1 = -44
12# PIECE_Z = 5.5
13
14# new run (10 45, 135 85, 7.8)
15# #1: 13 45
16# #2: 75 48
17# Z1 = -44
18# PIECE_Z = 7.9
19
20# run with acrylic (corner at 4, 0)
21# #1: 15, 10
22# #2: 15, 50
23# #3: 80, 10
24# PIECE_Z = 5.15
25
26X0 = 80
27Y0 = 10
28Z1 = -45
29PIECE = -5 -5 30 55
30PIECE_Z = 5.15
31Z_STEP = 2
32CLEARANCE = 2
33SPEED_XY = 1
34SPEED_Z = 1
35OVERSHOOT = 0.2
36
37Z_OFFSET = 0.1
38FIN_SPEED_XY = 3
39FIN_SPEED_Z = 3
40
41# acrylic
42# ~0.1 mm / 12 mil tool correction # not needed
43#MILL = 120mil
44SPEED_XY = 2
45SPEED_Z = 2
46FIN_SPEED_XY = 5
47FIN_SPEED_Z = 5
48
49PARAMS = X0=$(X0)mm Y0=$(Y0)mm Z1=$(Z1)mm MILL=$(MILL) PIECE_Z=$(PIECE_Z)mm \
50     Z_OFFSET=$(Z_OFFSET)mm
51
52PARTS = top mid bot
53PART = top
54
55.PHONY: all plot plot-fin mill pos cng clean
56
57all: $(PART)-mill.rml $(PART)-finish.rml
58
59case.gp: case.fpd
60        fped -g case.fpd || { rm -f $@; exit 1; }
61
62$(PART).gp: case.gp
63        $(CAMEO)/fped2d2z.pl -r 0=-$(OVERSHOOT) $(PART) $^ >$@ || \
64            { rm -f $@; exit 1; }
65
66$(PART)-piece.gp: $(PART).gp
67        ./genpiece.pl -r $(PIECE) $< >$@ || { rm -f $@; exit 1; }
68
69$(PART)-area.gp: $(PART)-piece.gp $(PART).gp cam.sh Makefile
70        ./cam.sh PART=$(PART) CAMEO=$(CAMEO)/cameo $(PARAMS) OUT=$@ || \
71            { rm -f $@; exit 1; }
72
73$(PART)-finish.gp: $(PART)-piece.gp $(PART).gp cam.sh Makefile
74        ./cam.sh PART=$(PART) CAMEO=$(CAMEO)/cameo $(PARAMS) \
75            Z_OFFSET=0mm REVERSE=reverse OUT=$@ || { rm -f $@; exit 1; }
76
77$(PART)-mill.gp: $(PART)-area.gp Makefile
78        $(CAMEO)/zstack.pl $(Z1) $(Z_STEP) $< >$@ || \
79            { rm -f $@; exit 1; }
80
81$(PART)-mill.rml: $(PART)-mill.gp Makefile
82        $(GP2RML) $(CLEARANCE) $(SPEED_XY) $(SPEED_Z) $< >$@ || \
83            { rm -f $@; exit 1; }
84
85$(PART)-finish.rml: $(PART)-finish.gp Makefile
86        $(GP2RML) $(CLEARANCE) $(FIN_SPEED_XY) $(FIN_SPEED_Z) \
87            $< >$@ || { rm -f $@; exit 1; }
88
89plot: $(PART)-mill.gp
90        echo 'splot "$<" with lines' | gnuplot -persist
91
92plot-fin: $(PART)-finish.gp
93        echo 'splot "$<" with lines' | gnuplot -persist
94
95mill: $(PART)-mill.rml $(PART)-finish.rml
96        PORT=/dev/ttyUSB0 $(SPOOL) $^
97
98pos:
99        $(CNGT) 0
100
101cng: $(PART)-mill.gp
102        $(CNGT) $(Z1) 10 $<
103
104clean:
105        rm -f case.gp
106        rm -f $(PARTS:%=%-piece.gp) $(PARTS:%=%.gp)
107        rm -f $(PARTS:%=%-area.gp)
108        rm -f $(PARTS:%=%-mill.gp)
109        rm -f $(PARTS:%=%-finish.gp)
110
111spotless: clean
112        rm -f $(PARTS:%=%-mill.rml)
113        rm -f $(PARTS:%=%-finish.rml)
114

Archive Download this file

Branches:
master



interactive