#
#	$Id: yMakefile,v 1.15 2005-08-03 21:13:26 haley Exp $
#

MYNAME		= scripts

SCRIPTS		= ncarvversion ctlib gcaps fcaps 

RASTER_SPECIFIERS	= \sun xwd nrif hdf avs \sgi hppcl


CTXT_SPECIFIER = CTXT

#
#	X11 libraries
#
#ifdef BuildXlibDependentCode
X11LIBS		= $(XLIB)
X11_SPECIFIER	= X11 
#endif BuildXlibDependentCode

#
#	Sun SunView libraries
#
#ifdef BuildSunViewctrans
SUNLIBS		= -lsuntool -lsunwindow -lpixrect
SUN_SPECIFIER	= sunview 
#endif

#
#       local libraries  (All of these are in $(LIBPATH).)
#
CTRANS_LIBS_A   = libcgm.a libncarg_ras.a

#
#       local relocatable objects  (All of these are in $(ROBJPATH))
#
CTRANS_ROBJS  = libictrans.o libctrans.o

GENLIBS 	= $(HDFLIB) -lm


CTRANS_LIBS_B   = $(X11LIBS) $(SUNLIBS) $(GENLIBS)

DEVICE_SPECIFIERS = \
	$(RASTER_SPECIFIERS) $(CTXT_SPECIFIER) \
	$(SUN_SPECIFIER) $(X11_SPECIFIER)

InstallTarget($(SCRIPTS),$(INSTALL_BIN),$(BINPATH))
CleanFilesTarget(fcaps gcaps ctlib ncarvversion)

gcaps:	gcaps.csh Makefile
	@sed \
	-e 's+DEVICES+$(DEVICE_SPECIFIERS)+' \
	-e 's+VERSION+$(NGVERSION)+' \
	-e 's+GRAPHCAPDIR+$(GRAPHCAPDIR)+' \
	< gcaps.csh > gcaps

fcaps:	fcaps.csh Makefile
	@sed \
	-e 's+VERSION+$(NGVERSION)+' \
	-e 's+FONTCAPDIR+$(FONTCAPDIR)+' \
	< fcaps.csh > fcaps

ncarvversion:	sedscript
	@sed -f sedscript < version.sed > ncarvversion
	@$(RM) sedscript

sedscript:      Makefile
	@echo 's+VERSION+$(NGVERSION)+' > $@

ctlib:	ctlib.csh Makefile
	@sed \
	-e 's+CTRANS_LIBS_A+$(CTRANS_LIBS_A)+' \
	-e 's+CTRANS_LIBS_B+$(CTRANS_LIBS_B)+' \
	-e 's+CTRANS_ROBJS+$(CTRANS_ROBJS)+' \
	-e 's+LIBDIR+$(LIBDIR)+' \
	-e 's+NCARGDIR+$(NCARGDIR)+' \
	-e 's+ROBJDIR+$(ROBJDIR)+' \
	< ctlib.csh > ctlib

