
# $Header: /usr4/Geom_utilities/RCS/Makefile,v 1.5 91/04/06 16:25:26 meuer Exp $
#
# Makefile for the geometric utilities by
# Mark Meuer
#
#
# The environment variable CPUTYPE must be set to iris4, sun3os3, sun3os4 or sun4


SUFFIXES=.c .C .o .h
.SUFFIXES: $(SUFFIXES)

SHELL=/bin/sh
MAKEFILE=Makefile
MAKEDIR=./Makefiles
DESTDIR = .
SUBSYSTEMS=Matrix_util Poly2tri Poly2area Arc2list Poly2xy Tsum Tri2quad
FTPFILES = \
	README \
	Makefile \
	article.doc \
	ChangeLog \
	Copyright \
	RCS \
	${SUBSYSTEMS}

#Include machine specific things
include ${MAKEDIR}/mk.${CPUTYPE}

#CPLUSPLUS = g++
CPLUSPLUS = CC
AR=	/bin/ar

all:	
	@echo "Using Makefile settings for machine ${CPUTYPE}."
	for file in ${SUBSYSTEMS} ; \
	do \
	cd $$file  ; \
	echo Creating $$file subsystem. ; \
	${MAKE}  ; \
	${MAKE} -k ; \
	cd .. ; \
	done

recompile:
	@echo "Using Makefile settings for machine ${CPUTYPE}."
	for file in ${SUBSYSTEMS} ; \
	do \
	cd $$file  ; \
	echo Recompiling $$file subsystem. ; \
	${MAKE} purge ; \
	${MAKE} -k ; \
	cd .. ; \
	done

clean: 
	@echo "Using Makefile settings for machine ${CPUTYPE}."
	-rm -f *.o *~ *.dvi *.aux *.ps core 
	for file in ${SUBSYSTEMS} ; \
	do \
	cd $$file  ; \
	echo Cleaning $$file subsystem. ; \
	${MAKE} clean ; \
	cd .. ; \
	done

purge: clean
	@echo "Using Makefile settings for machine ${CPUTYPE}."
	for file in ${SUBSYSTEMS} ; \
	do \
	cd $$file  ; \
	echo Purging $$file subsystem. ; \
	${MAKE} purge ; \
	cd .. ; \
	done

install:	
	@echo "Using Makefile settings for machine ${CPUTYPE}."
	for file in ${SUBSYSTEMS} ; \
	do \
	cd $$file  ; \
	echo Installing $$file subsystem. ; \
	${MAKE} install ; \
	cd .. ; \
	done

tar:	purge
	@echo "Using Makefile settings for machine ${CPUTYPE}."
	-rm -f geom_utils.tar.Z
	tar cvf geom_utils.tar ${FTPFILES}
	compress -v geom_utils.tar
	@echo "Tar archive has been created and compressed."
.C.o: 
	${CPLUSPLUS} -c ${CFLAGS} $<

