chiark / gitweb /
screw-recess-test: provide recessdepth_arg processing
[reprap-play.git] / Makefile
1
2 HRR=/home/reprap
3 SLIC3R=$(HRR)/Slic3r/bin/slic3r
4 SKEINFORGE=python $(HRR)/reprappro-software.git/skeinforge/skeinforge_application/skeinforge_utilities/skeinforge_craft.py
5
6 CWD := $(shell pwd)
7 PLAY ?= $(CWD)
8
9 CONFIG=$(PLAY)/slic3r-config.ini
10
11 USING_AUTOS ?= filamentspool xeno-drivebay-bracket dungeonquest-cone anke-gps-bracket cable-hole-trunking-cover anglepoise-neck crossbar-computer-led-mount wardrobe-hook knifeblock pandemic-counter
12 AUTO_TOPLEVELS := $(foreach m,$(USING_AUTOS),$(shell $(PLAY)/toplevel-find $m))
13
14 AUTO_INCS = funcs.scad
15
16 default:        autoincs scads
17
18 autoincs:       $(AUTO_INCS)
19 scads:          $(addsuffix .auto.scad, $(AUTO_TOPLEVELS))
20 stls:           $(addsuffix .auto.stl, $(AUTO_TOPLEVELS))
21
22 %.auto.scads:
23         $(MAKE) $(addsuffix .auto.scad, $(shell $(PLAY)/toplevel-find $*))
24 %.auto.stls:
25         $(MAKE) $(addsuffix .auto.stl, $(shell $(PLAY)/toplevel-find $*))
26
27 -include .*.d
28
29 %.stl:          %.scad $(AUTO_INCS)
30                 openscad -d .$@.d.tmp -o $*.tmp.stl $<
31                 @rm -f $@
32                 @sed -e 's/\.tmp\.stl:/.stl:/' <.$@.d.tmp >.$@.d
33                 @rm .$@.d.tmp
34                 mv -f $*.tmp.stl $@
35
36 AUTOBASE=$(shell echo $(1) | perl -pe 's/,\w+\.auto$$//')
37
38 %.gcode:        %.stl $(CONFIG)
39                 $(SLIC3R) --load $(CONFIG) \
40                         --ignore-nonexistent-config \
41                         --load $(call AUTOBASE,$*).slic3r \
42                         --load $*.slic3r \
43                         --output $@.tmp $<
44                 @mv -f $@.tmp $@
45
46 %.gcode-sd:     %.gcode
47                 mount /media/sd
48                 cp $^ /media/sd/JOB.G
49                 sleep 0.5
50                 umount /media/sd
51
52 %:              %.cpp
53                 cpp -nostdinc -P <$< >$@.tmp && mv -f $@.tmp $@
54
55 funcs.scad:
56
57 #%.gcode:       %.stl
58 #               $(SKEINFORGE) $<
59
60 %.gcode:        manual-gcode-generator %.m-g
61                 $(PLAY)/$^ >$@.tmp && mv -f $@.tmp $@
62
63 dovecliptest.stl: doveclip.scad $(AUTO_INCS)
64
65 KNIFEBLOCK_KNIVES= 0 1 2
66 KNIFEBLOCK_TEMPLATES= bl hl
67 KNIFEBLOCK_TEMPLATE_FILES=\
68         $(foreach k,$(KNIFEBLOCK_KNIVES), \
69         $(foreach t,$(KNIFEBLOCK_TEMPLATES), \
70         knifeblock-knives-t$k$t.dxf))
71
72 knifeblock-knives-templates knifeblock.stl: $(KNIFEBLOCK_TEMPLATE_FILES)
73
74 .PRECIOUS: knifeblock-knives-t%.dxf
75 knifeblock-knives-t%.dxf: knifeblock-knives-filter knifeblock-knives-trace.fig
76                 ./$< $(notdir $*) <$(filter %.fig, $^) >$@.tmp.fig
77                 fig2dev -D -30 -L eps <$@.tmp.fig >$@.tmp.eps
78                 pstoedit -dt -f "dxf: -polyaslines -mm" $@.tmp.eps $@
79
80 PANDEMICCOUNTER_LETTERS=30 31 32 33 34 35
81 PANDEMICCOUNTER_DXFS=$(foreach l,$(PANDEMICCOUNTER_LETTERS), \
82         pandemic-counter-l$l.dxf)
83
84 pandemic-counter-letters pandemic-counter%.stl: $(PANDEMICCOUNTER_DXFS)
85
86 .PRECIOUS: pandemic-counter-l%.eps
87 pandemic-counter-l%.eps: pandemic-counter-letters.fig
88                 fig2dev -D +$(notdir $*) -L eps <$< >$@.tmp
89                 @mv -f $@.tmp $@
90
91 %.dxf:          %.eps
92                 pstoedit -dt -f "dxf: -polyaslines -mm" $< $@
93
94 %:              %.pl
95                 ./$< >$@.tmp && mv -f $@.tmp $@
96
97 .PRECIOUS: %.auto.scad
98 %.auto.scad: $(PLAY)/toplevel-make Makefile $(PLAY)/toplevel-find
99                 @echo ' write $@'
100                 $< $@ >$@.tmp
101                 @mv -f $@.tmp $@
102
103 .PRECIOUS:      %.stl %.gcode %.eps %.dxf
104
105 clean:
106                 rm -f *~ *.stl *.auto.scad *.gcode .*.d $(AUTO_INCS)