chiark / gitweb /
interpolate and various sizes build
[moebius2.git] / Makefile
index 15e4ae0..42ebbd5 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,16 @@
 
 
-TARGETS= minimise primer view lumpy.cfm sgtatham.cfm ring.cfm
+
+VIEWDIMS=33 44 55
+TARGETS= minimise primer lumpy.cfm sgtatham.cfm ring.cfm \
+       interpolate-44 \
+       $(addprefix view-, $(VIEWDIMS))
+SGTATHAM=sgtatham
 
 CWARNS=        -Wall -Wwrite-strings -Wpointer-arith -Werror -Wshadow
 CXXWARNS= $(CWARNS) -Wno-shadow -Wno-error
 
 OPTIMISE=      -O2
 
 CWARNS=        -Wall -Wwrite-strings -Wpointer-arith -Werror -Wshadow
 CXXWARNS= $(CWARNS) -Wno-shadow -Wno-error
 
 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
@@ -23,10 +28,8 @@ primer:              primer.o common.o
 prime.data:    primer
                ./$^ $o
 
 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
+sgtatham.cfm:  sgtatham-regenerator prime.data $(SGTATHAM)/z.typescript
                ./$^ -T -o$@
 
 lumpy.cfm: oldmoebius-converter prime.data ../moebius/ins-new ../moebius/a.out
                ./$^ -T -o$@
 
 lumpy.cfm: oldmoebius-converter prime.data ../moebius/ins-new ../moebius/a.out
@@ -35,6 +38,25 @@ lumpy.cfm: oldmoebius-converter prime.data ../moebius/ins-new ../moebius/a.out
 ring.cfm: oldmoebius-converter prime.data /dev/null ../moebius/a.out
                ./$^ -o$@
 
 ring.cfm: oldmoebius-converter prime.data /dev/null ../moebius/a.out
                ./$^ -o$@
 
+view-%:                view+%.o mgraph+%.o common.o
+               $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL) -L/usr/X11R6/lib -lX11
+
+interpolate-%: interpolate+%.o mgraph+%.o common.o
+               $(CC) $(CFLAGS) -o $@ $^ $(LIBGSL)
+
+# this ridiculous repetition is due to make being too lame
+
+view+%.o: view.c
+               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFBITS=$* $< -o $@
+
+mgraph+%.o: mgraph.c
+               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFBITS=$* $< -o $@
+
+interpolate+%.o: interpolate.c
+               $(CC) -c $(CPPFLAGS) $(CFLAGS) -DDEFBITS=$* $< -o $@
+
+.PRECIOUS: view+%.o mgraph+%.o interpolate+%.o
+
 clean:
                rm -f prime.data $(TARGETS)
                rm -f *.o *.new *.tmp *.rej *.orig core vgcore.* *~
 clean:
                rm -f prime.data $(TARGETS)
                rm -f *.o *.new *.tmp *.rej *.orig core vgcore.* *~
@@ -43,4 +65,6 @@ clean:
 realclean:     clean
                rm -f best
 
 realclean:     clean
                rm -f best
 
+%.d:
+
 -include *.d
 -include *.d