# Description file for rle conversion programs. ($rcnv)

# These lines are processed by an awk script to include or
# remove specific programs
# In an Alpha_1 system, they would be automatically inserted by the configure
# action.
#
#begin defs

##define CUBICOMP	Cubicomp conversions.
#define MACPAINT	Macpaint conversions.
##define SUNRASTER	For Sun raster conversions.
#define ABEKASA60	Abekas A60 conversions.
##define ABEKASA62	Abekas A62 conversions.
#define POSTSCRIPT	Postscript conversions.
##define TARGA		Targa format conversions.
#define WASATCH		Wasatch Paintbox conversions.
#define GRAYFILES	Grayscale conversions.

##define SUNCC		Sun Microsystems.
##define APOLLOCC	Apollo computer.
##define IRISCC		Silicon Graphics Iris.
##define BOBCATCC	HP bobcat.

#end defs

#
# DEST is where to install the tools 
# RI is the include directory for RLE files
# RL is the library directory (for librle.a)

DEST = ../../bin
RI = ../include
RL = ../lib

LIBES = $(RL)/librle.a
CFLAGS = -O $(DFLAGS) $(IFLAGS) $(MachFLAGS)
IFLAGS = -I. -I$(RI)
# System V make pays attention to the SHELL environment variable. Override it.
SHELL = /bin/sh

# Executables.  The .out will be stripped off in the install action.
#ifadd	CUBICOMP	PGMS		cubitorle.out
#ifadd	MACPAINT	PGMS		painttorle.out
#ifadd	MACPAINT	PGMS		rletopaint.out
#ifadd  SUNRASTER	PGMS		rastorle.out
#ifadd	ABEKASA60	PGMS		rletoabA60.out
#ifadd	ABEKASA62	DIRS		rletoabA62
#ifadd	POSTSCRIPT	PGMS		rletops.out
#ifadd	TARGA		PGMS		targatorle.out
#ifadd  WASATCH		PGMS		wasatchrle.out
#ifadd	GRAYFILES	PGMS		rletogray.out
#ifadd	GRAYFILES	PGMS		graytorle.out

#emit PGMS
PGMS =  painttorle.out rletopaint.out rletoabA60.out rletops.out wasatchrle.out rletogray.out graytorle.out

#emit DIRS
DIRS = 

# ALLDIRS is all subdirectories, regardless of whether they are active
ALLDIRS = rletoabA62

# Machine dependent compiler flags
#ifadd	SUNCC		MachFLAGS	-f68881
#emit MachFLAGS
MachFLAGS = 

# Default is what is to be made if nothing is specified.
default: $(PGMS) subdirs

subdirs:
	@ echo Make subdirs
	@-if [ 'x$(DIRS)' != x ] ; then eval \
		'for dir in $(DIRS) ; do\
			(cd $$dir ; make $(MFLAGS) ) ; \
		done' ; \
	  else \
		true ; \
	  fi

# Everything depends on the svfb globals and libraries.
$(PGMS): $(RI)/svfb_global.h $(LIBES)

# Programs that need specific make rules (presumably all of them)

#ifdef CUBICOMP
# cubitorle - Cubicomp to RLE.
# Will build with the default rule.
#endif CUBICOMP

#ifdef MACPAINT
# painttorle - MacPaint to RLE.
# rletopaint - RLE to MacPaint.
# Will build with the default rule.
#endif MACPAINT

#ifdef SUNRASTER
# rastorle - Sun raster to RLE.
#@SUNTOOLLIBS = -lsuntool -lsunwindow -lpixrect
#@rastorle.out:
#@	$(CC) $(CFLAGS) $< $(LIBES) $(SUNTOOLLIBS) -lm -o $*.new
#@	mv $*.new $@
#endif

#ifdef ABEKASA60
# rletoabA60 - RLE to Abekas A60.
# Will build with the default rule.
#endif ABEKASA60

#ifdef POSTSCRIPT
# rletops - RLE to postscript.
# Will build with the default rule.
#endif POSTSCRIPT

#ifdef TARGA
# targatorle - AT&T Targa to RLE
# Will build with the default rule.
#endif TARGA

#ifdef WASATCH
# wasatchrle - Wasatch Paintbox to RLE.
# Will build with the default rule.
#endif WASATCH

#ifdef GRAYFILES
# graytorle - Combine gray scale images into RLE file.
# rletogray - Split RLE file into gray scale images.
# Will build with the default rule.
#endif GRAYFILES

# Incremental install, copies everything ("$?") since last install to DEST dir.
install: install-pgm install-subdirs

install-pgm: $(PGMS)
	-for pgm in $?; do cp $$pgm $(DEST)/`basename $$pgm .out`; done
	touch install-pgm

install-subdirs: subdirs
	@ echo Install on subdirs
	@-if [ 'x$(DIRS)' != x ] ; then eval \
		'for dir in $(DIRS) ; do\
			(cd $$dir ; make $(MFLAGS) install) ; \
		done' ; \
	  else \
		true ; \
	  fi

# Reconstruct makefile for current set of defines
# Due to the way makefile dependencies work, we can't do this here
# (I want makedefs to depend on makefile, so makefile can't depend on
# makedefs)  Therefore, 'make depend' will rebuild the makefile (or
# 'make makedefs'
makefile: 

makedefs: makefile
	awk -f makedef.awk makefile >makefile.tmp
	mv makefile.tmp makefile
	touch makedefs

# No automatic dependency generation (but rebuild makefile if necessary)
depend: makedefs
	touch depend

# Clean up binaries.
clean:
	rm -f $(PGMS) install
	rm -f *.o *.out *.new
	-for dir in $(ALLDIRS); do \
		if [ -d $$dir ] ; then \
			(cd $$dir; make $(MFLAGS) clean); \
		else \
			true; \
		fi; \
	done

# Default rule for making a program from its .c file.
# The mv will not be done if there is an error, so a broken program
# will not be left around.
.SUFFIXES:
.SUFFIXES: .out .c
.c.out:
	$(CC) $(CFLAGS) $< $(LIBES) -lm -o $*.new
	mv $*.new $@
# Dependency lines.  Make sure to #ifdef them.
# DO NOT DELETE THIS LINE

#ifdef CUBICOMP
#@cubitorle.o: ${RI}/svfb_global.h
#endif CUBICOMP
#ifdef MACPAINT
painttorle.o: ${RI}/svfb_global.h
rletopaint.o: ${RI}/svfb_global.h
#endif MACPAINT
#ifdef SUNRASTER
#@rastorle.o: ${RI}/svfb_global.h
#endif SUNRASTER
#ifdef ABEKASA60
rletoabA60.o: ${RI}/svfb_global.h
#endif ABEKASA60
#ifdef POSTSCRIPT
rletops.o: ${RI}/svfb_global.h
#endif POSTSCRIPT
#ifdef TARGA
#@targatorle.o: ${RI}/svfb_global.h
#endif TARGA
#ifdef WASATCH
wasatchrle.o: ${RI}/svfb_global.h
#endif WASATCH
#ifdef GRAYFILES
graytorle.o: ${RI}/svfb_global.h
rletogray.o: ${RI}/svfb_global.h
#endif GRAYFILES
