#
#		 Copyright 1994 Christopher B. Liebman
#
#     Permission to use, copy, modify, distribute, and sell this software
#     and its documentation for any purpose is hereby granted without fee,
#     provided that the above copyright notice appear in all copies and that
#     both that copyright notice and this permission notice appear in
#     supporting documentation, and that the name Christopher B. Liebman not
#     be used in advertising or publicity pertaining to distribution of this
#     software without specific, written prior permission.
#
#    THIS SOFTWARE IS PROVIDED `AS-IS'.  CHRISTOPHER B. LIEBMAN, DISCLAIMS
#    ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING WITHOUT
#    LIMITATION ALL IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
#    PARTICULAR PURPOSE, OR NONINFRINGEMENT.  IN NO EVENT SHALL CHRISTOPHER
#    B. LIEBMAN, BE LIABLE FOR ANY DAMAGES WHATSOEVER, INCLUDING SPECIAL,
#    INCIDENTAL OR CONSEQUENTIAL DAMAGES, INCLUDING LOSS OF USE, DATA, OR
#    PROFITS, EVEN IF ADVISED OF THE POSSIBILITY THEREOF, AND REGARDLESS OF
#    WHETHER IN AN ACTION IN CONTRACT, TORT OR NEGLIGENCE, ARISING OUT OF
#    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#    
#
# $Id: Imakefile,v 1.18 1994/01/13 02:20:07 liebman Exp $
#
#    Makefile for xfaces 2.1.
#

/*
 *  Undefine any of these to remove that feature.
 *
 * USE_XPM	- Allows xpm format pixmaps to be used for face images.
 * USE_SHAPE	- Allows the use of the shape extension for face images.
 * USE_SOUND	- Enables sound support using netaudio (tested with 1.1)
 * USE_BUCKETS	- Store audio samples as buckets while they are active.
 *
 * Note: netaudio-1.1
 * USE_BUCKETS currently has a problem on both my Sparc10 SunOS 4.1.3 and
 * my SparcIPC SunOS 4.1.1.  When the bucket is played if tends to have an
 * audible glitch after the first 1/4 to 1/2 second!  The file ausun.patch
 * contains a fix for this.  Either apply the patch or undefine USE_BUCKETS!
*/


#define	USE_XPM
#define USE_SHAPE
#define USE_SOUND
#define	USE_BUCKETS

#ifdef USE_XPM
XPM_SRCS	= face_image_xpm.c
XPM_OBJS	= face_image_xpm.o
XPM_INCL	= 
XPM_LIBS	= -lXpm
XPM_DEFS	= -DXPM
#endif

#ifdef USE_SOUND
SOUND_SRCS	= face_sound.c
SOUND_OBJS	= face_sound.o
SOUND_INCL	= 
#SOUND_INCL	= -I/usr/audio/include
SOUND_LIBS	= -laudio
#SOUND_LIBS	= -L/usr/audio/lib -laudio
#ifdef USE_BUCKETS
SOUND_DEFS	= -DSOUND -DUSE_BUCKETS
#else
SOUND_DEFS	= -DSOUND
#endif
#endif

#ifdef USE_SHAPE
SHAPE_SRCS	= face_shape.c
SHAPE_OBJS	= face_shape.o
SHAPE_INCL	= 
SHAPE_LIBS	= 
SHAPE_DEFS	= -DSHAPE
#endif

XFACES_VERSION_TAG=

HDRS	= faces.h \
	  face_image.h \
	  face_sound.h \
	  patchlevel.h \
	  regexp.h \
	  regmagic.h

SRCS	= face_actions.c \
	  face_binding.c \
	  face_display.c \
	  face_image.c \
	  face_image_xbm.c \
	  main.c  \
	  mail_check.c  \
	  mail_items.c  \
	  mail_parse.c \
	  regexp.c \
	  regsub.c \
	  $(SOUND_SRCS) $(XPM_SRCS) $(SHAPE_SRCS)

OBJS	= face_actions.o \
	  face_binding.o \
	  face_display.o \
	  face_image.o \
	  face_image_xbm.o \
	  main.o  \
	  mail_check.o  \
	  mail_items.o  \
	  mail_parse.o \
	  regexp.o \
	  regsub.o \
	  $(SOUND_OBJS) $(XPM_OBJS) $(SHAPE_OBJS)

OTHER_FILES	= BLURB README TODO COPYRIGHT Imakefile xfaces.man ausun.patch

INCLUDES	= $(TOP_INCLUDES) $(SOUND_INCL) $(XPM_INCL) $(SHAPE_INCL)
SYS_LIBRARIES	= $(SOUND_LIBS) -lm
LOCAL_LIBRARIES = $(XPM_LIBS) XawClientLibs
DEFINES		= $(SOUND_DEFS) $(XPM_DEFS) $(SHAPE_DEFS)

ComplexProgramTarget(xfaces)
InstallAppDefaults(XFaces)


#
# A bit of a hack to make life easier.
#

distribution:
	(XFV=`grep XFACES_VERSION patchlevel.h|awk '{print $$3}'`; \
	XFT=XFACES_`echo $$XFV | sed 's/\./_/'`; \
	mkdir -p Distribution/xfaces-$$XFV; \
	cd Distribution/xfaces-$$XFV; \
	ln -s ../../RCS; \
	co -r$$XFT Imakefile; \
	xmkmf; \
	make XFACES_VERSION_TAG=$$XFT current; \
	rm RCS; \
	cd ../..; \
	tar cf - images | (cd Distribution/xfaces-$$XFV; tar xvf -); \
	cd Distribution; \
	tar cvf xfaces-$$XFV.tar xfaces-$$XFV; \
	makekit -nxfaces-$$XFV.part xfaces-$$XFV\/* xfaces-$$XFV/images\/*)

current:
	co -r$(XFACES_VERSION_TAG) $(HDRS) $(SRCS) $(OTHER_FILES)

tag:
	if [ ! -z "$(XFACES_VERSION_TAG)" ]; then \
	    for i in $(HDRS) $(SRCS) $(OTHER_FILES);do \
		head=`rlog -h $$i | grep '^head' | awk '{print $$2}'`; \
		rcs -N$(XFACES_VERSION_TAG):$$head $$i; \
	    done; \
	fi

files:
	@echo $(HDRS) $(SRCS) $(OTHER_FILES)

clean::
	rm -rf Distribution

