#ifndef WcTopDir
#define WcTopDir ..
#endif

#include "../Wc.tmpl"

XCOMM ##########################################################################
XCOMM # SCCS_data: @(#) Imakefile 1.2 92/10/28 08:04:19
XCOMM #
XCOMM # Simple Test Shared Library for Dynamic Linking Demo
XCOMM #
XCOMM # Imakefile for libStuff for Wcl 2.0
XCOMM #
#define DoSharedLib 1

#if XRelease >= 50
#include <Library.tmpl>
#endif

   INSTALLFLAGS = $(INSTINCFLAGS)
       LINTLIBS = $(LINTXLIB)

#define LibraryName Stuff

HEADERS = Stuff.h
   SRCS = Stuff.c
   OBJS = Stuff.o

/*#include "../WcLib.tmpl"	- we don't install this one!  
*/
   LIBRARY_NAME = LibraryName

#if XRelease >= 50
XCOMM # Wcl Library Template for X11R5
XCOMM # 

      LIBRARY_g = Concat($(LIBRARY_NAME),_g)
      LIBRARY_p = Concat($(LIBRARY_NAME),_p)

/* LibraryObjectRule which accepts cc options
*/
#define CustomLibraryObjectRule(options)				@@\
all::									@@\
	_DebuggedLibMkdir()						@@\
	_ProfiledLibMkdir()						@@\
	_SharedLibMkdir()						@@\
									@@\
.c.o:									@@\
	_DebuggedObjCompile(options)					@@\
	_ProfiledObjCompile(options)					@@\
	_SharedObjCompile(options)					@@\
	_NormalObjCompile(options)					@@\
									@@\
clean::									@@\
	_DebuggedCleanDir()						@@\
	_ProfiledCleanDir()						@@\
	_SharedCleanDir()						@@\


#ifdef LibraryOptions
DEPENDFLAGS = LibraryOptions
CustomLibraryObjectRule($(DEPENDFLAGS))
#else
LibraryObjectRule()
#endif

#if DoSharedLib
#if DoNormalLib
SharedLibraryTarget($(LIBRARY_NAME),$(SOWCREV),$(OBJS),shared,..)
#else
SharedLibraryTarget($(LIBRARY_NAME),$(SOWCREV),$(OBJS),.,.)
#endif
#endif
#if DoNormalLib
NormalLibraryTarget($(LIBRARY_NAME),$(OBJS))
#endif
#if DoProfileLib
ProfiledLibraryTarget($(LIBRARY_NAME),$(OBJS))
#endif
#if DoDebugLib
DebuggedLibraryTarget($(LIBRARY_NAME),$(OBJS))
#endif

LintLibraryTarget($(LIBRARY_NAME),$(SRCS))

BuildIncludes($(HEADERS),$(LIBRARY_NAME),..)

DependTarget()

NormalLintTarget($(SRCS))

XCOMM # End of Wcl Library Template for X11R5
#else
XCOMM # Wcl Library Template for Pre-X11R5
XCOMM # 

/*
 * Concat - concatenates two strings - straight from R5.
 */
#ifndef Concat
#if __STDC__ && !defined(UnixCpp)
#define Concat(a,b) a##b
#else
#define Concat(a,b) a/**/b
#endif
#endif

      LIBRARY_g = Concat($(LIBRARY_NAME),_g)
      LIBRARY_p = Concat($(LIBRARY_NAME),_p)

all::
#if DoSharedLib
# if DoDebugLib
SharedAndDebuggedLibraryObjectRule()
#define MySpecialRule(a,b,c) SpecialSharedAndDebuggedObjectRule(a,b,c)
# else
SharedLibraryObjectRule()
#define MySpecialRule(a,b,c) SpecialSharedObjectRule(a,b,c)
# endif
#else
# if DoDebugLib && DoProfileLib
DebuggedAndProfiledLibraryObjectRule()
#define MySpecialRule(a,b,c) SpecialDebuggedAndProfiledObjectRule(a,b,c)
# else
#  if DoDebugLib
DebuggedLibraryObjectRule()
#define MySpecialRule(a,b,c) SpecialDebuggedObjectRule(a,b,c)
#  else
#   if DoProfileLib
ProfiledLibraryObjectRule()
#define MySpecialRule(a,b,c) SpecialProfiledObjectRule(a,b,c)
#   else
NormalLibraryObjectRule()
#define MySpecialRule(a,b,c) SpecialObjectRule(a,b,c)
#   endif
#  endif
# endif
#endif

#ifndef SpecialLibObjectRule
#define SpecialLibObjectRule(objs,deps,options) MySpecialRule(objs,deps,options)
#endif

#if HasSharedLibraries && DoSharedLib
NormalSharedLibraryTarget($(LIBRARY_NAME),$(SOWCREV),$(OBJS))
#endif

#if DoNormalLib
NormalLibraryTarget($(LIBRARY_NAME),$(OBJS))
#endif

LintLibraryTarget($(LIBRARY_NAME),$(SRCS))

#if DoProfileLib
ProfiledLibraryTarget($(LIBRARY_NAME),$(OBJS))
#endif

#if DoDebugLib
DebuggedLibraryTarget($(LIBRARY_NAME),$(OBJS))
#endif

BuildIncludes($(HEADERS),$(LIBRARY_NAME),..)

DependTarget()

XCOMM # End of Wcl Library Template for Pre-X11R5
#endif

includes::

install::

install.man::

