# Copyright 1990-93 GROUPE BULL -- See licence conditions in file COPYRIGHT
#
# XPM Imakefile - Arnaud LE HORS
#

# as this library is only a "temporary" libarary, I do not want to
# install as a public library. So this library is not sharable.
# If you install the libaray, you can change the if statement to 1.
#if 0
#define DoNormalLib NormalLibX
#define DoSharedLib SharedLibX
#else
#define DoNormalLib YES
#define DoSharedLib NO
#endif

#if (ProjectX < 5)
    STD_DEFINES = LibraryDefines
    CDEBUGFLAGS = LibraryCDebugFlags
#else
/* R5 needs another .tmpl file to find these #def's.  This .tmpl file will */
/* also set STD_DEFINES and CDEBUGFLAGS properly.                          */
#include <Library.tmpl>
#endif

       INCLUDES = -I.
   INSTALLFLAGS = $(INSTINCFLAGS)
       LINTLIBS = $(LINTXTOLL) $(LINTXLIB) 

#ifdef OsNameDefines
OS_NAME_DEFINES = OsNameDefines
#endif

# the following revision number is determined with the following rule:
# SO Major number = LIB minor version number.
# SO Minor number = LIB sub-minor version number.
# e.g: Xpm version 3.2f
#      we forget the 3 which is the format number, 2 gives 2, and f gives 6.
#      thus we have SOXPMLIBREV = 2.6

SOXPMLIBREV = 2.7

## if your system doesn't provide strcasecmp add -DNEED_STRCASECMP
## if your system doesn't provide strdup add -DNEED_STRDUP
## if your system doesn't provide pipe remove -DZPIPE

#ifdef UltrixArchitecture
DEFINES = -DZPIPE -DNEED_STRDUP
#else
DEFINES = -DZPIPE
#endif

HEADERS = xpm.h
  SRCS = data.c create.c misc.c rgb.c scan.c parse.c hashtable.c \
	 XpmCrBufFrI.c XpmCrDataFrP.c XpmCrPFrBuf.c XpmRdFToI.c XpmWrFFrI.c \
	 XpmCrBufFrP.c XpmCrIFrBuf.c XpmCrPFrData.c XpmRdFToP.c XpmWrFFrP.c \
	 XpmCrDataFrI.c XpmCrIFrData.c XpmRdFToData.c XpmWrFFrData.c

  OBJS = data.o create.o misc.o rgb.o scan.o parse.o hashtable.o \
	 XpmCrBufFrI.o XpmCrDataFrP.o XpmCrPFrBuf.o XpmRdFToI.o XpmWrFFrI.o \
	 XpmCrBufFrP.o XpmCrIFrBuf.o XpmCrPFrData.o XpmRdFToP.o XpmWrFFrP.o \
	 XpmCrDataFrI.o XpmCrIFrData.o XpmRdFToData.o XpmWrFFrData.o

#if (ProjectX < 5)

#if DoSharedLib
SharedLibraryObjectRule()
NormalSharedLibraryTarget(Xpm,$(SOXPMLIBREV),$(OBJS))
InstallSharedLibrary(Xpm,$(SOXPMLIBREV),$(USRLIBDIR))
#else
NormalLibraryObjectRule()
#endif
NormalLibraryTarget(Xpm,$(OBJS))
InstallLibrary(Xpm,$(USRLIBDIR))

#else

LibraryObjectRule()

#if DoSharedLib
#if DoNormalLib
SharedLibraryTarget(Xpm,$(SOXPMLIBREV),$(OBJS),shared,..)
#else
SharedLibraryTarget(Xpm,$(SOXPMLIBREV),$(OBJS),.,.)
#endif
InstallSharedLibrary(Xpm,$(SOXPMLIBREV),$(USRLIBDIR))
#endif
#if DoNormalLib
NormalLibraryTarget(Xpm,$(OBJS))
InstallLibrary(Xpm,$(USRLIBDIR))
#endif

#endif 

InstallMultiple($(HEADERS),$(INCDIR))
LintLibraryTarget(Xpm,$(SRCS))
InstallLintLibrary(Xpm,$(LINTLIBDIR))
DependTarget()
NormalLintTarget($(SRCS))
