/*
BeginILUCopyright

Copyright (c) 1991-1998 Xerox Corporation.  All Rights Reserved.

Unlimited use, reproduction, modification, and distribution of this
software and modified versions thereof is permitted.  Permission is
granted to make derivative works from this software or a modified
version thereof.  Any copy of this software, a modified version
thereof, or a derivative work must include both the above copyright
notice of Xerox Corporation and this paragraph.  Any distribution of
this software, a modified version thereof, or a derivative work must
comply with all applicable United States export control laws.  This
software is made available AS IS, and XEROX CORPORATION DISCLAIMS ALL
WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE, AND NOTWITHSTANDING ANY OTHER PROVISION CONTAINED HEREIN, ANY
LIABILITY FOR DAMAGES RESULTING FROM THE SOFTWARE OR ITS USE IS
EXPRESSLY DISCLAIMED, WHETHER ARISING IN CONTRACT, TORT (INCLUDING
NEGLIGENCE) OR STRICT LIABILITY, EVEN IF XEROX CORPORATION IS ADVISED
OF THE POSSIBILITY OF SUCH DAMAGES.
  
EndILUCopyright

$Id: Imakefile,v 1.8 1998/10/08 22:58:06 janssen Exp $
*/

NormalObjectRule()
DependTarget()
 
XTOBJS =
XVIEWOBJS =
TKOBJS =

LOCALINCLUDES = -I../../runtime/kernel

#include "../../runtime/kernel/iluconf.h"

/* figure out sizes for ints */
#if (SIZEOF_SHORT != 2)
#if (SIZEOF_INT != 2)
#if (SIZEOF_CHAR != 2)
/* do something here XXX */
#else
INT16_TYPE=signed char
#endif /* CHAR */
#else
INT16_TYPE=int
#endif /* INT */
#else
INT16_TYPE=short
#endif /* SHORT */

#if (SIZEOF_INT != 4)
#if (SIZEOF_SHORT != 4)
#if (SIZEOF_LONG != 4)
/* do something here XXX */
#else
INT32_TYPE=long int
#endif /* LONG */
#else
INT32_TYPE=short int
#endif /* SHORT */
#else
INT32_TYPE=int
#endif /* INT */

#ifdef LONG_INTEGER_TYPE
POSSIBLE_LONG_LONG_DEF=1
LOCAL_LONG_INTEGER_TYPE=LONG_INTEGER_TYPE
MAX_INTEGER_TYPE=ilubignum_int64
#else
POSSIBLE_LONG_LONG_DEF=0
MAX_INTEGER_TYPE=ilubignum_int32
#endif

LOCAL_SIZE_T=SIZE_T

ilubignm.h : ilubignm.h-dist ../../imake/ilu.defs.new
	sed -e 's/INT32_TYPE/$(INT32_TYPE)/g' -e 's/INT16_TYPE/$(INT16_TYPE)/g' -e 's/LONG_INTEGER_TYPE/$(LOCAL_LONG_INTEGER_TYPE)/g' -e 's/POSSIBLE_LONG_LONG_DEF/$(POSSIBLE_LONG_LONG_DEF)/g' -e 's/SIZE_T/$(LOCAL_SIZE_T)/' < ilubignm.h-dist >ilubignm.h

CleanTarget(ilubignm.h)

bignum.o : bignum.c ilubignm.h bignum.h
bigarith.o : bignum.h bigarith.c ilubignm.h ilubnops.h

OBJS = bignum.o bigarith.o

all::	$(OBJS)
 
InstallRO(ilubignm.h, $(DESTDIR)/include)

#ifdef ILU_BIGNUM_LIBRARY_SUPPORT
LibraryTarget(libilubignum.a, $(OBJS))
InstallLibrary(libilubignum.a, $(DESTDIR)/lib)
InstallRO(ilubnops.h, $(DESTDIR)/include)
#endif

#ifdef ILU_FIXED_POINT_SUPPORT
/* needed for parser library, which in turn is needed for genregs... */

dist:: bignum.o bigarith.o

#endif /* def ILU_FIXED_POINT_SUPPORT */

TestProgramTarget(testprg, testprg.o $(OBJS),,) 

