chiark / gitweb /
slic3r-config: v3 had a print problem again
[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
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 %.gcode:        %.stl $(CONFIG)
37                 $(SLIC3R) --load $(CONFIG) \
38                         --ignore-nonexistent-config --load $*.slic3r \
39                         --output $@.tmp $<
40                 @mv -f $@.tmp $@
41
42 %.gcode-sd:     %.gcode
43                 mount /media/sd
44                 cp $^ /media/sd/JOB.G
45                 sleep 0.5
46                 umount /media/sd
47
48 %:              %.cpp
49                 cpp -nostdinc -P <$< >$@.tmp && mv -f $@.tmp $@
50
51 #%.gcode:       %.stl
52 #               $(SKEINFORGE) $<
53
54 %.gcode:        manual-gcode-generator %.m-g
55                 $(PLAY)/$^ >$@.tmp && mv -f $@.tmp $@
56
57 dovecliptest.stl: doveclip.scad $(AUTO_INCS)
58
59 %.auto.scad: $(PLAY)/toplevel-make Makefile $(PLAY)/toplevel-find
60                 @echo ' write $@'
61                 $< $@ >$@.tmp
62                 @mv -f $@.tmp $@
63
64 .PRECIOUS:      %.stl %.gcode
65
66 clean:
67                 rm -f *~ *.stl *.auto.scad *.gcode .*.d $(AUTO_INCS)