chiark / gitweb /
viewdims variable
[moebius2.git] / Makefile
index c40fb3285be394a1b0c70a874699bbdb4d4d2254..9c82be7b10a0e3dc4eff139e1a01b0ade6d3fe8f 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,32 +1,60 @@
 
 
-TARGETS= minimise primer initial view
+
+VIEWDIMS=33 44 55
+TARGETS= minimise primer lumpy.cfm sgtatham.cfm ring.cfm \
+       $(addprefix view+, $(VIEWDIMS))
+SGTATHAM=sgtatham
 
 CWARNS=        -Wall -Wwrite-strings -Wpointer-arith -Werror -Wshadow
 
 CWARNS=        -Wall -Wwrite-strings -Wpointer-arith -Werror -Wshadow
-CXXWARNS= $(CWARNS) -Wno-shadow
+CXXWARNS= $(CWARNS) -Wno-shadow -Wno-error
 
 OPTIMISE=      -O2
 
 OPTIMISE=      -O2
-CFLAGS=                -MMD $(OPTIMISE) -g $(CWARNS)
+CFLAGS=                -MMD $(OPTIMISE) -g $(CWARNS) $(DIMCFLAGS)
 CXXFLAGS=      -MMD $(OPTIMISE) -g $(CXXWARNS)
 
 LIBGSL= -lgsl -lgslcblas
 
 CXXFLAGS=      -MMD $(OPTIMISE) -g $(CXXWARNS)
 
 LIBGSL= -lgsl -lgslcblas
 
+o= >$@.new && mv -f $@.new $@
+
 all:           $(TARGETS)
 
 all:           $(TARGETS)
 
-minimise:      energy.o bgl.o common.o mgraph.o
+minimise:      energy.o graph.o common.o mgraph.o minimise.o half.o
                $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBGSL)
 
 primer:                primer.o common.o
                $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL)
 
                $(CXX) $(CXXFLAGS) -o $@ $^ $(LIBGSL)
 
 primer:                primer.o common.o
                $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL)
 
-view:          view.o common.o mgraph.o
-               $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL) -L/usr/X11R6/lib -lX11
+prime.data:    primer
+               ./$^ $o
+
 
 
-initial:       generator primer sgtatham/z.typescript
+sgtatham.cfm:  sgtatham-regenerator prime.data $(SGTATHAM)/z.typescript
+               ./$^ -T -o$@
+
+lumpy.cfm: oldmoebius-converter prime.data ../moebius/ins-new ../moebius/a.out
+               ./$^ -o$@
+
+ring.cfm: oldmoebius-converter prime.data /dev/null ../moebius/a.out
                ./$^ -o$@
 
                ./$^ -o$@
 
+
+# this ridiculous repetition is due to make being too lame
+
+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 $@
+
+mgraph+%.o:    mgraph.c
+               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFBITS=$* $< -o $@
+
+.PRECIOUS: view+%.o mgraph+%.o
+
+
 clean:
 clean:
-               rm -f *.o $(TARGETS) *.new *.tmp *.rej *.orig
-               rm -f initial
+               rm -f prime.data $(TARGETS)
+               rm -f *.o *.new *.tmp *.rej *.orig core vgcore.* *~
                rm -f *.d
 
 realclean:     clean
                rm -f *.d
 
 realclean:     clean