#%#### makefile AUTOMATICALLY GENERATED ######
#%############### DO NOT EDIT ################
#%### EDIT makefile.src AND make config ######
DEPTH = ../
CONFIG = ../config/linux
HERE = lib/
# Configuration file for the URT raster toolkit package.  Modify all 
# entries in this file.

# This file should be the only thing you have to edit to configure the
# toolkit for a new system.  If you are adding capabilities, please
# keep this in mind and be sure to make those capabilities configurable
# from this file.

# The file "makefile.hdr" contains code common to all makefiles.  It
# should not be necessary to edit that file.

# The following define the available "hardware" display configuration.
# Remove one # sign to define a symbol (i.e., leaving #define at the
# beginning of the line.)

# Displays
##define AMIGA		Amiga computer display.
##define APOLLO         Apollo computer display.
##define BOBCAT         HP "bobcat" 9000 series (with Starbase).
##define CX3D           Chromatics CX3D system.
##define FB             BRL extended frame buffer library.
##define GETICR		Display for NCSA telnet.  Requires PBMPLUS tools.
##define GRINNELL	Grinnell GMR27 frame buffer.
##define HPQCR		Matrix QCR-Z attached to HP series 300.
##define IRIS           Silicon Graphics Iris 2000/3000.
##define IRIS4D         Silicon Graphics Iris/4D.
##define NEXT		NeXT computer display.
##define ORION		High-Level Hardware Orion display.
##define SUNTOOLS       For Suns running SunTools.
##define TAAC1		Suns with TAAC-1 board.
##define X10		X10 Window system.
#define X11            X11 Window system.

# Conversion programs
#define ABEKASA60	Abekas A60 conversions.
#define ABEKASA62	Abekas A62 conversions.
#define ALIAS		Alias conversions.
##define CGM		RLE to CGM conversion.
#define CUBICOMP	Cubicomp conversions.
#define GIF		GIF image conversions.
#define GRAYFILES	Grayscale conversions.
##define SGICONV	SGI Image conversions.
#define MACPAINT	Macpaint conversions.
#define PBMPLUS		PBMPLUS conversions.
#define POSTSCRIPT	Postscript conversions.
##define SUNRASTER	For Sun raster conversions.
#define TARGA		Targa format conversions.
##define TIFF		TIFF image conversions.
##define TIFF2p4		Define if libtiff is version 2.4 or greater
#define VICAR		VICAR image conversions.
#define WASATCH		Wasatch Paintbox conversions.
#define WAVEFRONT	Wavefront RLA file conversions.

# The dvirle program requires the Maryland MC-TeX library.  See the
# README file in the cnv/tex subdirectory.
##define DVIRLE		Compile dvirle program

# Control C compilation flags.  Define according to your compiler.

##define APOLLOCC	Apollo computer.
##define CONVEXCC	Convex C 4.0 or greater
##define CRAY2CC		Cray-2 running UNICOS.
#define GCC		Gcc compiler.
##define HPUX300CC	HP 9000/300 running HP-UX.
##define HPUX800CC	HP 9000/800 running HP-UX.
##define IBMR6000CC	IBM RS6000.
##define IRIS4DCC	Silicon Graphics Iris 4D.
##define IRISCC		Silicon Graphics Iris 2400/3000.
##define SUNCC		Sun 3 computers.
##define 386IXCC		SVr3 386/ix 2.2

# You can put any system dependent flags here.
ExtraCFLAGS = -O6 -Djump

# System specific or configuration parameters.  Define according to your
# environment and desires.

##define ABEKAS_PAL	Convert to PAL format in Abekas A60 tool.
##define ALL_MAN	Print/install all man pages.
##define CONST_DECL	If your compiler understands 'const' (ANSI)
##define FILE_NAME_14_CHARS	If filenames are limited to 14 characters.
##define NEED_BSTRING	Your libc does not have bcopy or bzero (Sys V probably)
##define NEED_GETOPT	Your libc does not have the getopt function (BSD)
##define NEED_RENAME	Your libc does not have the rename function (Sys V)
##define NEED_SETLINEBUF	Your stdio does not have setlinebuf (Sys V)
##define NO_MAKE_MAKEFILE	If you don't want a "makefile" action.
##define NO_OPEN_PIPES	If file "names" "|..." and "*.Z" are not special.
##define NO_RANLIB	You don't have the ranlib program (Sys V)
##define NO_ITIMER	You don't have setitimer (e.g., Cray 2).
##define NO_TOOLS	Don't build tool directory.
##define STDIO_NEEDS_BINARY	Your fopen() needs "b" specified for binary io
##define USE_TIME_H	You need to include time.h for time_t (Sys V)
##define SYS_V_SETPGRP	Your system has the SysV setpgrp() call.
##define USE_L_FLAG	Use -Llibdir -lrle instead of libdir/liblre.a.
##define USE_PROTOTYPES	Declare library functions with ANSI-C prototypes.
##define USE_RANDOM	Your libc has the BSD random() function.
##define USE_STDARG	Use 'stdarg' instead of 'varargs' (ANSI).
##define USE_STDLIB_H	You have "stdlib.h".
##define USE_UNISTD_H	You have "unistd.h".
##define USE_STRING_H	You have "string.h", not "strings.h"
##define VOID_STAR	Your C compiler understands the 'void *' declaration.
##define USE_XLIBINT_H	You have the include file <X11/Xlibint.h>.

# DEST is where all programs will be put.  Can be overridden for specific
# directories below.
# RI is where the include files live.  You probably shouldn't change this.
# RL is where the tool directories find the RLE library.  You can change
# this, but see the README instructions about making the toolkit in this
# case.

# Path names not starting with a / are relative to this directory.
# Path names starting with a / are absolute.

#defpath DEST	bin
#defpath RI	include
#defpath RL	lib

# Note! LIB_DEST, INC_DEST, and MAN_DEST must be defined for the 
# library, include files, or manual pages, respectively, to be
# installed anywhere.

##defpath MAN_DEST /usr/site/man
##defpath LIB_DEST
##defpath GET_DEST
##defpath CNV_DEST
##defpath TOOLS_DEST
##defpath INC_DEST

# Control of formatting.  If your "roff" program needs to be piped to
# something to print, set ROFFPIPE to (e.g.) "| lpr"
ROFF = nroff
ROFFOPT = -man
ROFFPIPE = | lpr

# Stuff you like to have removed from directories to "make clean"
OTHERJUNK = core *~ #*#

# Files needed for the various options above.
#ifdef BOBCAT
#@LIBBOBCAT = -ldd98700 -ldd98710 -ldd98721 -ldd98731 -ldd98736 -ldd300h -lddbyte -lsb1 -lsb2
#endif

#ifdef CGM
# Path to directory where CGM library and include files may be found
# Absolute or relative to URT root
#defpath CGMDIR 
#@INCCGM = -I$(CGMDIR)
#@LIBCGM = $(CGMDIR)/libcgm.a
#endif

#ifdef CX3D
# Where are the include files for the CX3D
#@INCCX3D = /usr/site/include
#@LIBCX3D = -lcx3d
#endif

#ifdef DVIRLE
#define DVIRLE_LIBSUBDIR	Defined if LIBMCTEX is under cnv/tex directory
# The MC-TeX library.
#@LIBMCTEX = lib/lib.a		# Note! relative to cnv/tex directory
# Where to find the MC-TeX include files.
#@INCMCTEX = h			# Note! relative to cnv/tex directory
# where to find the font description file
#@CONFFILE = /usr/local/lib/tex/fontdesc
#endif

#ifdef FB
#@LIBFB = /usr/brl/lib/libfb.a
#endif

#ifdef GRINNELL
# Library containing GMR27 functions.
#@LIBGRINNELL = -lfb
#endif

#ifdef HPQCR
# HP device io library.
#@LIBHPQCR = -ldvio
#endif

#ifdef IRIS
#@LIBIRIS = -Zg
#endif

#ifdef IRIS4D
#@LIBIRIS4D = -lgl_s
#endif

#ifdef PBMPLUS
# PBMDIR should refer to the root of your PBM source tree.
# If relative, it's relative to root of URT source tree.
#defpath PBMDIR

INCPBMPLUS = -I$(PBMDIR) -I$(PBMDIR)/ppm -I$(PBMDIR)/pgm -I$(PBMDIR)/pbm
LIBPBMPLUS = $(PBMDIR)/ppm/libppm.a $(PBMDIR)/pgm/libpgm.a \
		$(PBMDIR)/pbm/libpbm.a 
#endif

#ifdef SUNRASTER|SUNTOOLS|TAAC1
#@LIBSUNTOOLS_COM = -lsuntool -lsunwindow -lpixrect
#endif

#ifdef SUNRASTER
#@LIBSUNRASTER = $(LIBSUNTOOLS_COM)
#endif

#ifdef SUNTOOLS
#@LIBSUNTOOLS = $(LIBSUNTOOLS_COM)
#endif

#ifdef TAAC1
#@LIBTAAC1 = -ltaac1 $(LIBSUNTOOLS_COM)
#endif

#ifdef TIFF
# Location of tiff library and include files.  Relative to URT root directory.
#defpath TIFFDIR
#@INCTIFF = -I$(TIFFDIR)
#@LIBTIFF = $(TIFFDIR)/libtiff.a
#endif

#ifdef X10
#@LIBX10 = -lX
#@INCX10 = 
#endif

#ifdef X11
LIBX11 = -lX11
INCX11 = 
#endif
################ Beginning of makefile.hdr ################
# Stuff that goes at the beginning of all the makefiles, but is not
# configuration parameters should be in this file.  It is included
# after the configuration file, and before the makefile.src.

# Where the C header files live (RI) and where the library lives (RL)

#emit RI
RI = .
#emit RL
RL = .

# Note -- DEST is not emitted here, it is emitted with a #set in the 
# individual makefiles.  This allows each makefile to override DEST with
# a subdirectory-specific value (from, e.g., GET_DEST).

# Reset these here because GNU make exports make variables when
# make recurses.  These should be local.
DIRS =
ALLDIRS =
PGMS =

# Machine dependent libraries
#ifadd CRAY2CC		ExtraLIBS	-lm -lnet
#ifadd IRIS4DCC		ExtraLIBS	-lbsd
#ifadd IRIS4DCC		ExtraLIBS	-lmalloc
#ifadd 386IXCC		ExtraLIBS	-linet
#emit ExtraLIBS
ExtraLIBS = 

#ifdef USE_L_FLAG
#@LIBS = -L$(RL) -lrle $(DIRLIBS) $(ExtraLIBS)
#else
LIBS = $(RL)/librle.a $(DIRLIBS)  ${ExtraLIBS}
#endif

# Machine dependent compiler flags
#ifadd	CONVEXCC	MachFLAGS	-tm c1 -fn
#ifadd	CRAY2CC		MachFLAGS	-h opt
#ifadd	SUNCC		MachFLAGS	-f68881
#ifadd	IRIS4DCC	MachFLAGS	-G 4 -Olimit 600
#ifadd	HPUX300CC	MachFLAGS	-Dhpux -W c,-Nd2000,-Ns4000 -lBSD
#ifadd	HPUX800CC	MachFLAGS	-Dhpux
#ifadd	IBMR6000CC	MachFLAGS	-Dunix
#emit MachFLAGS
MachFLAGS = 

CFLAGS = -O $(DFLAGS) $(DIRFLAGS) $(ExtraCFLAGS) $(IFLAGS) $(MachFLAGS) 
IFLAGS = -I. -I$(RI)

#ifdef GCC
CC=gcc
#endif


# System V make pays attention to the SHELL environment variable. Override it.
SHELL = /bin/sh

################ End of makefile.hdr ################

#quiet off
# Description file for librle library.

#ifdef LIB_DEST
#set DEST LIB_DEST
#@DEST =
#endif

#ifndef NO_RANLIB
RANLIB = ranlib
#endif

# If nothing else is specified, default is to build the library.
default: buildlib

#ifadd	NEED_GETOPT	OPT_OBJS	getopt.o
#emit OPT_OBJS
OPT_OBJS = 

OBJS = 00_DATA.o Runput.o buildmap.o cmd_name.o colorquant.o dither.o \
	float_to_exp.o hilbert.o inv_cmap.o \
	rle_addhist.o rle_cp.o rle_error.o rle_getcom.o \
	rle_getraw.o rle_getrow.o rle_getskip.o rle_global.o \
	rle_hdr.o \
	rle_open_f.o rle_putcom.o rle_putraw.o rle_putrow.o \
	rle_raw_alc.o rle_rawrow.o rle_row_alc.o scanargs.o \
	vaxshort.o \
	$(OPT_OBJS)

LIBNAME = librle.a

# Just rebuild the object files.
objs: $(OBJS)

# Copy the library to the destination directory.
# (Install a second copy on the debug subdirectory, on the theory that it
#  is more useful to have a non-debug version than nothing at all.)
# Do nothing if $(DEST) is empty (or not defined)
install: buildlib
	@sh -c "if test '$(DEST)x' != x ; then \
		echo cp $(LIBNAME) $(DEST)/$(LIBNAME) ; \
		cp $(LIBNAME) $(DEST)/$(LIBNAME) ; \
		if test x$(RANLIB) != x ; then \
			echo ranlib $(DEST)/$(LIBNAME) ; \
			ranlib $(DEST)/$(LIBNAME) ; \
		else \
			true ; \
		fi ; \
		if test -d $(DEST)/debug ; then \
			echo cp $(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
			if test x$(RANLIB) != x ; then \
				cp $(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
				echo ranlib $(DEST)/debug/$(LIBNAME) ; \
			else \
				true ; \
			fi ; \
			ranlib $(DEST)/debug/$(LIBNAME) ; \
		else \
			true ; \
		fi ; \
	else \
		true ; \
	fi"
	touch install

# Rebuild the library from all the .o files.
buildlib: $(OBJS)
	-rm -f $(LIBNAME)
	ar rc $(LIBNAME)
	ar q $(LIBNAME) $(OBJS)
#ifndef NO_RANLIB
	ranlib $(LIBNAME)
#endif
	touch buildlib

# Clean up installed stuff and binaries
pristine: clean
	-@if test $(DEST)X != X ; then \
		echo rm -f $(DEST)/$(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
		rm -f $(DEST)/$(LIBNAME) $(DEST)/debug/$(LIBNAME) ; \
	else \
		echo rm -f $(LIBNAME) ; \
		rm -f $(LIBNAME) ; \
	fi
	-rm -f install

# Get rid of everything which must be recompiled on a different computer.
clean:
	-rm -f *.o
	-@if test x$(DEST) != x ; then \
		echo rm -f $(LIBNAME) ; \
		rm -f $(LIBNAME) ; \
	else \
		true ; \
	fi
	-rm -f *.ln
	-rm -f buildlib lintlib

# Lint actions:
#
# lintall - run lint on all the source files
# lint1 - run line on one source file
# llib-lrle - build human-readable form of lint library
# llib-lrle.ln - build machine readable form of lint library for
# use in linting programs that use the library
# linstall - install the lint library
#
lintall:
	lint $(DFLAGS) $(IFLAGS) $(CFILES)

lint1:
	lint $(DFLAGS) $(IFLAGS) -u $(LINTF) llib-lrle.ln

llib-lrle: $(CFILES)
	-gemacs -tnull -q -l${AEM}/mk-llib.ml -emk-llib llib-lrle ${CFILES}

lintlib llib-lrle.ln: llib-lrle
	/lib/cpp $(IFLAGS) -C -Dlint llib-lrle | > /usr/lib/lint/lint1 -uv > \
		llib-lrle.ln
	touch lintlib

# Install the lint library.
linstall: llib-lrle.ln
	cp llib-lrle.ln llib-lrle /usr/lib/lint

# Make all objects depend on rle_config.h, even if they really don't.
# This forces a recompile whenever a reconfiguration happens.
$(OBJS):${RI}/rle_config.h

# Dependencies on .h files:
# DO NOT DELETE THIS LINE

Runput.o: ${RI}/rle.h ${RI}/rle_code.h ${RI}/rle_put.h
buildmap.o: ${RI}/rle.h
float_to_exp.o: ${RI}/rle.h
rle_addhist.o: ${RI}/rle.h
rle_cp.o: ${RI}/rle.h ${RI}/rle_code.h ${RI}/rle_put.h
rle_getcom.o: ${RI}/rle.h
rle_getraw.o: ${RI}/rle.h ${RI}/rle_raw.h
rle_getrow.o: ${RI}/rle.h ${RI}/rle_code.h
rle_getskip.o: ${RI}/rle.h ${RI}/rle_code.h
rle_global.o: ${RI}/rle.h ${RI}/rle_put.h
rle_putcom.o: ${RI}/rle.h
rle_putraw.o: ${RI}/rle.h ${RI}/rle_put.h ${RI}/rle_raw.h
rle_putrow.o: ${RI}/rle.h ${RI}/rle_put.h
rle_raw_alc.o: ${RI}/rle.h ${RI}/rle_raw.h
rle_rawrow.o: ${RI}/rle.h ${RI}/rle_raw.h
rle_row_alc.o: ${RI}/rle.h

config-subdirs:

################ Beginning of makefile.tlr ################
# Stuff that goes at the end of all the makefiles, but is not
# configuration parameters should be in this file.  It is included
# after the makefile.src.

subdirs:
	@sh -c "if test 'x$(DIRS)' != x ; then eval \
		'set -e ; for dir in $(DIRS) ; do \
			(cd \$$dir ; echo Make ${HERE}\$$dir ; \
			 	make $(MFLAGS) $(DIRMFLAGS) ) ; \
		done' ; \
	  else \
		true ; \
	  fi"

# Install all programs
install-pgm: $(PGMS)
	@sh -c "if test 'x$?' != x ; then eval \
		'for pgm in $? ; do \
			dpgm=\`basename \$$pgm .out\` ; \
			echo cp \$$pgm $(DEST)/\$$dpgm ; \
			cp \$$pgm $(DEST)/\$$dpgm; \
		done' ; \
	else \
	    true ; \
	fi"
	touch install-pgm

# Install all scripts
install-script: $(SCRIPTS)
	@sh -c "if test 'x$?' != x ; then eval \
		'for pgm in $? ; do \
			dpgm=\`basename \$$pgm .sh\` ; \
			echo cp \$$pgm $(DEST)/\$$dpgm ; \
			cp \$$pgm $(DEST)/\$$dpgm; \
			echo chmod a+rx $(DEST)/\$$dpgm ; \
			chmod a+rx $(DEST)/\$$dpgm; \
		done' ; \
	else \
	    true ; \
	fi"
	touch install-pgm

# Install subdirectories
install-subdirs: subdirs
	@sh -c "if test 'x$(DIRS)' != x  ; then eval \
		'for dir in $(DIRS) ; do \
			(cd \$$dir ; echo Install ${HERE}\$$dir ; \
			 make $(MFLAGS) $(DIRMFLAGS) install) ; \
		done' ; \
	  else \
		true ; \
	  fi"

#config reads the configuration file and munches the apropriate make files
config: doit
	${DEPTH}Configure "${CONFIG}" "${DEPTH}" "${HERE}" "${MFLAGS}"

# post-config is for any actions a directory may require following
# configuration or reconfiguration.
post-config: doit

config-subdirs: doit
	@-if test 'x$(ALLDIRS)' != x ; then eval \
	    'for d in $(ALLDIRS) ; do \
		    ( cd $$d ; \
		      echo Configuring ${HERE}$$d ; \
		      ${DEPTH}Configure "${CONFIG}" "${DEPTH}" "${HERE}$$d/" \
				    "${MFLAGS}" ) \
	    done' ; \
	else \
	    true ; \
	fi

doit:


# Clean up installed stuff and binaries
# pristine-pgm target invoked pristine target in dirs that make programs
# pristine target in library directory is different.
# 
pristine-pgm: clean-pgm
	@-if test 'x$(PGMS)' != x ; then eval \
		'for pgm in $(PGMS); do \
			dpgm=`basename $$pgm .out`; \
			echo rm -f $(DEST)/$$dpgm; \
			rm -f $(DEST)/$$dpgm; \
		done' ; \
	else \
	    true ; \
	fi
	@-if test 'x$(SCRIPTS)' != x ; then eval \
		'for pgm in $(SCRIPTS); do \
			dpgm=`basename $$pgm .sh`; \
			echo rm -f $(DEST)/$$dpgm; \
			rm -f $(DEST)/$$dpgm; \
		done' ; \
	else \
	    true ; \
	fi
	@-if test 'x$(ALLDIRS)' != x ; then eval \
	    'for dir in $(ALLDIRS); do \
		if test -d $$dir ; then \
			(cd $$dir; echo Make ${HERE}$$dir pristine ; \
			 make $(MFLAGS) pristine); \
		else \
			true; \
		fi; \
	    done' ; \
	else \
	    true ; \
	fi
	-rm -f install install-pgm

# Clean up binaries on program directories.
clean-pgm:
	-rm -f $(PGMS) install*
	-rm -f *.o *.out *.new
	-rm -f $(OTHERJUNK)
	@-if test 'x$(ALLDIRS)' != x ; then eval \
	    'for dir in $(ALLDIRS); do \
		if test -d $$dir ; then \
			(cd $$dir; echo Clean ${HERE}$$dir ; \
			 make $(MFLAGS) clean); \
		else \
			true; \
		fi; \
	    done' ; \
	else \
	    true ; \
	fi

#ifndef NO_MAKE_MAKEFILE
# Copy config action to here so that GNU make program will work.
makefile:: makefile.src
	${DEPTH}Configure "${CONFIG}" "${DEPTH}" "${HERE}" "${MFLAGS}"
#endif

# Keep people who like to 'make depend' happy.  Allow depend::
# actions in specific makefiles if desired.
depend::

################ End of makefile.tlr ################

.c.o:
	$(CC) -c $(CFLAGS) $(LOCAL_INCLUDES) \
		$(CPPFLAGS) $*.c -o dummy.o
	ld -r -x dummy.o
	mv a.out $*.o
	rm dummy.o
