chiark / gitweb /
minor improvements
[moebius2.git] / Makefile
index fc74681e0e4b665f103753745e045dc5df7cd339..15e4ae0f1eb983d28c66d84fe104baf35b875ca8 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,27 +1,46 @@
 
-TARGETS= minimise primer initial
+TARGETS= minimise primer view lumpy.cfm sgtatham.cfm ring.cfm
 
-CWARNS=        -Wall -Wwrite-strings -Wpointer-arith -Werror
+CWARNS=        -Wall -Wwrite-strings -Wpointer-arith -Werror -Wshadow
+CXXWARNS= $(CWARNS) -Wno-shadow -Wno-error
 
 OPTIMISE=      -O2
-CFLAGS=                $(CWARNS) $(OPTIMISE) -g
-CXXFLAGS=      $(CWARNS) $(OPTIMISE) -g
+CFLAGS=                -MMD $(OPTIMISE) -g $(CWARNS)
+CXXFLAGS=      -MMD $(OPTIMISE) -g $(CXXWARNS)
 
 LIBGSL= -lgsl -lgslcblas
 
+o= >$@.new && mv -f $@.new $@
+
 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)
 
-initial:       generator primer sgtatham/z.typescript
+prime.data:    primer
+               ./$^ $o
+
+view:          view.o common.o mgraph.o
+               $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL) -L/usr/X11R6/lib -lX11
+
+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$@
 
 clean:
-               rm -f *.o $(TARGETS) *.new *.tmp
-               rm -f best initial
+               rm -f prime.data $(TARGETS)
+               rm -f *.o *.new *.tmp *.rej *.orig core vgcore.* *~
+               rm -f *.d
+
+realclean:     clean
+               rm -f best
 
-%.o::          common.h mgraph.h bgl.h
+-include *.d