head	1.10;
access;
symbols;
locks; strict;
comment	@# @;


1.10
date	95.01.31.07.26.04;	author rjj;	state Exp;
branches;
next	1.9;

1.9
date	94.10.14.16.37.46;	author rjj;	state Exp;
branches;
next	1.8;

1.8
date	94.09.28.18.52.01;	author rjj;	state Exp;
branches;
next	1.7;

1.7
date	94.09.02.04.48.53;	author rjj;	state Exp;
branches;
next	1.6;

1.6
date	94.08.30.18.05.43;	author rjj;	state Exp;
branches;
next	1.5;

1.5
date	94.08.30.17.37.49;	author rjj;	state Exp;
branches;
next	1.4;

1.4
date	94.08.27.04.12.19;	author rjj;	state Exp;
branches;
next	1.3;

1.3
date	94.08.22.22.27.49;	author rjj;	state Exp;
branches;
next	1.2;

1.2
date	94.08.22.01.42.18;	author rjj;	state Exp;
branches;
next	1.1;

1.1
date	94.08.17.00.56.14;	author rjj;	state Exp;
branches;
next	;


desc
@This file is included by the GNUmakefile each user uses in compiling
  programs using both the iac++ and iah libraries.  It supplies
  default values for many of the functions required to support the
  iah library development, and programs that use that library in
  conjunction with the iac++ library.
@


1.10
log
@Forced to use cfront 3.0.3.
@
text
@# gnumake.iah          Section: include make file for all algorithms
#      Copyright 1994, Center for Computer Vision and Visualization,
#      University of Florida.  All rights reserved.
#
# gnumake template for iah-src's subdirectories.
#   It contains definitions for standard targets.
# This file is a modification of the gnumake.templ file for the iac++ code
#
# Primarily I want this file to support building of the libiah.a
#   library of IAH algorithms.
#
# Usage: Include in your GNUMakefile and
#        define the following symbols as appropriate
#
#   LOCALIACCVERSION	*only* define this symbol if you want to
#			override the default.  NOTE: you must
#			supply a complete path.
#   LOCALIAHDIR		*only* define this symbol if you want to
#			override the default iah directory.
#   BLASTABLE_PTFILES	are related to closure maintenance.
#			Treat these as prefix to files in the ptrepository/
#			that you DO NOT want added to the libiah.a ibrary.
#   CLOSUREOBJS	.o closure files to force generation of ptrepository/
#			.o files to go in the ${IAHLIBDIR}/libiah.a
#   HEADERS 	.h files to go in the ${IAHINCDIR}
#   LOBJS 	.o files to go in the ${IAHLIBDIR}/libiah.a library
#   SOURCES	source files for this group, used by target print-srcs
#   TESTS	source files to makes target testprogs
#   ARL		flag for temp file location
#   EXTRAINCLUDES	where other include files live
#   CPPFLAGS	additional cpp flags
#   STRIPPROGRAMS	if not empty, programs will be striped.
#   OTHERLIBS	additional libraries to be searched at link time
#   OUTPUT_OPTION	leave this one alone
#   TARGET_ARCH	leave this alone, it will default
#   XTRAFLAGS	
#   XTRACCFLAGS	
#   LIBTEST	define this symbol if test programs should be linked
#		with the iah library only, not with local versions of
#		.o files, other wise try to compile local versions and
#		linked with the local versions.
#		See targest 'testprogs' and 'testlib'

#######################################################################
# Environment
#######################################################################

AR		= /usr/bin/ar
PERL		= perl
RANLIB		= /usr/bin/ranlib


# This is where the iac++ development tree is rooted,
#  bin/ should exist under here.
IACCROOT	= /cis/research/iac++
IACCBINDIR	= ${IACCROOT}/bin

# This is the default iac++ library version.
# To override this, the user defines, LOCALIACCVERSION, in GNUmakefile
#
# It is expected that the developer of the iah library will modify
#   this value as appropriate.
# The  include/  and  lib/  directories should live here
IACCVERSION	= new


ifneq (${LOCALIACCVERSION},)
IACCDIR		= ${LOCALIACCVERSION}
else
IACCDIR		= ${IACCROOT}/${IACCVERSION}
endif
IACCINCLUDES	= ${IACCDIR}/include


#######################################################################
# This is where the IAH stuff lives
#######################################################################

IAHROOT		= /cis/research/iac++/handbook-src

# Eventually I want this to be based in the IAHROOT, but for
#   now, I'll keep in in my directory...
LOCALIAHDIR	= /cis/homes/rjj/iacc/iah-src

ifneq (${LOCALIAHDIR},)
IAHDIR		= ${LOCALIAHDIR}
else
IAHDIR		= ${IAHROOT}
endif

# Now define symbols specific to the IAHDIR
IAHLIBDIR	= ${IAHDIR}/lib
IAHLIBROOTNAME	= iah
IAHLIB		= ${IAHLIBDIR}/lib${IAHLIBROOTNAME}.a
IAHINCDIR	= ${IAHDIR}/include


#######################################################################
# Compilation and Linking related stuff
#######################################################################

CDEBUGFLAGS	= -g
INCLUDEFLAGS	= -I. -I${IACCINCLUDES} -I${IAHINCDIR} ${EXTRAINCLUDES}

CCFLAGS		= ${CDEBUGFLAGS} ${INCLUDEFLAGS} ${XTRAFLAGS} ${XTRACCFLAGS}

LDLIBS		= -l${IAHLIBROOTNAME} -liac++ -lcomplex -lm ${OTHERLIBS}
LDDIRS		= -L${IAHLIBDIR} -L${IACCDIR}/lib
LDFLAGS		= ${LDDIRS}

#CCC		= /local/bin/CC
#CCC		= /depot/cfront/bin/CC
CCC		= /local/bin/CC-3.0.3
COMPILE.cc	= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
LINK.cc		= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)

#######################################################################
# Closure and library maintenance related stuff
#######################################################################

CLOSUREFLAGS	= -I. -I${IACCINCLUDES} -I${IAHINCDIR} ${EXTRAINCLUDES}
LDCLOSURELIBS	= -liac++ -lcomplex -lm ${OTHERLIBS}
LDCLOSUREFLAGS	= -L${IACCDIR}/lib

CLOSURELIBS	= ${LDCLOSUREFLAGS} ${LDCLOSURELIBS}

CLOSURE.cc	= ${CCC} -ptk -ptmlinkmap -ptdclosure ${CLOSUREFLAGS}

REMANGLEFILENAME	= ar-remangling
IAHREMANGLEFILE		= ${IAHLIBDIR}/${REMANGLEFILENAME}
ARREMANGLEFILEFLAG	= -remangling ${IAHREMANGLEFILE}

ADDTEMPLOBJ_PERL	= ${IACCBINDIR}/add-templobj.perl

#######################################################################
# Rules
#######################################################################

ifneq (${STRIPPROGRAMS},)
.c:
	$(LINK.cc) -o $@@ $< $(LDLIBS)
	strip $@@
else
.c:
	$(LINK.cc) -o $@@ $< $(LDLIBS)
endif
.o:
	$(LINK.cc) -o $@@ $< $(LDLIBS)

.c.o:
	$(COMPILE.cc) $(OUTPUT_OPTION) $<


.PHONY: all clean spotless headers


#######################################################################
# Library  targets
#######################################################################

ifeq (${HEADERS},)
all:

else
ifneq (${CLOSUREOBJS},)
all: headers lib closure
else
all: headers lib
endif
endif

##
##

headers-force:: ${HEADERS}
	install -m0444 ${HEADERS} ${IAHINCDIR}/

OTHERHEADERS = ${patsubst %,${IAHINCDIR}/%,${HEADERS}}

headers: ${OTHERHEADERS}

ifneq (${OTHERHEADERS},)
${OTHERHEADERS}: ${IAHINCDIR}/%: %
	rm -f $@@
	install -m0444 $< $@@
endif

##
##

ifneq (${LOBJS},)
lib: ${LOBJS}
	${AR} rv${ARL} ${IAHLIB} ${LOBJS}
	${RANLIB} ${IAHLIB}
	touch $@@
else
lib:
	echo Nothing to be done for lib in: `pwd`
endif


#######################################################################
# Tessting targets
#######################################################################

testprogs: ${TESTS}

testlib:
	${MAKE} testprogs  LIBTEST=1


#######################################################################
# Closure target - put ptrepository/*.o in library.
#######################################################################

closure: ${LOBJS} ${CLOSUREOBJS}
	if [ -d ptrepository ] ; then \
		( ${CLOSURE.cc}  ${LOBJS} ${CLOSUREOBJS} ${CLOSURELIBS} ) ; \
		rm -f a.out ; \
		if [ ! -z "${BLASTABLE_PTFILES}" ] ; then \
			for i in ${BLASTABLE_PTFILES} nonexistent; do \
				rm -f ptrepository/$$i*.o; \
			done; \
		fi; \
		find ptrepository -name \*.o -print | \
		${PERL} ${ADDTEMPLOBJ_PERL} \
				${ARREMANGLEFILEFLAG} -${ARL} ${IAHLIB} ;\
		${RANLIB} ${IAHLIB} ; \
	fi
	touch closure


#######################################################################
# Housekeeping targets
#######################################################################

tidy::
	/bin/rm -f *~

clean::
	/bin/rm -f ${LOBJS} ${CLOSUREOBJS} *.o *~ core

spotless:: clean
	/bin/rm -f ${TESTS} lib closure
	/bin/rm -rf ptrepository linkmap make.log

print-srcs:	${SOURCES}	GNUmakefile
	enscript -2rG GNUmakefile ${SOURCES}

distfiles:


depend:
	awk '/^# dependencies/ { exit 0; } {print $0; } END{print "# dependencies";}' < GNUmakefile > GNUmakefile.new
	g++ -MM -I/local/include/CC/ ${INCLUDEFLAGS} *.c >> GNUmakefile.new
	mv GNUmakefile GNUmakefile.bak
	mv GNUmakefile.new GNUmakefile
@


1.9
log
@Added support for the 'testlib' target.
Added the iah/include path to the closure includes.
@
text
@d66 1
d103 1
a103 1
INCLUDEFLAGS	=  -I. -I${IACCINCLUDES} -I${IAHINCDIR} ${EXTRAINCLUDES}
d111 3
a113 1
CCC		= /local/bin/CC
@


1.8
log
@Added support to print source files out in batch.
Requests can be made at all three levels: IAH, chapters, algorithms.
@
text
@d38 5
a43 1

d118 1
a118 1
CLOSUREFLAGS	= -I. -I${IACCINCLUDES} ${EXTRAINCLUDES}
d204 3
@


1.7
log
@Clean up work on the closure target to avoid IA_ related instantiation
  errors.  Also some general housecleaning.
@
text
@d27 1
a27 1
#   SOURCES	source files for this group, may be used by target spotless
d236 3
@


1.6
log
@Fixed LDCLOSURE{FLAGS,LIBS} order in closure rule
@
text
@d20 3
a22 1
#   BLASTABLE_PTFILES	are related to closure maintenance
d44 4
a47 9
#
#TOP = /cis/homes/rjj/iacc/iah-src/
AR	= /usr/bin/ar
PERL	= perl
RANLIB	= /usr/bin/ranlib

# This is where the iac++ utilities live
IACDIR		= /cis/research/iac++
IACBINDIR	= ${IACDIR}/bin
d49 2
a50 2
# This is where the iac++ library we are using is rooted
#IACCROOT = /cis/homes/thoth/work
d52 1
d55 1
a55 1
# To override this, the usr defines, LOCALIACCVERSION, in GNUmakefile
d69 2
d72 2
d85 2
a91 1
INCDIR = ${IAHINCDIR}
d93 3
d106 7
d114 1
a114 1
CCCLOSUREFLAGS	= -I. -I${IACCINCLUDES}  ${EXTRAINCLUDES}
d118 3
d122 5
a126 3
CCC		= /local/bin/CC
COMPILE.cc	= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
LINK.cc		= $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
d151 1
a151 1
# Targets
a154 1
# This is not quite right, but I'll get back to it later
d156 1
a156 1
	echo Nothing to be done for all, no headers in: `pwd`
d165 3
d195 10
a204 2
##
##
d208 1
a208 3
		( ${CCC} -ptk -ptmlinkmap -ptdclosure ${CLOSUREARGS} \
			${CCCLOSUREFLAGS} ${LDCLOSUREFLAGS} ${LDCLOSURELIBS} \
			${LOBJS} ${CLOSUREOBJS} ) ; \
d216 2
a217 1
		${PERL} ${IACBINDIR}/iah.add-templobj.perl -${ARL} ${IAHLIB} ;\
a221 8
##
##
##

ifneq (${SIMPLETESTS},)
${SIMPLETESTS}: test%: test%.o lib
	${LINK.cc} -o $@@ $< ${LDLIBS}
endif
d223 3
a225 1
testprogs: ${TESTS}
d234 1
a234 1
	/bin/rm -f ${SOURCES} ${TESTS} lib closure
@


1.5
log
@Moved closure arguments so that compilation & link cmd line args
  appear before the objects to be compiled and/or linked.
@
text
@d181 1
a181 1
			${CCCLOSUREFLAGS} ${LDCLOSURELIBS} ${LDCLOSUREFLAGS} \
@


1.4
log
@Modifed  closure  target to use CCCLOSUREFLAGS, and not CCFLAGS.
@
text
@d181 2
a182 2
			${CCCLOSUREFLAGS} ${LOBJS} ${CLOSUREOBJS} \
			${LDCLOSURELIBS} ${LDCLOSUREFLAGS} ) ; \
@


1.3
log
@I belive this version is now correctly working with the GNUmakefile
  files to support global creation of iah code.
@
text
@d1 4
d8 1
a8 1

a14 1
#   LOCALTOP		Where your iah-src directory lives
d21 2
a22 1
#   CLOSUREOBJS	.o closure files to go in the ${IAHLIBDIR}/libiah.a
d25 2
d42 2
a47 1

d137 1
d139 1
a139 1
	echo Nothing to be done in: `pwd'
d142 1
a142 1
all: headers closure lib
d171 1
a171 1
	echo Nothing to be done for lib in: `pwd'
d181 1
a181 1
			${CCFLAGS} ${LOBJS} ${CLOSUREOBJS} \
d213 1
a213 1
	/bin/rm -f ${TESTS} lib closure
@


1.2
log
@Modified to support a global and local versions of the iac++ and iah
  libraries and include directories.  To use a local version
  modify the LOCAL* variables in the GNUmakefile.
Pointing at the new current iac++ library, which is v2.0, so
  some include file names have changed.
@
text
@d11 1
a11 1
#   TOP		Where you iah-src directory lives
d129 10
a138 2
all: headers lib ${HANDBOOK} ${TESTS}

d161 3
@


1.1
log
@Initial revision
@
text
@d12 5
a16 1
#   IACCVERSION	version of iac++ library you want,e.g. iac++0.8, iac++
d36 3
a38 3
AR = /usr/bin/ar
PERL = perl
RANLIB = /usr/bin/ranlib
d42 2
a43 2
IACDIR = /cis/research/iac++
IACBINDIR = ${IACDIR}/bin
d47 1
a47 1
IACCROOT = /cis/research/iac++
d49 14
a62 3
# IACCVERSION is define by user....
IACCDIR      = ${IACCROOT}/${IACCVERSION}
IACCINCLUDES = ${IACCDIR}/include
d65 1
a65 5
IAHDIR         = /cis/homes/rjj/iacc/iah-src
IAHLIBDIR      = ${IAHDIR}/lib
IAHLIBROOTNAME = iah
IAHLIB         = ${IAHLIBDIR}/lib${IAHLIBROOTNAME}.a
IAHINCDIR      = ${IAHDIR}/include
d67 14
d84 2
a85 2
CDEBUGFLAGS  = -g
INCLUDEFLAGS =  -I. -I${IACCINCLUDES} -I${IAHINCDIR} ${EXTRAINCLUDES}
d87 1
a87 1
CCFLAGS = ${CDEBUGFLAGS} ${INCLUDEFLAGS} ${XTRAFLAGS} ${XTRACCFLAGS}
d89 3
a91 3
LDLIBS  = -l${IAHLIBROOTNAME} -liac++ -lcomplex -lm ${OTHERLIBS}
LDDIRS  = -L${IAHLIBDIR} -L${IACCDIR}/lib
LDFLAGS = ${LDDIRS}
d94 3
a96 3
CCCLOSUREFLAGS = -I. -I${IACCINCLUDES}  ${EXTRAINCLUDES}
LDCLOSURELIBS  = -liac++ -lcomplex -lm ${OTHERLIBS}
LDCLOSUREFLAGS = -L${IACCDIR}/lib
d99 3
a101 3
CCC        = /local/bin/CC
COMPILE.cc = $(CCC) $(CCFLAGS) $(CPPFLAGS) $(TARGET_ARCH) -c
LINK.cc    = $(CCC) $(CCFLAGS) $(CPPFLAGS) $(LDFLAGS) $(TARGET_ARCH)
@
