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

SHELL=/bin/sh

default: it


it: \
fwipe0 echo0 fwipe man

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: \
fwipe0.0 echo0.0 fwipe.0 getopt.0 subgetopt.0

stralloc.a: \
makelib stralloc_arts.o stralloc_cat.o stralloc_catb.o stralloc_cats.o \
stralloc_copy.o stralloc_eady.o stralloc_num.o stralloc_opyb.o \
stralloc_opys.o stralloc_pend.o
	./makelib stralloc.a stralloc_arts.o stralloc_cat.o stralloc_catb.o \
	stralloc_cats.o stralloc_copy.o stralloc_eady.o stralloc_num.o \
	stralloc_opyb.o stralloc_opys.o stralloc_pend.o

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

fwipe0.o: \
compile \
fwipe0.c \
buffer.h error.h getln.h stralloc.h gen_alloc.h seek.h strerr.h \
subgetopt.h
	./compile fwipe0.c

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

systype: \
find-systype.sh conf-cc conf-ld trycpp.c x86cpuid.c
	( cat warn-auto.sh; \
	echo CC=\'`head -1 conf-cc`\'; \
	echo LD=\'`head -1 conf-ld`\'; \
	cat find-systype.sh; \
	) | sh > systype

getopt.a: \
makelib subgetopt.o sgetopt.o
	./makelib getopt.a subgetopt.o sgetopt.o

subgetopt.o: \
compile \
subgetopt.c \
subgetopt.h
	./compile subgetopt.c

sgetopt.o: \
compile \
sgetopt.c \
buffer.h sgetopt.h subgetopt.h
	./compile sgetopt.c

byte.a: \
makelib byte_chr.o byte_copy.o byte_cr.o byte_diff.o byte_rchr.o
	./makelib byte.a byte_chr.o byte_copy.o byte_cr.o byte_diff.o \
	byte_rchr.o

byte_chr.o: \
compile \
byte_chr.c \
byte.h
	./compile byte_chr.c

byte_copy.o: \
compile \
byte_copy.c \
byte.h
	./compile byte_copy.c

byte_cr.o: \
compile \
byte_cr.c \
byte.h
	./compile byte_cr.c

byte_diff.o: \
compile \
byte_diff.c \
byte.h
	./compile byte_diff.c

byte_rchr.o: \
compile \
byte_rchr.c \
byte.h
	./compile byte_rchr.c

seek.a: \
makelib seek_set.o
	./makelib seek.a seek_set.o

seek_set.o: \
compile \
seek_set.c \
seek.h
	./compile seek_set.c

open.a: \
makelib open_append.o open_excl.o open_read.o open_trunc.o open_write.o
	./makelib open.a open_append.o open_excl.o open_read.o open_trunc.o \
	open_write.o

open_append.o: \
compile \
open_append.c \
open.h
	./compile open_append.c

open_excl.o: \
compile \
open_excl.c \
open.h
	./compile open_excl.c

open_read.o: \
compile \
open_read.c \
open.h
	./compile open_read.c

open_trunc.o: \
compile \
open_trunc.c \
open.h
	./compile open_trunc.c

open_write.o: \
compile \
open_write.c \
open.h
	./compile open_write.c

getln.a: \
makelib getln.o getln2.o
	./makelib getln.a getln.o getln2.o

getln.o: \
compile \
getln.c \
byte.h getln.h buffer.h stralloc.h gen_alloc.h
	./compile getln.c

getln2.o: \
compile \
getln2.c \
byte.h getln.h buffer.h stralloc.h gen_alloc.h
	./compile getln2.c

fwipe0: \
load fwipe0.o getopt.a byte.a seek.a open.a getln.a stralloc.a alloc.a \
strerr.a buffer.a error.a str.a
	./load fwipe0 getopt.a byte.a seek.a open.a getln.a stralloc.a alloc.a \
	strerr.a buffer.a error.a str.a 

alloc.a: \
makelib alloc.o alloc_re.o
	./makelib alloc.a alloc.o alloc_re.o

stralloc_arts.o: \
compile \
stralloc_arts.c \
byte.h str.h stralloc.h gen_alloc.h
	./compile stralloc_arts.c

stralloc_cat.o: \
compile \
stralloc_cat.c \
byte.h stralloc.h gen_alloc.h
	./compile stralloc_cat.c

stralloc_catb.o: \
compile \
stralloc_catb.c \
stralloc.h gen_alloc.h byte.h
	./compile stralloc_catb.c

stralloc_cats.o: \
compile \
stralloc_cats.c \
byte.h str.h stralloc.h gen_alloc.h
	./compile stralloc_cats.c

stralloc_copy.o: \
compile \
stralloc_copy.c \
byte.h stralloc.h gen_alloc.h
	./compile stralloc_copy.c

stralloc_eady.o: \
compile \
stralloc_eady.c \
alloc.h stralloc.h gen_alloc.h gen_allocdefs.h
	./compile stralloc_eady.c

stralloc_num.o: \
compile \
stralloc_num.c \
stralloc.h gen_alloc.h
	./compile stralloc_num.c

stralloc_opyb.o: \
compile \
stralloc_opyb.c \
stralloc.h gen_alloc.h byte.h
	./compile stralloc_opyb.c

stralloc_opys.o: \
compile \
stralloc_opys.c \
byte.h str.h stralloc.h gen_alloc.h
	./compile stralloc_opys.c

stralloc_pend.o: \
compile \
stralloc_pend.c \
alloc.h stralloc.h gen_alloc.h gen_allocdefs.h
	./compile stralloc_pend.c

alloc.o: \
compile \
alloc.c \
alloc.h error.h
	./compile alloc.c

alloc_re.o: \
compile \
alloc_re.c \
alloc.h byte.h
	./compile alloc_re.c

strerr.o: \
compile \
strerr.c \
stralloc.h gen_alloc.h strerr.h
	./compile strerr.c

strerr.a: \
makelib strerr.o strerr_sys.o strerr_die.o
	./makelib strerr.a strerr.o strerr_sys.o strerr_die.o

strerr_sys.o: \
compile \
strerr_sys.c \
error.h strerr.h
	./compile strerr_sys.c

strerr_die.o: \
compile \
strerr_die.c \
buffer.h exit.h strerr.h
	./compile strerr_die.c

buffer.o: \
compile \
buffer.c \
buffer.h
	./compile buffer.c

buffer_get.o: \
compile \
buffer_get.c \
buffer.h byte.h error.h
	./compile buffer_get.c

buffer_put.o: \
compile \
buffer_put.c \
buffer.h str.h byte.h error.h
	./compile buffer_put.c

buffer.a: \
makelib buffer.o buffer_get.o buffer_put.o buffer_copy.o buffer_2.o \
buffer_1.o buffer_0.o
	./makelib buffer.a buffer.o buffer_get.o buffer_put.o buffer_copy.o \
	buffer_2.o buffer_1.o buffer_0.o

buffer_copy.o: \
compile \
buffer_copy.c \
buffer.h
	./compile buffer_copy.c

buffer_2.o: \
compile \
buffer_2.c \
readwrite.h buffer.h
	./compile buffer_2.c

buffer_1.o: \
compile \
buffer_1.c \
readwrite.h buffer.h
	./compile buffer_1.c

buffer_0.o: \
compile \
buffer_0.c \
readwrite.h buffer.h
	./compile buffer_0.c

error.o: \
compile \
error.c \
error.h
	./compile error.c

error.a: \
makelib error.o error_str.o error_temp.o
	./makelib error.a error.o error_str.o error_temp.o

error_str.o: \
compile \
error_str.c \
error.h
	./compile error_str.c

error_temp.o: \
compile \
error_temp.c \
error.h
	./compile error_temp.c

str.a: \
makelib str_len.o str_diff.o str_diffn.o str_cpy.o str_chr.o str_rchr.o \
str_start.o byte_chr.o byte_rchr.o byte_diff.o byte_copy.o byte_cr.o \
byte_zero.o
	./makelib str.a str_len.o str_diff.o str_diffn.o str_cpy.o str_chr.o \
	str_rchr.o str_start.o byte_chr.o byte_rchr.o byte_diff.o byte_copy.o \
	byte_cr.o byte_zero.o

str_len.o: \
compile \
str_len.c \
str.h
	./compile str_len.c

str_diff.o: \
compile \
str_diff.c \
str.h
	./compile str_diff.c

str_diffn.o: \
compile \
str_diffn.c \
str.h
	./compile str_diffn.c

str_cpy.o: \
compile \
str_cpy.c \
str.h
	./compile str_cpy.c

str_chr.o: \
compile \
str_chr.c \
str.h
	./compile str_chr.c

str_rchr.o: \
compile \
str_rchr.c \
str.h
	./compile str_rchr.c

str_start.o: \
compile \
str_start.c \
str.h
	./compile str_start.c

byte_zero.o: \
compile \
byte_zero.c \
byte.h
	./compile byte_zero.c

echo0: \
load echo0.o strerr.a error.a buffer.a byte.a str.a
	./load echo0 strerr.a error.a buffer.a byte.a str.a 

echo0.o: \
compile \
echo0.c \
buffer.h strerr.h
	./compile echo0.c

fwipe: \
warn-auto.sh fwipe.sh conf-home
	cat warn-auto.sh fwipe.sh \
	| sed s}HOME}"`head -1 conf-home`"}g \
	> fwipe
	chmod 755 fwipe

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

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

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

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

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

install: \
load install.o hier.o auto_home.o stralloc.a alloc.a strerr.a buffer.a \
open.a error.a str.a
	./load install hier.o auto_home.o stralloc.a alloc.a strerr.a buffer.a \
	open.a error.a str.a 

install.o: \
compile \
install.c \
buffer.h strerr.h error.h open.h readwrite.h exit.h
	./compile install.c

hier.o: \
compile \
hier.c \
auto_home.h
	./compile hier.c

auto_home.o: \
compile \
auto_home.c
	./compile auto_home.c

auto-str: \
load auto-str.o buffer.a error.a str.a
	./load auto-str buffer.a error.a str.a 

auto-str.o: \
compile \
auto-str.c \
buffer.h readwrite.h exit.h
	./compile auto-str.c

auto_home.c: \
auto-str conf-root
	./auto-str auto_home `head -1 conf-root` > auto_home.c

instcheck: \
load instcheck.o hier.o auto_home.o strerr.a buffer.a error.a str.a
	./load instcheck hier.o auto_home.o strerr.a buffer.a error.a str.a 

instcheck.o: \
compile \
instcheck.c \
strerr.h error.h readwrite.h exit.h
	./compile instcheck.c

setup: \
it install
	./install

check: \
it instcheck
	./instcheck

clean: \
TARGETS
	rm -f `cat TARGETS`
