chiark / gitweb /
move stuff into Parse.pm; build system
[pandemic-rising-tide.git] / Makefile
index 8825b4cb8c84d640582e9d6d71e2703ca5456778..f4b0e8978b25872e987033e2a3e75cec18dd7bb7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,10 +1,26 @@
 
-o= >$@.tmp && mv -f $@.tmp $@
+i=mv -f $@.tmp $@
+o= >$@.tmp && $i
 
 export PERL_HASH_SEED=1
 
-map.plag: parse-input-graph input-graph
-       ./$^ $o
+PLANAR_GRAPH=planar-graph
+
+map.plag: parse-input-graph input-graph Parse.pm 
+       ./$< input-graph $o
+
+opt.plag: map.plag $(PLANAR_GRAPH)
+       sha256sum $^ >.opt.plag.sums.tmp
+       cmp .opt.plag.sums.tmp .opt.plag.sums || (      \
+       $(PLANAR_GRAPH) RF $<                           \
+               DUAL                                    \
+               OUTER-F2V OUTER-SPLIT                   \
+               B T OUTER-F2V OUTER-F12VA               \
+               PCO CP RAE                              \
+               D 0 NLOPT                               \
+               W $@.tmp                                \
+               && $i                                   \
+               && mv -vf .opt.plag.sums.tmp .opt.plag.sums )
 
 #map.ps: map.dot
 #      neato -Tps $^ $o