#        Copyright 1993, Center for Computer Vision and Visualization,
#        University of Florida.  All rights reserved.
#
# this is a GNUmakefile.  It must be processed with GNU make.
#

TARGET_ARCH=
TOP=../..

# You should define the make variables LOBJS and HEADERS before the
# include directive.  LOBJS is a list of Library OBJects that belong
# in ../../lib/libiac++.a.  HEADERS is a list of public header files 
# that belong in iac++/include -- they
#

LOBJS= IntPoint.o DblPoint.o
HEADERS= Point.h IntPoint.h DblPoint.h point_errors.h
DISTFILES = GNUmakefile Point_c.m4 Point.h Point_h.m4 defines.m4 point_errors.h

include ${TOP}/src/gnumake.templ

# The above include of gnumake.templ introduces a few targets 
# that everyone will use
#
# all: install the header files, build the LOBJS and add them
# to the library
#
# ?? headers-force: force the header files to be copied into include
#
# headers: used by all to install the header files when changed
#
# lib: used by all to add LOBJS to ../../lib/libiac++.a.  libiac++.a is
# your own personal copy of the system libiac++.a that only contains the
# parts you are working on.  ../../librelease.a is a pointer to the
# shared version of /cis/vision/src/iac++/lib/libiac++.a -- rule of thumb:
# NEVER MODIFIY librelease.a -- modify libiac++.a instead.
#
# reallib: this puts your LOBJS into the real libiac++ so that
# everyone else can use them.  Make sure they work first.
#
# clean:: removes all .o and ~ files.  You may define additional
# clean targets to remove other files that you may have generated.
#
# spotless:: the same as clean, but more so.  It should remove
# binaries.  You should define additional spotless targets that
# remove your test binaries and other files that aren't deleted
# by clean.

M4_FILES= Point_c.m4 Point_h.m4 defines.m4

fullsrc:			IntPoint.c IntPoint.h DblPoint.c DblPoint.h

IntPoint.c:	defines.m4 Point_c.m4
	rm -f $@
	${M4} -DINTPOINT defines.m4 Point_c.m4 | cat -s > $@
	chmod a-w $@

IntPoint.h:	defines.m4 Point_h.m4
	rm -f $@
	${M4} -DINTPOINT defines.m4 Point_h.m4 | cat -s > $@
	chmod a-w $@

DblPoint.c:	defines.m4 Point_c.m4
	rm -f $@
	${M4} -DDOUBLEPOINT defines.m4 Point_c.m4 | cat -s > $@
	chmod a-w $@

DblPoint.h:	defines.m4 Point_h.m4
	rm -f $@
	${M4} -DDOUBLEPOINT defines.m4 Point_h.m4 | cat -s > $@
	chmod a-w $@
         

spotless::
	rm -f IntPoint.[ch] DblPoint.[ch]

# dependencies
IntPoint.o : IntPoint.c ${INCDIR}/compat.h IntPoint.h ${INCDIR}/ia.h \
  Point.h 
DblPoint.o : DblPoint.c ${INCDIR}/compat.h DblPoint.h ${INCDIR}/ia.h \
  Point.h IntPoint.h 
