#**********************************************************************
#
#     Copyright (C) 1992  Roland W. Freund and Noel M. Nachtigal
#     All rights reserved.
#
#**********************************************************************
#
#  Makefile for the miscellaneous subdirectory.
#

#
#  Files in this directory:
#
LIB = libmisc.a
OBJ = caxpby.o daxpby.o saxpby.o zaxpby.o crandn.o dhpsrt.o drandn.o \
dznrm1.o scnrm1.o shpsrt.o srandn.o zrandn.o
SRC = d2s.sed z2c.sed caxpby.f saxpby.f crandn.f srandn.f scnrm1.f \
shpsrt.f

#
#  Makefile include files.
#
include ../../header.mak
include ../../incl/local.mak

#
#  This is the local help target.
#
help::
	@echo "   make lib     - make the miscellaneous library"
	@echo "   make nolib   - remove miscellaneous library"

#
#  Dependencies for files in this directory.
#
caxpby.f:	zaxpby.f z2c.sed
	@echo Making $@
	@sed -f z2c.sed zaxpby.f > $@
saxpby.f:	daxpby.f z2c.sed
	@echo Making $@
	@sed -f z2c.sed daxpby.f > $@
crandn.f:	zrandn.f z2c.sed
	@echo Making $@
	@sed -f z2c.sed zrandn.f > $@
srandn.f:	drandn.f d2s.sed
	@echo Making $@
	@sed -f d2s.sed drandn.f > $@
scnrm1.f:	dznrm1.f z2c.sed
	@echo Making $@
	@sed -f z2c.sed dznrm1.f > $@
shpsrt.f:	dhpsrt.f d2s.sed
	@echo Making $@
	@sed -f d2s.sed dhpsrt.f > $@
d2s.sed:	../../incl/d2s.sed
	@echo Making conversion script $@
	@cp ../../incl/d2s.sed $@
z2c.sed:	../../incl/z2c.sed
	@echo Making conversion script $@
	@cp ../../incl/z2c.sed $@
	@echo 's/ZA/CA/g'       >> $@
	@echo 's/ZB/CB/g'       >> $@
	@echo 's/ZX/CX/g'       >> $@
	@echo 's/ZY/CY/g'       >> $@
	@echo 's/ZZ/CZ/g'       >> $@
	@echo 's/DA/SA/g'       >> $@
	@echo 's/DB/SB/g'       >> $@
	@echo 's/DX/SX/g'       >> $@
	@echo 's/DY/SY/g'       >> $@
	@echo 's/DZ/SZ/g'       >> $@
	@echo 's/SATA/DATA/g'   >> $@

#
#  Miscellaneous library target.
#
$(LIB):	$(OBJ)
	@echo Making $@
	@$(AR) $(ARFLAGS) $@ $(OBJ)
	@$(RANLIB) $@
