#ifndef XCOMM
#define XCOMM #
#endif

XCOMM
XCOMM Imakefile for display, animate, montage, and import.
XCOMM
XCOMM Copyright (C) 2000 ImageMagick Studio, a non-profit organization
XCOMM dedicated to making software imaging solutions freely available.
XCOMM
XCOMM Permission is hereby granted, free of charge, to any person obtaining
XCOMM a copy of this software and associated documentation files
XCOMM ("ImageMagick"), to deal in ImageMagick without restriction,
XCOMM including without limitation the rights to use, copy, modify, merge,
XCOMM publish, distribute, sublicense, and/or sell copies of ImageMagick,
XCOMM and to permit persons to whom the ImageMagick is furnished to do so,
XCOMM subject to the following conditions:
XCOMM
XCOMM The above copyright notice and this permission notice shall be
XCOMM included in all copies or substantial portions of ImageMagick.
XCOMM
XCOMM The software is provided "as is", without warranty of any kind,
XCOMM express or implied, including but not limited to the warranties of
XCOMM merchantability, fitness for a particular purpose and
XCOMM noninfringement.  In no event shall ImageMagick Studio be liable for
XCOMM any claim, damages or other liability, whether in an action of
XCOMM contract, tort or otherwise, arising from, out of or in connection
XCOMM with ImageMagick or the use or other dealings in ImageMagick.
XCOMM
XCOMM Except as contained in this notice, the name of the ImageMagick
XCOMM Studio shall not be used in advertising or otherwise to promote the
XCOMM sale, use or other dealings in ImageMagick without prior written
XCOMM authorization from the ImageMagick Studio.
XCOMM

#include "../Magick.tmpl"

#ifdef SGIArchitecture
OTHERLIBS= $(REQUIRED_LIBRARIES)
#else
#if (ProjectX > 5)
#ifdef SunArchitecture
SHLIBLDFLAGS= -G
PICFLAGS= -K PIC
#endif
REQUIREDLIBS= $(REQUIRED_LIBRARIES) $(LDPRELIB) -lXext -lX11
#endif
#endif

#ifdef AlphaArchitecture
SO_REQLIBS= -lX11 -lc
#endif

HEADERS = magick.h api.h classify.h image.h quantize.h gems.h \
	blob.h compress.h utility.h cache.h monitor.h error.h memory.h \
	delegates.h timer.h version.h xwindows.h config.h

SRCS = PreRvIcccm.c animate.c annotate.c avs.c blob.c bmp.c cache.c cache_io.c \
  cmyk.c colors.c compress.c dcm.c decorate.c delegates.c display.c dps.c \
  draw.c effects.c enhance.c ept.c error.c fax.c fits.c fpx.c gems.c gif.c \
  gradation.c gray.c hdf.c histogram.c html.c icc.c icon.c image.c \
  iptc.c jbig.c jpeg.c label.c logo.c magick.c map.c matte.c memory.c \
  miff.c monitor.c mono.c montage.c mtv.c null.c pcd.c pcl.c pcx.c \
  pdf.c pict.c pix.c plasma.c png.c pnm.c preview.c ps.c ps2.c ps3.c \
  psd.c pwp.c quantize.c rgb.c rla.c rle.c segment.c sct.c sfw.c sgi.c shear.c \
  signature.c stegano.c sun.c tga.c tiff.c tile.c tim.c timer.c transform.c \
  ttf.c txt.c uil.c utility.c uyvy.c vicar.c vid.c viff.c wbmp.c widget.c x.c \
  xbm.c xc.c xpm.c xwd.c xwindows.c yuv.c zoom.c 8bim.c

OBJS = PreRvIcccm.o animate.o annotate.o avs.o blob.o bmp.o cache.o cache_io.o \
  cmyk.o colors.o compress.o dcm.o decorate.o delegates.o display.o dps.o \
  draw.o effects.o enhance.o ept.o error.o fax.o fits.o fpx.o gems.o gif.o \
  gradation.o gray.o hdf.o histogram.o html.o icc.o icon.o image.o \
  iptc.o jbig.o jpeg.o label.o logo.o magick.o map.o matte.o memory.o \
  miff.o monitor.o mono.o montage.o mtv.o null.o pcd.o pcl.o pcx.o \
  pdf.o pict.o pix.o plasma.o png.o pnm.o preview.o ps.o ps2.o ps3.o \
  psd.o pwp.o quantize.o rgb.o rla.o rle.o segment.o sct.o sfw.o sgi.o shear.o \
  signature.o stegano.o sun.o tga.o tiff.o tile.o tim.o timer.o transform.o \
  ttf.o txt.o uil.o utility.o uyvy.o vicar.o vid.o viff.o wbmp.o widget.o x.o \
  xbm.o xc.o xpm.o xwd.o xwindows.o yuv.o zoom.o 8bim.o

#ifdef HPArchitecture

ARLIB = libMagick.a
SHLIB = libMagick.sl

# Add -Dhpux9 if compiling under HP-UX 9.X
EXTRA_DEFINES = +z # -Dhpux9

all: install-arlib install-shlib

$(ARLIB): $(OBJS)
	-$(RM) $(ARLIB)
	-ar rc $(ARLIB) $(OBJS)

$(SHLIB): $(OBJS)
	-ld -b -s -o $(SHLIB) $(OBJS)


install-arlib: $(ARLIB)
	-mkdir -p -m 755 $(MAGICKDIR)
	-cp $(ARLIB) $(MAGICKDIR)
	-chmod a+r $(MAGICKDIR) $(MAGICKDIR)/$(ARLIB)

install-shlib: $(SHLIB)
	-mkdir -p -m 755 $(MAGICKDIR)
	-cp $(SHLIB) $(MAGICKDIR)
	-chmod a+rx $(MAGICKDIR) $(MAGICKDIR)/$(SHLIB)

install:: all

install:: all

install:: all

install:: all

install:: all

clean::
	-$(RM) $(ARLIB) $(SHLIB)

#else

#ifndef DoNormalLib
#define DoNormalLib  YES
#endif

#define IncSubdir magick

#ifndef SGIArchitecture
SOMAGICKLIBREV= 5.0.11
#endif

#if (ProjectX < 5)
  STD_DEFINES = LibraryDefines
  CDEBUGFLAGS = LibraryCDebugFlags
#if DoSharedLib
  SharedLibraryObjectRule()
  NormalSharedLibraryTarget(Magick,$(SOMAGICKLIBREV),$(OBJS))
  InstallSharedLibrary(Magick,$(SOMAGICKLIBREV),$(LOCALLIB))
#else
  NormalLibraryObjectRule()
  NormalLibraryTarget(Magick,$(OBJS))
  InstallLibrary(Magick,$(LOCALLIB))
#endif
#endif

#if (ProjectX == 5)
#define LibName Magick
#define SoRev SOMAGICKLIBREV
#include <Library.tmpl>
  LibraryObjectRule()
#if DoSharedLib
  NormalLibraryTarget(Magick,$(OBJS))
  InstallLibrary(Magick,$(LOCALLIB))
  SharedLibraryTarget(Magick,$(SOMAGICKLIBREV),$(OBJS),shared,..)
  InstallSharedLibrary(Magick,$(SOMAGICKLIBREV),$(LOCALLIB))
#else
  NormalLibraryTarget(Magick,$(OBJS))
  InstallLibrary(Magick,$(LOCALLIB))
#endif
#endif

#if (ProjectX > 5)
#define SoRev SOMAGICKLIBREV
#include <Library.tmpl>
  LibraryObjectRule()
#if DoSharedLib
  NormalLibraryTarget(Magick,$(OBJS))
  InstallLibrary(Magick,$(LOCALLIB))
  SharedLibraryTarget(Magick,$(SOMAGICKLIBREV),$(OBJS),.,.)
  InstallSharedLibrary(Magick,$(SOMAGICKLIBREV),$(LOCALLIB))
#else
  UnsharedLibraryTarget(Magick,$(OBJS),.,.)
  InstallLibrary(Magick,$(LOCALLIB))
#endif
#endif

#endif /* HPArchitecture */

InstallMultiple($(HEADERS),$(LOCALINC)/magick)
DependTarget()
