From 3a831ca9695bf1befddb9d73c5cc8cdb34b6e92e Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Wed, 16 Jan 2008 18:33:23 +0000 Subject: [PATCH] makedim multidim experiment --- Makefile | 6 ++++-- makedim | 18 ++++++++++++++++++ mgraph.h | 8 +++++++- 3 files changed, 29 insertions(+), 3 deletions(-) create mode 100755 makedim diff --git a/Makefile b/Makefile index 15e4ae0..af7486d 100644 --- a/Makefile +++ b/Makefile @@ -1,11 +1,12 @@ TARGETS= minimise primer view lumpy.cfm sgtatham.cfm ring.cfm +SGTATHAM=sgtatham 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 @@ -26,7 +27,7 @@ prime.data: primer 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 @@ -42,5 +43,6 @@ clean: realclean: clean rm -f best + rm -rf dim,* -include *.d diff --git a/makedim b/makedim new file mode 100755 index 0000000..8f5da37 --- /dev/null +++ b/makedim @@ -0,0 +1,18 @@ +#!/bin/sh +set -e +fail () { echo >&2 "$*"; exit 127; } +badusage () { fail 'usage: makedim []'; } + +case $1 in +[0-9][0-9]) ;; +*) badusage ;; +esac + +dim=$1; shift +dir=dim,$dir + +x () { echo >&2 " $*"; "$@"; } + +x make clean >/dev/null +x mkdir -p $dir +x make -C $dir DIMCFLAGS=-DDEFBITS=$dim PERLLIB=.. SGTATHAM=../sgtatham VPATH=.. -f ../Makefile "$@" diff --git a/mgraph.h b/mgraph.h index 43494c7..e98fa85 100644 --- a/mgraph.h +++ b/mgraph.h @@ -69,9 +69,15 @@ #include "common.h" +#ifndef DEFBITS #define XBITS 3 -#define X (1<