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

SHELL=/bin/sh

default: it

compile: \
warn-auto.sh conf-cc
	( cat warn-auto.sh; \
	echo exec "`head -1 conf-cc`" '-c $${1+"$$@"}' \
	) > compile
	chmod 755 compile

cube.o: \
compile cube.c cube.h int32.h int64.h printint.h int32.h
	./compile cube.c

cubenaive: \
load cubenaive.o printint.o cube.o
	./load cubenaive printint.o cube.o 

cubenaive.0: \
cubenaive.1
	nroff -man cubenaive.1 > cubenaive.0

cubenaive.o: \
compile cubenaive.c cube.h int32.h int64.h
	./compile cubenaive.c

cubepppp: \
load cubepppp.o printint.o sortedpp.o solvepppp.o cube.o
	./load cubepppp printint.o sortedpp.o solvepppp.o cube.o 

cubepppp.0: \
cubepppp.1
	nroff -man cubepppp.1 > cubepppp.0

cubepppp.o: \
compile cubepppp.c solvepppp.h int32.h int64.h cube.h int32.h int64.h
	./compile cubepppp.c

cubepprs: \
load cubepprs.o printint.o sortedpq.o sortedpp.o solvepprs.o cube.o
	./load cubepprs printint.o sortedpq.o sortedpp.o \
	solvepprs.o cube.o 

cubepprs.0: \
cubepprs.1
	nroff -man cubepprs.1 > cubepprs.0

cubepprs.o: \
compile cubepprs.c solvepprs.h int32.h int64.h cube.h int32.h int64.h
	./compile cubepprs.c

cubepqpq: \
load cubepqpq.o printint.o sortedpq.o solvepqpq.o cube.o
	./load cubepqpq printint.o sortedpq.o solvepqpq.o cube.o 

cubepqpq.0: \
cubepqpq.1
	nroff -man cubepqpq.1 > cubepqpq.0

cubepqpq.o: \
compile cubepqpq.c solvepqpq.h int32.h int64.h cube.h int32.h int64.h
	./compile cubepqpq.c

cubepqrs: \
load cubepqrs.o printint.o sortedpq.o solvepqrs.o cube.o
	./load cubepqrs printint.o sortedpq.o solvepqrs.o cube.o 

cubepqrs.0: \
cubepqrs.1
	nroff -man cubepqrs.1 > cubepqrs.0

cubepqrs.o: \
compile cubepqrs.c solvepqrs.h int32.h int64.h cube.h int32.h int64.h
	./compile cubepqrs.c

dist: \
load dist.o
	./load dist 

dist.0: \
dist.1
	nroff -man dist.1 > dist.0

dist.o: \
compile dist.c
	./compile dist.c

euler4: \
load euler4.o printint.o printint64.o
	./load euler4 printint.o printint64.o 

euler4.0: \
euler4.1
	nroff -man euler4.1 > euler4.0

euler4.o: \
compile euler4.c heap.h int32.h int64.h
	./compile euler4.c

four7p: \
load four7p.o printint.o sortedpp.o
	./load four7p printint.o sortedpp.o 

four7p.o: \
compile four7p.c heap.h int32.h int64.h sortedpp.h int32.h int64.h \
printint.h int32.h
	./compile four7p.c

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

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

it: \
man prog

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

man: \
sortedpq.0 sortedpp.0 cubenaive.0 cubepppp.0 cubepqpq.0 cubepprs.0 \
cubepqrs.0 two3.0 two3p.0 two4.0 euler4.0 dist.0

printint.o: \
compile printint.c printint.h int32.h
	./compile printint.c

printint64.o: \
compile printint64.c printint64.h int64.h
	./compile printint64.c

prog: \
cubepqrs cubepprs cubepqpq cubepppp cubenaive two3 two3p two4 euler4 \
two5p four7p dist testpprr testspq

shar: \
FILES BLURB README TODO THANKS CHANGES FILES VERSION TARGETS Makefile \
conf-cc conf-ld warn-auto.sh heap.h sortedpq.3 sortedpq.h sortedpq.c \
sortedpp.3 sortedpp.h sortedpp.c solvepqrs.h solvepqrs.c solvepprs.h \
solvepprs.c solvepprr.h solvepprr.c solvepqpq.h solvepqpq.c \
solvepppp.h solvepppp.c dist.c printint.h printint.c printint64.h \
printint64.c two3.c two3p.c two4.c euler4.c two5p.c four7p.c \
cubepqrs.c cubepprs.c cubepqpq.c cubepppp.c cubenaive.c cube.h cube.c \
testspq.c testpprr.c int32.h1 int32.h2 trylong32.c int64.h1 int64.h2 \
trylong64.c
	shar -m `cat FILES` > shar
	chmod 400 shar

solvepppp.o: \
compile solvepppp.c sortedpp.h int32.h int64.h solvepppp.h int32.h \
int64.h
	./compile solvepppp.c

solvepprr.o: \
compile solvepprr.c sortedpp.h int32.h int64.h solvepprr.h int32.h \
int64.h
	./compile solvepprr.c

solvepprs.o: \
compile solvepprs.c sortedpp.h int32.h int64.h sortedpq.h int32.h \
int64.h solvepprs.h int32.h int64.h
	./compile solvepprs.c

solvepqpq.o: \
compile solvepqpq.c sortedpq.h int32.h int64.h solvepqpq.h int32.h \
int64.h
	./compile solvepqpq.c

solvepqrs.o: \
compile solvepqrs.c sortedpq.h int32.h int64.h solvepqrs.h int32.h \
int64.h
	./compile solvepqrs.c

sortedpp.0: \
sortedpp.3
	nroff -man sortedpp.3 > sortedpp.0

sortedpp.o: \
compile sortedpp.c sortedpp.h int32.h int64.h heap.h int32.h int64.h
	./compile sortedpp.c

sortedpq.0: \
sortedpq.3
	nroff -man sortedpq.3 > sortedpq.0

sortedpq.o: \
compile sortedpq.c sortedpq.h int32.h int64.h heap.h int32.h int64.h
	./compile sortedpq.c

testpprr: \
load testpprr.o sortedpp.o solvepprr.o
	./load testpprr sortedpp.o solvepprr.o 

testpprr.o: \
compile testpprr.c solvepprr.h int32.h int64.h
	./compile testpprr.c

testspq: \
load testspq.o sortedpq.o
	./load testspq sortedpq.o 

testspq.o: \
compile testspq.c sortedpq.h int32.h int64.h
	./compile testspq.c

two3: \
load two3.o printint.o printint64.o
	./load two3 printint.o printint64.o 

two3.0: \
two3.1
	nroff -man two3.1 > two3.0

two3.o: \
compile two3.c printint.h int32.h printint64.h int64.h heap.h int32.h \
int64.h
	./compile two3.c

two3p: \
load two3p.o printint.o printint64.o sortedpp.o
	./load two3p printint.o printint64.o sortedpp.o 

two3p.0: \
two3p.1
	nroff -man two3p.1 > two3p.0

two3p.o: \
compile two3p.c sortedpp.h int32.h int64.h printint.h int32.h \
printint64.h int64.h
	./compile two3p.c

two4: \
load two4.o printint.o sortedpp.o
	./load two4 printint.o sortedpp.o 

two4.0: \
two4.1
	nroff -man two4.1 > two4.0

two4.o: \
compile two4.c heap.h int32.h int64.h sortedpp.h int32.h int64.h \
printint.h int32.h
	./compile two4.c

two5p: \
load two5p.o printint.o sortedpp.o
	./load two5p printint.o sortedpp.o 

two5p.o: \
compile two5p.c heap.h int32.h int64.h sortedpp.h int32.h int64.h \
printint.h int32.h
	./compile two5p.c
