#define SharedLibXew HasSharedLibraries
#define NormalLibXew (!SharedLibXew | ForceNormalLib)
#define DebugLibXew YES
#define ProfileLibXew YES
#ifndef SharedXewRev
#define SharedXewRev  5.0
#endif

#define DoNormalLib NormalLibXew
#define DoSharedLib SharedLibXew
#define DoDebugLib DebugLibXew 
#define DoProfileLib ProfileLibXew 
#include <Library.tmpl>

#ifdef RsArchitecture
REQUIREDLIBS = $(XMUSRC)/libXmu.a $(EXTENSIONSRC)/lib/libXext.a $(TOOLKITSRC)/libXt.a $(XLIBSRC)/libX11.a
#endif

       SOXEWREV = SharedXewRev
   INSTALLFLAGS = $(INSTINCFLAGS)
       LINTLIBS = $(LINTXLIB) $(LINTXTOOL)
       INCLUDES = -I. -I/usr/local/include /* -I$(OPENWINHOME)/include */

/*    MKDIRHIER = mkdirhier /* or something sometimes for R4 */

/* *******
** DEFINES
** *******
** ----------------------------------------------------------------
** -DANSI_INCLUDES		-DSYSV_INCLUDES		
** You have standard		You have System V	Might work even	
** ANSI C includes/library	include files.		without any.
** - DEC OSF/1 (cc)		- SunOS 4.x (gcc)
** - HPUX 8.x/9.x ANSI C	- HPUX 8.x/9.x (cc)
** - Sun Solaris (gcc)
** ----------------------------------------------------------------
** -DNO_TIFF
** Add if you don't have Sam Lefflers TIFF library installed
** (or if you don't want the support for TIFF compiled in).
** This flag is only tested within RasterTIFF.c module. When defined,
** the module will be compiled to produce a warning when TIFF import is
** attempted.
** ----------------------------------------------------------------
** -DNO_JPEG
** Add if you don't have JPEG library installed (or if you don't
** want the support compiled in). This flag is only tested within
** RasterJPEG.c module. When defined, the module will be compiled to
** produce a warning when JPEG import is attempted.
** ----------------------------------------------------------------
** -DNO_RLE
** Add if you don't have the Utah Raster Toolkit library installed
** (or if you don't want the support compiled in). This flag is only
** tested within RasterRLE.c. When defined, the module will be compiled
** to produce a warning when RLE import is attempted.
** ----------------------------------------------------------------
** -DAUDIO_SUN
** Must be defined, if SUN /dev/audio support is to be used. This is
** is only used in module AudioSUN.c and nowwhere else.
** ----------------------------------------------------------------
** -DSH_MEM
** Define this if your environment has the support for MIT Shared
** memory extension and if you want to compile the support for it.
** ----------------------------------------------------------------
** -DNDEBUG
** Disables <assert.h> assert statements (not much used in code).
** ----------------------------------------------------------------
** -DUSING_MOTIF_122
** Compiles in code which makes the widgets descend from the Motif widgets
** so that Xew widgets, when placed inside Motif managers, can receive
** keyboard focus.  
** ----------------------------------------------------------------
** -DIM_XCIN
** Enable XCIN BIG5 input library in TextEd.c (requires that you also
** link xcin library with your application). A very crude hack that may
** not work.
*/
#ifdef SparcArchitecture
AUDIOSUPPORT = -DAUDIO_SUN
#endif

DEFINES = -DSYSV_INCLUDES $(AUDIOSUPPORT) -DNDEBUG -DSH_MEM

/* CC = cc -Aa -D_HPUX_SOURCE  /* for HPUX ANSI C, if not default */
/* CDEBUGFLAGS = */

/*
** CCOPTIONS depend on chosen compiler (leave unspecified if you don't know,
** defaults should work in most correctly configured environments)
**
** gcc		CCOPTIONS = -Wall
** HPUX cc	<none>
** Apollo cc	<none>
** Sun cc	<none>
** DEC OSF1 cc	<none>
*/

CCOPTIONS = -Wall

/*
** PICFLAGS depend on chosen compiler (leave unspecified first, this
** should be correctly set by default). But, if it is not, use the
** following (position independent code):
**
** gcc		PICFLAGS = -fpic
** Sun cc	?
** DEC OSF1 cc	<none>
*/

/* PICFLAGS = */

/*
** ------- NO CONFIGURATION CHANGES BELOW THIS POINT ---------
*/
HEADERS = \
	AllWidgets.h \
	Animation.h \
	AnimationP.h \
	Audio.h \
	AudioP.h \
	Basic.h \
	BasicP.h \
	Frame.h \
	FrameP.h \
	FrameSupport.h \
	Geometric.h \
	GeometricP.h \
	Raster.h \
	RasterP.h \
	Support.h \
	Text.h \
	TextP.h \
	TextEd.h \
	TextEdP.h \
	Video.h \
	VideoP.h \
	XewInit.h

SRCS = \
	AllWidgets.c \
	Animation.c \
	Audio.c \
	AudioSUN.c \
	Basic.c \
	BasicColor.c \
	Frame.c \
	FrameSupport.c \
	Geometric.c \
	ImageTools.c \
	Raster.c \
	Raster24to8.c \
	RasterGIF.c \
	RasterImport.c \
	RasterJPEG.c \
	RasterLayout.c \
	RasterPBM.c \
	RasterRLE.c \
	RasterTIFF.c \
	Support.c \
	Text.c \
	TextExport.c \
	TextFont.c \
	TextImport.c \
	TextLayout.c \
	TextEd.c \
	Video.c \
	VideoImage.c \
	VideoMPEG.c \
	XewInit.c \
	ccfilter.c \
	mpeg_decoders.c \
	mpeg_jrevdct.c \
	mpeg_motionvector.c \
	mpeg_parseblock.c \
	mpeg_util.c \
	mpeg_video.c \
	sharedlib.c

#if SharedDataSeparation
UNSHAREDOBJS = AllWidgets.o sharedlib.o
#endif

OBJS = \
	AllWidgets.o \
	Animation.o \
	Audio.o \
	AudioSUN.o \
	Basic.o \
	BasicColor.o \
	Frame.o \
	FrameSupport.o \
	Geometric.o \
	ImageTools.o \
	Raster.o \
	Raster24to8.o \
	RasterGIF.o \
	RasterImport.o \
	RasterJPEG.o \
	RasterLayout.o \
	RasterPBM.o \
	RasterRLE.o \
	RasterTIFF.o \
	Support.o \
	Text.o \
	TextExport.o \
	TextFont.o \
	TextImport.o \
	TextLayout.o \
	TextEd.o \
	Video.o \
	VideoImage.o \
	VideoMPEG.o \
	XewInit.o \
	mpeg_decoders.o \
	mpeg_jrevdct.o \
	mpeg_motionvector.o \
	mpeg_parseblock.o \
	mpeg_util.o \
	mpeg_video.o \
	ccfilter.o

#ifdef LibraryObjectRule
LibraryObjectRule()
#else
SharedAndDebuggedLibraryObjectRule()
#undef DoProfileLib /* Sorry, no profiled for R4. Hack it yourself! */
#endif

#if DoSharedLib && SharedDataSeparation
SpecialObjectRule(sharedlib.o,,$(SHLIBDEF))
#endif


#if DoSharedLib
#if DoNormalLib
#ifdef SharedLibraryTarget
SharedLibraryTarget(Xew,$(SOXEWREV),$(OBJS),shared,..)
#else
NormalSharedLibraryTarget(Xew,$(SOXEWREV),$(OBJS))
#endif
#else
#ifdef SharedLibraryTarget
SharedLibraryTarget(Xew,$(SOXEWREV),$(OBJS),.,.)
#else
NormalSharedLibraryTarget(Xew,$(SOXEWREV),$(OBJS))
#endif
#endif
#ifdef SharedLibraryDataTarget
SharedLibraryDataTarget(Xew,$(SOXEWREV),$(UNSHAREDOBJS))
#else
NormalSharedLibraryDataTarget(Xew,$(SOXEWREV),$(UNSHAREDOBJS))
#endif
InstallSharedLibrary(Xew,$(SOXEWREV),$(USRLIBDIR))
InstallSharedLibraryData(Xew,$(SOXEWREV),$(USRLIBDIR))
#endif

#if DoNormalLib
NormalLibraryTarget(Xew,$(OBJS))
InstallLibrary(Xew,$(USRLIBDIR))
#endif
#if DoProfileLib
ProfiledLibraryTarget(Xew,$(OBJS))
InstallLibrary(Xew_p,$(USRLIBDIR))
#endif
#if DoDebugLib
DebuggedLibraryTarget(Xew,$(OBJS))
InstallLibrary(Xew_d,$(USRLIBDIR))
#endif

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

BuildIncludes($(HEADERS),Xew,..)

InstallMultipleDest(install.includes,$(HEADERS),$(INCDIR)/Xew/)

DependTarget()

NormalLintTarget($(SRCS))


