#include "../Wc.tmpl"

/**/# Imakefile for libWc
/**/# This file is derived from mit/lib/Xt/Imakefile

# If you are building libWc to run on top of an Xt older
# than X11R5 then you must add additional files, just
# defining PreR4 YES or PreR5 YES ( see ../Wc.tmpl )

#if PreR4
#undef  PreR5
#define PreR5 YES
PRE_R4_SRCS = PreR4GetResL.c
PRE_R4_OBJS = PreR4GetResL.o
PRE_R4_DEFS = -DPRE_R4
#endif

#if PreR5
PRE_R5_SRCS = PreR5Enum.c
PRE_R5_OBJS = PreR5Enum.o
PRE_R5_DEFS = -DPRE_R5
#endif

#if HaveMotif10
    DEFINES = -DXAPPLOADDIR=\"$(XAPPLOADDIR)$(PATHSEP)\" -DMOTIF10 \
              $(PRE_R4_DEFS) $(PRE_R5_DEFS)
#else
    DEFINES = -DXAPPLOADDIR=\"$(XAPPLOADDIR)$(PATHSEP)\" \
              $(PRE_R4_DEFS) $(PRE_R5_DEFS)
#endif

       INCLUDES = -I. -I$(TOP) $(X11INC)

HEADERS = WcCreate.h WcCreateP.h

SRCS = \
	WcCreate.c \
	WcActions.c \
	WcCallb.c \
	WcConvert.c \
	WcName.c \
	WcReg.c \
	WcRegXt.c \
	$(PRE_R4_SRCS) $(PRE_R5_SRCS)

OBJS = \
	WcCreate.o \
	WcActions.o \
	WcCallb.o \
	WcConvert.o \
	WcName.o \
	WcReg.o \
	WcRegXt.o \
	$(PRE_R4_OBJS) $(PRE_R5_OBJS)

all::
#if HasSunOSSharedLibraries
# if DebugLibWc
SharedAndDebuggedLibraryObjectRule()
SpecialSharedAndDebuggedObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
# else
SharedLibraryObjectRule()
SpecialSharedObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
# endif
#else
# if DebugLibWc && ProfileLibWc
DebuggedAndProfiledLibraryObjectRule()
SpecialDebuggedAndProfiledObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
# else
#  if DebugLibWc
DebuggedLibraryObjectRule()
SpecialDebuggedObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
#  else
#   if ProfileLibWc
ProfiledLibraryObjectRule()
SpecialProfiledObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
#   else
NormalLibraryObjectRule()
SpecialObjectRule(WcCallb.o,$(ICONFIGFILES),$(APP_DEFINES))
#   endif
#  endif
# endif
#endif

/*
 * always generate unshared library too
 */
MakeDirectories(install,$(INSTLIB))
#if HasSunOSSharedLibraries
NormalSharedLibraryTarget(Wc,$(SoWcRev),$(OBJS))
InstallSharedLibrary(Wc,$(SoWcRev),$(INSTLIB))
#endif
NormalLibraryTarget(Wc,$(OBJS))
InstallLibrary(Wc,$(INSTLIB))

LintLibraryTarget(Wc,$(SRCS))
InstallLintLibrary(Wc,$(INSTLIN))

#if ProfileLibWc
ProfiledLibraryTarget(Wc,$(OBJS))
InstallLibrary(Wc_p,$(INSTLIB))
#endif

#if DebugLibWc
DebuggedLibraryTarget(Wc,$(OBJS))
#endif

MakeDirectories(install,$(INSTINC)/Wc)
InstallMultiple($(HEADERS),$(INSTINC)/Wc)

DependTarget()

NormalLintTarget($(SRCS))

