# Don't edit Makefile! Use conf-* for configuration.

SHELL=/bin/sh

default: it

48_4.c: \
systype conf-opt print-opt.sh ppro/48_4.c sparc/48_4.c
	sh print-opt.sh 48_4.c > 48_4.c

48_4.o: \
compile 48_4.c zmult.h uint32.h
	./compile 48_4.c

accuracy: \
load accuracy.o random.o zmult.a
	./load accuracy random.o zmult.a 

accuracy.o: \
compile accuracy.c random.h uint32.h zmult.h uint32.h
	./compile accuracy.c

choose: \
warn-auto.sh choose.sh
	cat warn-auto.sh choose.sh \
	> choose
	chmod 755 choose

compile: \
warn-auto.sh conf-cc systype print-cc.sh trycpp.c
	sh print-cc.sh > compile
	chmod 755 compile

direct.c: \
systype conf-opt print-opt.sh ppro/direct.c sparc/direct.c
	sh print-opt.sh direct.c > direct.c

direct.o: \
compile direct.c zmult.h uint32.h
	./compile direct.c

fp.c: \
systype conf-opt print-opt.sh ppro/fp.c sparc/fp.c
	sh print-opt.sh fp.c > fp.c

fp.o: \
compile fp.c zmult.h uint32.h
	./compile fp.c

hasgethr.h: \
choose compile load trygethr.c hasgethr.h1 hasgethr.h2
	./choose cl trygethr hasgethr.h1 hasgethr.h2 > hasgethr.h

hasrdtsc.h: \
choose compile load tryrdtsc.c hasrdtsc.h1 hasrdtsc.h2
	./choose clr tryrdtsc hasrdtsc.h1 hasrdtsc.h2 > hasrdtsc.h

hasrpcc.h: \
choose compile load tryrpcc.c hasrpcc.h1 hasrpcc.h2
	./choose cl tryrpcc hasrpcc.h1 hasrpcc.h2 > hasrpcc.h

it: \
accuracy speed

large+.c: \
systype conf-opt print-opt.sh ppro/large+.c sparc/large+.c
	sh print-opt.sh large+.c > large+.c

large+.o: \
compile large+.c zmult.h uint32.h
	./compile large+.c

large-.c: \
systype conf-opt print-opt.sh ppro/large-.c sparc/large-.c
	sh print-opt.sh large-.c > large-.c

large-.o: \
compile large-.c zmult.h uint32.h
	./compile large-.c

large.c: \
systype conf-opt print-opt.sh ppro/large.c sparc/large.c
	sh print-opt.sh large.c > large.c

large.o: \
compile large.c zmult.h uint32.h
	./compile large.c

larger.c: \
systype conf-opt print-opt.sh ppro/larger.c sparc/larger.c
	sh print-opt.sh larger.c > larger.c

larger.o: \
compile larger.c zmult.h uint32.h
	./compile larger.c

load: \
warn-auto.sh conf-ld
	( cat warn-auto.sh; \
	echo 'main="$$1"; shift'; \
	echo exec "`head -1 conf-ld`" \
	'-o "$$main" "$$main".o $${1+"$$@"}' \
	) > load
	chmod 755 load

makelib: \
warn-auto.sh systype
	( cat warn-auto.sh; \
	echo 'main="$$1"; shift'; \
	echo 'rm -f "$$main"'; \
	echo 'ar cr "$$main" $${1+"$$@"}'; \
	case "`cat systype`" in \
	sunos-5.*) ;; \
	unix_sv*) ;; \
	irix64-*) ;; \
	irix-*) ;; \
	dgux-*) ;; \
	hp-ux-*) ;; \
	sco*) ;; \
	*) echo 'ranlib "$$main"' ;; \
	esac \
	) > makelib
	chmod 755 makelib

medium+.c: \
systype conf-opt print-opt.sh ppro/medium+.c sparc/medium+.c
	sh print-opt.sh medium+.c > medium+.c

medium+.o: \
compile medium+.c zmult.h uint32.h
	./compile medium+.c

medium-.c: \
systype conf-opt print-opt.sh ppro/medium-.c sparc/medium-.c
	sh print-opt.sh medium-.c > medium-.c

medium-.o: \
compile medium-.c zmult.h uint32.h
	./compile medium-.c

medium.c: \
systype conf-opt print-opt.sh ppro/medium.c sparc/medium.c
	sh print-opt.sh medium.c > medium.c

medium.o: \
compile medium.c zmult.h uint32.h
	./compile medium.c

mediumr.c: \
systype conf-opt print-opt.sh ppro/mediumr.c sparc/mediumr.c
	sh print-opt.sh mediumr.c > mediumr.c

mediumr.o: \
compile mediumr.c zmult.h uint32.h
	./compile mediumr.c

poly.c: \
systype conf-opt print-opt.sh ppro/poly.c sparc/poly.c
	sh print-opt.sh poly.c > poly.c

poly.o: \
compile poly.c zmult.h uint32.h
	./compile poly.c

random.o: \
compile random.c random.h uint32.h
	./compile random.c

speed: \
load speed.o zmult.a
	./load speed zmult.a 

speed.o: \
compile speed.c zmult.h uint32.h timing.h hasrdtsc.h hasgethr.h \
hasrpcc.h
	./compile speed.c

systype: \
find-systype.sh trycpp.c x86cpuid.c
	sh find-systype.sh > systype

tar: \
VERSION FILES README TODO CHANGES VERSION FILES SYSDEPS TARGETS \
Makefile accuracy.c speed.c random.h random.c ppro ppro/48_4.c \
ppro/direct.c ppro/fp.c ppro/large+.c ppro/large-.c ppro/large.c \
ppro/larger.c ppro/medium+.c ppro/medium-.c ppro/medium.c \
ppro/mediumr.c ppro/poly.c ppro/zmult.h conf-cc conf-ld conf-opt \
print-cc.sh print-opt.sh choose.sh find-systype.sh hasgethr.h1 \
hasgethr.h2 hasrdtsc.h1 hasrdtsc.h2 hasrpcc.h1 hasrpcc.h2 timing.h \
trycpp.c trygethr.c tryrdtsc.c tryrpcc.c tryulong32.c uint32.h1 \
uint32.h2 warn-auto.sh x86cpuid.c
	maketar `tr "ABCDEFGHIJKLMNOPQRSTUVWXYZ " \
	"abcdefghijklmnopqrstuvwxyz-" < VERSION` . `cat FILES` > tar
	chmod 400 tar

uint32.h: \
tryulong32.c compile load uint32.h1 uint32.h2
	( ( ./compile tryulong32.c && ./load tryulong32 && \
	./tryulong32 ) >/dev/null 2>&1 \
	&& cat uint32.h2 || cat uint32.h1 ) > uint32.h
	rm -f tryulong32.o tryulong32

zmult.a: \
makelib fp.o poly.o 48_4.o mediumr.o medium+.o medium-.o medium.o \
larger.o large+.o large-.o large.o direct.o
	./makelib zmult.a fp.o poly.o 48_4.o mediumr.o medium+.o \
	medium-.o medium.o larger.o large+.o large-.o large.o \
	direct.o

zmult.h: \
systype conf-opt print-opt.sh ppro/zmult.h
	sh print-opt.sh zmult.h > zmult.h
