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

# Local addition at IST to get HP build working
#ifdef	HPArchitecture
#define	SharedLibX	YES
#endif

# SGI requires a specification file for shared library that we don't have
#if defined(SGIArchitecture) && !SystemV4
#define DoSharedLib No
#else
#define DoSharedLib SharedLibX
#endif

#ifdef RsArchitecture
REQUIREDLIBS = -lXext -lXt -lX11
#endif

# on Dec Alpha we need to define the following to build the shared library
#ifdef AlphaArchitecture
SO_REQLIBS=-lX11 -lc
#endif

## 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

#if defined(UltrixArchitecture) || \
    (defined(MipsArchitecture) && !defined(SGIArchitecture))
DEFINES = -DZPIPE -DNEED_STRDUP
#else
DEFINES = -DZPIPE
#endif


#
# Normaly the following part should not need to be edited
#

#define DoNormalLib NormalLibX

#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

# get the version numbers from the xpm include file
#define XPM_NUMBERS
#include "xpm.h"
SOXPMLIBREV = XpmVersion./**/XpmRevision

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))
