chiark / gitweb /
best interpolation so far
[moebius2.git] / Makefile
index 8d3d188aa9093b58d779c92ad7d0245111c99182..ecccd72524fcd94b895bfd509ddc5e4ccd7da876 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,5 +1,9 @@
 
-TARGETS= minimise primer view+33 view+44 lumpy.cfm sgtatham.cfm ring.cfm
+
+VIEWDIMS=33 64 125
+TARGETS= minimise primer lumpy.cfm sgtatham.cfm ring.cfm \
+       interpolate-64 \
+       $(addprefix view-, $(VIEWDIMS))
 SGTATHAM=sgtatham
 
 CWARNS=        -Wall -Wwrite-strings -Wpointer-arith -Werror -Wshadow
@@ -15,6 +19,8 @@ o= >$@.new && mv -f $@.new $@
 
 all:           $(TARGETS)
 
+compute:       best.CFM
+
 minimise:      energy.o graph.o common.o mgraph.o minimise.o half.o
                $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBGSL)
 
@@ -34,27 +40,44 @@ lumpy.cfm: oldmoebius-converter prime.data ../moebius/ins-new ../moebius/a.out
 ring.cfm: oldmoebius-converter prime.data /dev/null ../moebius/a.out
                ./$^ -o$@
 
+best.CFM:
+               ./minimise sgtatham.cfm -iwip.cfm -o$@
 
-# this ridiculous repetition is due to make being too lame
-
-view+%:                view+%.o mgraph+%.o common.o
+view-%:                view+%.o mgraph+%.o common.o
                $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL) -L/usr/X11R6/lib -lX11
 
-view+%.o:      view.c
-               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFBITS=$* $< -o $@
+interpolate-%: interpolate+%.o mgraph+%.o common.o
+               $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL)
 
-mgraph+%.o:    mgraph.c
-               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFBITS=$* $< -o $@
+define interpolate
+dense-$1.cfm:  interpolate-$1 $2
+               ./$$< <$2 $$o
+endef
 
-.PRECIOUS: view+%.o mgraph+%.o
+$(eval $(call interpolate,64, best.CFM))
+$(eval $(call interpolate,125, dense-64.cfm, dense-64.cfm))
 
+# this ridiculous repetition is due to make being too lame
+
+view+%.o: view.c
+               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFSZ=$* $< -o $@
+
+mgraph+%.o: mgraph.c
+               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFSZ=$* $< -o $@
+
+interpolate+%.o: interpolate.c
+               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFSZ=$* $< -o $@
+
+.PRECIOUS: view+%.o mgraph+%.o interpolate+%.o
 
 clean:
                rm -f prime.data $(TARGETS)
                rm -f *.o *.new *.tmp *.rej *.orig core vgcore.* *~
-               rm -f *.d
+               rm -f *.d *.cfm
 
 realclean:     clean
-               rm -f best
+               rm -f *.CFM
+
+%.d:
 
 -include *.d