/* 
 * Set xmub-specific variables.
 * This must come first
 */
#include "../xmub.tmpl"

/* 
 * rules for normal, shared, debugged and profiled libraries.
 */

REQUIREDLIBS = -lXm -lXt -lX11

#if ProjectX >= 5
#include <Library.tmpl>
#else
         CC = LibraryCcCmd
  CCOPTIONS = LibraryCCOptions
STD_DEFINES = LibraryDefines
CDEBUGFLAGS = LibraryCDebugFlags
#endif

SRCS = \
	xmubCustUi.c \
	xmubCustUtil.c \
	xmubUtils.c

OBJS = \
	xmubCustUi.o \
	xmubCustUtil.o \
	xmubUtils.o

HEADERS = \
	xmubCustUi.h \
	xmubCustUtil.h \
	xmubUtils.h

/*
 * R4 and R5 have very different ways of building libraries.
 * We include both methods here, so this Imakefile should work
 * on systems with both X11R4 and X11R5 imake config files.
 */
#if ProjectX >= 5
/*
 * general rules for building normal, shared, debugged, and profiled 
 * object files for the library.  Defined in Library.tmpl
 */
LibraryObjectRule()

/* 
 * rules for building the library 
 */
#if DoSharedLib
#if DoNormalLib
SharedLibraryTarget(xmub,xmubSharedLibraryRevision,$(OBJS),shared,..)
#else
SharedLibraryTarget(xmub,xmubSharedLibraryRevision,$(OBJS),.,.)
#endif
SharedLibraryDataTarget(xmub,xmubSharedLibraryRevision,$(UNSHAREDOBJS))
#endif
#if DoNormalLib
NormalLibraryTarget(xmub,$(OBJS))
#endif
#if DoProfileLib
ProfiledLibraryTarget(xmub,$(OBJS))
#endif
#if DoDebugLib
DebuggedLibraryTarget(xmub,$(OBJS))
#endif

/* 
 * rules for installing the library
 */
#if DoSharedLib
InstallSharedLibrary(xmub,xmubSharedLibraryRevision,$(XMUBLIBDIR))
InstallSharedLibraryData(xmub,xmubSharedLibraryRevision,$(XMUBLIBDIR))
#endif
#if DoNormalLib
InstallLibrary(xmub,$(XMUBLIBDIR))
#endif
#if DoProfileLib
InstallLibrary(xmub_p,$(XMUBLIBDIR))
#endif
#if DoDebugLib
InstallLibrary(xmub_d,$(XMUBLIBDIR))
#endif

#else  /* if X11R4 config files */
#if DoSharedLib 
# if DoDebugLib
SharedAndDebuggedLibraryObjectRule()
# else
SharedLibraryObjectRule()
# endif
#else
# if DoDebugLib && DoProfileLib
DebuggedAndProfiledLibraryObjectRule()
# else
#  if DoDebugLib
DebuggedLibraryObjectRule()
#  else
#   if DoProfileLib
ProfiledLibraryObjectRule()
#   else
NormalLibraryObjectRule()
#   endif
#  endif
# endif
#endif

/*
 * always generate unshared library too 
 */
#if DoSharedLib
NormalSharedLibraryTarget(xmub,xmubSharedLibraryRevision,$(OBJS))
InstallSharedLibrary(xmub,xmubSharedLibraryRevision,$(XMUBLIBDIR))
InstallSharedLibraryData(xmub,xmubSharedLibraryRevision,$(XMUBLIBDIR))
#endif
NormalLibraryTarget(xmub,$(OBJS))
InstallLibrary(xmub,$(XMUBLIBDIR))

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

#if DoProfileLib
ProfiledLibraryTarget(xmub,$(OBJS))
InstallLibrary(xmub_p,$(XMUBLIBDIR))
#endif

#if DoDebugLib
DebuggedLibraryTarget(xmub,$(OBJS))
#endif
#endif  /* R5 or R4 */

/* rule to install the header files */
InstallMultiple($(HEADERS),$(XMUBINCDIR))

/* rule for make depend: depends all in $SRCS using $ALLDEFINES */
DependTarget()
