/*
** *NOTE*
**	Building Mam does not really need anything from the X libraries
**	or includes. This is just easy way of getting system independent
**	Imakefile that produces shared libs if needed.
*/
#define SharedLibMam HasSharedLibraries
#define NormalLibMam (!SharedLibMam | ForceNormalLib)
#define DebugLibMam YES
#define ProfileLibMam YES

#define DoNormalLib NormalLibMam
#define DoSharedLib SharedLibMam
#define DoDebugLib DebugLibMam 
#define DoProfileLib ProfileLibMam 
#include <Library.tmpl>

/*
** INCDIR and USRLIBDIR
**	are only used if you decide to install the libraries
*/
         INCDIR = /usr/local/include/Mam
      USRLIBDIR = /usr/local/lib
/*
** There is no need to search X11 include directories, just use
** current directory instead.
*/
        INCROOT = .

       SOMAMREV = 2.0
   INSTALLFLAGS = $(INSTINCFLAGS)
       LINTLIBS = $(LINTXLIB) $(LINTXTOOL)
        DEFINES = -DANSI_INCLUDES -DMAM_VERSION="\"`cat VERSION`\""

/*
** for HPUX, use..
**
** CCOPTIONS = -Aa -D_HPUX_SOURCE 
** CDEBUGFLAGS =	(sometimes)
**
** for gcc on Sun
**
** CCOPTIONS = -Wall
*/

/* CCOPTIONS= -Wall */


/*
** ------- NO CONFIGURATION CHANGES BELOW THIS POINT ---------
*/
HEADERS = \
	Mfm.h \
	Mam.h \
	message.h \
	tables.h \
	typedefs.h

SRCS = \
	Mam.c \
	MamCache.c \
	MamCoding.c \
	MamCommon.c \
	MamLoad.c \
	MamSave.c \
	Mfm.c \
	message.c \
	tables.c

OBJS = \
	Mam.o \
	MamCache.o \
	MamCoding.o \
	MamCommon.o \
	MamLoad.o \
	MamSave.o \
	Mfm.o \
	message.o \
	tables.o

#ifdef LibraryObjectRule
LibraryObjectRule()
#else
SharedAndDebuggedLibraryObjectRule()
#undef DoProfileLib /* Sorry, no profiled for R4. Hack it yourself! */
#endif

#if DoSharedLib
#if DoNormalLib
#ifdef SharedLibraryTarget
SharedLibraryTarget(Mam,$(SOMAMREV),$(OBJS),shared,..)
#else
NormalSharedLibraryTarget(Mam,$(SOMAMREV),$(OBJS))
#endif
#else
#ifdef SharedLibraryTarget
SharedLibraryTarget(Mam,$(SOMAMREV),$(OBJS),.,.)
#else
NormalSharedLibraryTarget(Mam,$(SOMAMREV),$(OBJS))
#endif
#endif
InstallSharedLibrary(Mam,$(SOMAMREV),$(USRLIBDIR))
#endif

#if DoNormalLib
NormalLibraryTarget(Mam,$(OBJS))
InstallLibrary(Mam,$(USRLIBDIR))
#endif
#if DoProfileLib
ProfiledLibraryTarget(Mam,$(OBJS))
InstallLibrary(Mam_p,$(USRLIBDIR))
#endif
#if DoDebugLib
DebuggedLibraryTarget(Mam,$(OBJS))
InstallLibrary(Mam_d,$(USRLIBDIR))
#endif

LintLibraryTarget(Mam,$(SRCS))
InstallLintLibrary(Mam,$(LINTLIBDIR))

InstallMultipleDest(install.includes,$(HEADERS),$(INCDIR))

DependTarget()

NormalLintTarget($(SRCS))
