#!/bin/sh -e
# See http://jdebp.uk./FGA/slashpackage.html
if [ \! -d package -o \! -d source ]
then
	echo "You are not in the right directory." 1>&2
	exit 100
fi

# Rebuild.
cd build 
objects="redo.o popt-bool-string.o popt-bool.o popt-compound-2arg.o popt-compound.o popt-integral.o popt-named.o popt-signed.o popt-simple.o popt-string-list.o popt-string-pair-list.o popt-string-pair.o popt-string.o popt-table.o popt-top-table.o popt-unsigned.o popt.o jobserver.o FileDescriptorOwner.o wait.o lockfile.o"
for i in ${objects}
do
	./compile "$i" "`basename "$i" .o`".cpp "`basename "$i" .o`".d
done
./link redo ${objects}
manuals="redo redo-ifcreate redo-ifchange cubehash"
for i in ${manuals}
do
	pod2man --center "redo package" --release "v1.0" "$i".pod > "$i".1
done
