#
#  Generic makefile for convert, mogrify, and combine for computers that
#  do not have xmkmf.
#
#  Copyright 1992 E. I. du Pont de Nemours & Company
#
#  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 of E. I. du Pont de Nemours
#  & Company not be used in advertising or publicity pertaining to
#  distribution of the software without specific, written prior
#  permission.  E. I. du Pont de Nemours & Company makes no representations
#  about the suitability of this software for any purpose.  It is provided
#  "as is" without express or implied warranty.
#
#  E. I. du Pont de Nemours & Company disclaims all warranties with regard
#  to this software, including all implied warranties of merchantability
#  and fitness, in no event shall E. I. du Pont de Nemours & Company be
#  liable for any special, indirect or consequential damages or any
#  damages whatsoever resulting from loss of use, data or profits, whether
#  in an action of contract, negligence or other tortious action, arising
#  out of or in connection with the use or performance of this software.
#

#
# Uncomment the following lines if you have the JPEG or TIFF libraries.
# See README for more details.
#
#JPEG= -DAlienJPEG
#JPEG_LIBRARIES= -L../jpeg -ljpeg
#JPEG_INCLUDES= -I../jpeg
#TIFF= -DAlienTIFF
#TIFF_LIBRARIES= -L../tiff/libtiff -ltiff
#TIFF_INCLUDES= -I../tiff/libtiff

XLIB= -L/usr/lib/X11R4 -lX11

CC= cc -O -I/usr/include/X11R4
DESTDIR= /usr/local/bin
INSTALL = install -c
RM= /bin/rm -f

DEFINES= -I.. $(JPEG) $(JPEG_INCLUDES) $(TIFF) $(TIFF_INCLUDES)
SYS_LIBRARIES= $(XLIB) $(JPEG_LIBRARIES) $(TIFF_LIBRARIES) -lm

MagickObjects= ../X.o ../image.o ../shear.o ../quantize.o ../colors.o \
  ../signature.o ../decode.o ../encode.o ../compress.o ../utility.o \
  ../PreRvIcccm.o

CombineObjects= combine.o $(MagickObjects)
ConvertObjects= convert.o $(MagickObjects)
MogrifyObjects= mogrify.o $(MagickObjects)
SegmentObjects= segment.o $(MagickObjects)

PROGRAMS= convert mogrify combine segment

CFLAGS= $(DEFINES)

all: $(PROGRAMS)

convert: $(ConvertObjects)
	$(RM) $@
	$(CC) -o $@ $(ConvertObjects) $(SYS_LIBRARIES)

clean::
	$(RM) convert

install:: convert
	$(INSTALL) convert $(DESTDIR)

mogrify: $(MogrifyObjects)
	$(RM) $@
	$(CC) -o $@ $(MogrifyObjects) $(SYS_LIBRARIES)

clean::
	$(RM) mogrify

install:: mogrify
	$(INSTALL) mogrify $(DESTDIR)

combine: $(CombineObjects)
	$(RM) $@
	$(CC) -o $@ $(CombineObjects) $(SYS_LIBRARIES)

clean::
	$(RM) combine

install:: combine
	$(INSTALL) combine $(DESTDIR)

segment: $(SegmentObjects)
	$(RM) $@
	$(CC) -o $@ $(SegmentObjects) $(SYS_LIBRARIES)

clean::
	$(RM) segment

install:: segment
	$(INSTALL) segment $(DESTDIR)

clean::
	$(RM) *.ln *.bak *.o core errs ,* *~ *.a .emacs_* make.log MakeOut
