TOPDIR = /home/oliver/data2/users/jin/src/wimsey/ccs-lib
CONFIG = config.sgi
HERE = tools/x11/
CCS_ROOT = /home/oliver/data2/users/jin/src/wimsey/ccs-lib

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

# DRIVERDIRS = Iris NeXT SunView X XView ctool sunanim xanim datacube adage
DRIVERDIRS = SunView X XView ctool sunanim xanim
CONTRIBDIRS = canny cc compress fsun imsor label lbl surrey usl uva verdth
ANSI_PATH = $(TOPDIR)/jpeg
HTDIRS = IRIX4.2
XDIRS = lblx11 xhips
XVDIRS = lblxview

DESTROOT = $(TOPDIR)/sun4
DESTDIR = $(DESTROOT)/bin
# LIBDIR = /usr/local/lib
LIBDIR = $(DESTROOT)/lib
# INCLUDE_DIR = /usr/include
INCLUDE_DIR = $(DESTROOT)/include
# MANDIR = /usr/man/mann
MANDIR = $(DESTROOT)/man/mann
MANEXT = n
LIBMANDIR = /usr/man/mann
LIBMANEXT = n
TMPDIR = /tmp

FLOAT = 
TARGET_ARCH = 
FASTCOPY = 

CPPFLAGS = -I$(INCLUDE_DIR)
LIBRARY2 = -l$(LIB)
HLIBNAME = lib$(HLIB).a
OTHERLIBS = -lm
LDFLAGS = -L$(LIBDIR)
CFLAGS = -O

ORIG = ULORIG
BITORDER = MSBFVERSION

MANPRINT = psroff -Pps -man
MEPRINT = psroff -Pps -me
TBL = tbl
EQN = eqn
RANLIB = ls
LORDER = lorder
TSORT = tsort
RM = rm
XVIEWHOME = /usr/openwin
LIBXVIEW = -lxview -lolgx -lX11

# Stuff you like to have removed from directories to "make clean"
OTHERJUNK = core *~ \#* *BAK tmpansi.c
################ 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 makefile.src.

DIRS =
PGMS =

SHELL = /bin/sh

COMPILEc = $(CC) -D$(ORIG) -D$(BITORDER) $(CFLAGS) \
	$(CPPFLAGS) $(TARGET_ARCH) $(FASTCOPY) $(FLOAT) -c
LINKc = $(CC) -D$(ORIG) -D$(BITORDER) $(CFLAGS) \
	$(CPPFLAGS) $(FLOAT) $(TARGET_ARCH) $(FASTCOPY) -o
LIBRARIES = $(LDFLAGS) $(LIBRARY) $(OTHERLIBS)

.SUFFIXES:	.out

.c.o:
	$(COMPILEc) $<

.c.out:
	$(LINKc) $* $< $(LIBRARIES)
	strip $*
	mv $* $(DESTDIR)
	@touch $@
################ End of makefile.hdr ################
#
# makefile for directory user-contributed/lbl/x11
#

# Subdirectories that get made

DIRS = lib tuner

# default action just makes src dirs

all: install

clean clean-all install pristine man doc: doit
	@for d in $(DIRS) ; do \
		( cd $$d ; echo make $@ on $(HERE)$$d ; make $(MFLAGS) $@ ) ; \
	done

doit:
################ 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 makefile.src.

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

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

doit:


# Clean up installed stuff and binaries
# pristine-pgm target invoked by pristine target in dirs that make programs
# 
pristine-pgm: clean-pgm
	@-if test 'x$(PGMS)' != x ; then eval \
		'for pgm in $(PGMS); do \
			dpgm=`basename $$pgm .out`; \
			echo rm -f $(DESTDIR)/$$dpgm ; \
			rm -f $(DESTDIR)/$$dpgm ; \
		done' ; \
	else \
	    true ; \
	fi

# Clean up binaries on program directories.
clean-pgm:
	-rm -f $(PGMS) *.out install* *.o $(OTHERJUNK) man-pgm libman-pgm

clean_all:
	-rm -f $(PGMS) *.out install* *.o $(OTHERJUNK) *.a *-pgm Makefile

# Install program manual pages
man-pgm: $(MANPAGES)
	@-if test ! -r $(MANDIR) ; then mkdir $(MANDIR) ; fi
	chmod u+w $(MANPAGES)
	for i in $(MANPAGES) ; \
	do \
		cp $$i $(MANDIR)/`basename $$i .n`.$(MANEXT) ; \
	done
	chmod u-w $(MANPAGES)
	touch man-pgm

# Install library manual pages
libman-pgm: $(MANPAGES)
	@-if test ! -r $(MANDIR) ; then mkdir $(MANDIR) ; fi
	chmod u+w $(MANPAGES)
	for i in $(MANPAGES) ; \
	do \
		cp $$i $(LIBMANDIR)/`basename $$i .n`.$(LIBMANEXT) ; \
	done
	chmod u-w $(MANPAGES)
	touch libman-pgm

# Uninstall program manual pages
pristineman-pgm:
	for i in $(MANPAGES) ; \
	do \
		rm -f $(MANDIR)/`basename $$i .n`.$(MANEXT) ; \
	done
	rm -f man-pgm

# Uninstall library manual pages
pristinelibman-pgm:
	for i in $(MANPAGES) ; \
	do \
		rm -f $(LIBMANDIR)/`basename $$i .n`.$(LIBMANEXT) ; \
	done
	rm -f libman-pgm

makefile:: makefile.src
	${DEPTH}Configure "${CONFIG}" "${DEPTH}" "${HERE}" "${MFLAGS}"

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