##############################################################################
#
# This file is a Makefile for acisbg.  If it has the name "Makefile.in"
# then it is a template for a Makefile;  to generate the actual Makefile,
# run "./configure", which is a configuration script generated by the
# "autoconf" program (constructs like "@foo@" will get replaced in the
# actual Makefile.
#
#
# Maxim Markevitch <maxim % head.cfa.harvard.edu>, 6 Jan 2001
# 9.2.01: renamed pixlib_int.o -> ini_pixlib.o
# 25.10.3: updated libs for ciao-3.
# 13.5.4: removed ./bool.h, ./pixlib.h and -I.; replaced with -I $ciaoinc
# 30.1.7: updated libs for ciao-3.4 (E. Mandel fixed code to use new
#         pixlib interface; also removed need for -DNOREADPAR)
#
##############################################################################

PACKAGE = acisbg
VERSION = 1.0

DISTNAME = ${PACKAGE}-${VERSION}
DISTDIR	 = ../export/$(DISTNAME)
FTPDIR	 = ../ftp

#----------------------------------------------------------------
# Things you can change to personalize the Makefile for your own
# site (you can make these changes in either Makefile.in or
# Makefile, but changes to Makefile will get lost if you re-run
# the configuration script).
#----------------------------------------------------------------

# Default top-level directories in which to install architecture-
# specific files (exec_prefix) and machine-independent files such
# as scripts (prefix).  The values specified here may be overridden
# at configure-time with the --exec-prefix and --prefix options
# to the "configure" script.

prefix =		/home/maxim/BIN/LIN
exec_prefix =		${prefix}

# The following definition can be set to non-null for special systems
# like AFS with replication.  It allows the pathnames used for installation
# to be different than those used for actually reference files at
# run-time.  INSTALL_ROOT is prepended to $prefix and $exec_prefix
# when installing files.
INSTALL_ROOT =

# Directory in which to install the .a or .so binary for the ACISBG library:
LIB_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/lib

# Directory in which to install the program wish:
BIN_INSTALL_DIR =	$(INSTALL_ROOT)$(exec_prefix)/bin

# Directory in which to install the include file acisbg.h:
INCLUDE_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/include

# Top-level directory for manual entries:
MAN_INSTALL_DIR =	$(INSTALL_ROOT)$(prefix)/zhhelp

# Some versions of make, like SGI's, use the following variable to
# determine which shell to use for executing commands:
SHELL =			/bin/sh

# There are just too many different versions of "install" around;
# better to use the install-sh script that comes with the distribution,
# which is slower but guaranteed to work.

INSTALL = 		./install-sh -c
INSTALL_PROGRAM =	${INSTALL}
INSTALL_DATA =		${INSTALL} -m 644

#----------------------------------------------------------------
# The information below is modified by the configure script when
# Makefile is generated from Makefile.in.  You shouldn't normally
# modify any of this stuff by hand.
#----------------------------------------------------------------

RANLIB	= ranlib
EXE	= 
ACISBG= /home/maxim/F/acisbgwork/acisbg

#----------------------------------------------------------------
# The information below should be usable as is.  The configure
# script won't modify it and you shouldn't need to modify it
# either.
#----------------------------------------------------------------

RM	= rm -f

MMDIRS = ./src

all:	progs

progs:	FORCE
	@for dir in $(MMDIRS); do 			\
	  if [ -d $$dir ]; then 			\
	    (cd $$dir; 					\
	    if [ -f Makefile ]; then 			\
		echo Making in $$dir; 			\
		$(MAKE) ACISBG=$(ACISBG); 		\
	    fi);					\
	  fi; 						\
	done;

Makefile:	Makefile.in Make.compiler.in Make.libraries.in
		$(SHELL) config.status

# does not delete lib and bin
srcclean:	topclean subclean

clean:		topclean subclean binclean

subclean:
	@if test -r Make.compiler; then			\
	  for dir in $(MMDIRS); do 			\
	    if [ -d $$dir ]; then 			\
	      (cd $$dir;				\
	      if [ -f Makefile ]; then 			\
	        echo Making clean in $$dir ; 		\
		$(MAKE) ACISBG=$(ACISBG) clean; 	\
	      fi);					\
	    fi; 					\
	  done;						\
	fi

install:	install-binaries install-docs

install-binaries:	$(PROGS)
	@for i in $(BIN_INSTALL_DIR); do		\
	    if [ ! -d $$i ] ; then 			\
		echo "Making directory $$i"; 		\
		mkdir -p $$i; 				\
		chmod 755 $$i; 				\
	    fi; 					\
	done;
	@if test -r Make.compiler; then			\
	  for dir in $(MMDIRS); do 			\
	    if [ -d $$dir ]; then 			\
	      (cd $$dir;				\
	      if [ -f Makefile ]; then 			\
	        echo Making install in $$dir ; 		\
		$(MAKE) ACISBG=$(ACISBG) install; 	\
	      fi);					\
	    fi; 					\
	  done;						\
	fi

install-docs:
	@echo "No documentation to install (yet)"

topclean:
	@$(RM) *.a *.so *.so.? *.dylib *.o *.exe core 		\
		errs *pure* .nfs* 				\
		foo* *~ *.log \#* TAGS *.E a.out errors		\
		$(PROGS) $(OPROGS) $(TESTPROGS)			\
		gmon.out *.pg *.bak				\
		config.info config.log;				\
	$(RM) -r autom4te.cache

binclean:
		@echo "cleaning bin and lib ...";		\
		$(RM) -rf bin/* lib/*


distclean:	clean
		@$(RM) Make.libraries Make.compiler		\
		config.status config.cache config.log;

depend:
		makedepend -- $(DEPEND_SWITCHES) -- $(SRCS)

configure:	configure.ac
		autoconf

tar:
		($(RM) config.cache; \
		cd ..; \
		tar cf - acisbg | gzip -9 -c > $(DISTNAME).tar.gz)

errcheck:
		-@(egrep -i '\*\*\*' foo)

warncheck:
		-@(egrep warning foo | egrep -v 'implicitly|uninitialized')

FORCE:

# DO NOT DELETE THIS LINE -- make depend depends on it.

