#
# Makefile for LUG
#
# (c) 1992, Raul Rivero
#
# Makefile for the LUG Library. 
#
#
#    ********************************************************
#    *                                                      *
#    *  Check include/lugconfig.h for internal defines !!!  *
#    *                                                      *
#    ********************************************************
#

SHELL = /bin/sh

#
# Directories of LUG package.
#
DIRS = convert lib show utils

#
# Uncomment next line if you are using other compiler (e.g. gcc)
#
CC = cc

#
# Compiler options ( only C-O-M-P-I-L-E-R, not LUG options ).
#
COPTS = +O3  +DA1.1 -Aa -D_INCLUDE_POSIX_SOURCE -D_INCLUDE_XOPEN_SOURCE

#
# Location of LUG header files.
#
LUGINC = -I../include 

#
# If you have intalled the Utah Raster Toolkit library define
# next variables, example:
#
#       URTINC = -I/remote/carreras/usr/people/nuevos/correo/urt/include
#       URTDEF = -DiRLE
#
# , or leave undefined if you don't have it.
#
URTINC = -I/usr/local/include/rle 
URTDEF = -DiRLE 

#
# If you have intalled the Sam Leffler's TIFF library define
# next variables, example:
#
#       TIFFINC = -I/remote/carreras/usr/people/nuevos/correo/libtiff/include
#       TIFFDEF = -DiTIFF
#
# , or leave undefined if you don't have it.
#
TIFFINC = -I/usr/local/include/tiff 
TIFFDEF = -DiTIFF 

#
# If you have intalled the JPEG library define
# next variables, example:
#
#       JPEGINC = -I/remote/carreras/usr/people/nuevos/correo/jpeg/src
#       JPEGDEF = -DiJPEG
#
# , or leave undefined if you don't have it.
#
JPEGINC = -I/usr/local/include/jpeg 
JPEGDEF = -DiJPEG 

#
# If your machine is a SGI computer define next variables, ... ok,
# ok, an example:
#
#       SGIINC = -I/usr/include/gl
#       SGIDEF = -DiSGI
#
# , else leave undefined.
#
SGIINC =
SGIDEF =

#
# Define what kind of viwer you'll support. Options are:
#
#       Machine                  Add
#       -------                  ---
#       hp9000                  -DiHP
#       sgi/aix                 -DiGL
#       pc                      -DiPC
#       x11                     -DiX11
#       vfr ( sgi )             -DiVFR   <-- SGI's Video Framer needs hardware
#       linux			-DiLINUX
#
# Probably, also you'll need give a path to the headers.
#
# And example: we have a SGI with X11 and a Video FRamer, so
# we define...
#
#       VIEWDEF = -DiGL -DiVFR
#       VIEWINC = -I/usr/include/gl -I/usr/video/vfr/src/inc
#
VIEWDEF = -DiX11
VIEWINC = -I/usr/local/X11R5/include

#
# Final includes ( don't touch this ! ).
#
INCS = $(LUGINC) $(URTINC) $(TIFFINC) $(JPEGINC) $(SGIINC) $(VIEWINC) 
DEFS =           $(URTDEF) $(TIFFDEF) $(JPEGDEF) $(SGIDEF) $(VIEWDEF) 

#
# Library objects.
#
OBJS =  convert/cnv.o           convert/encodgif.o      convert/gif.o   \
        convert/heightfield.o   convert/jpeg.o          convert/pbm.o   \
        convert/pcx.o           convert/pix.o           convert/ps.o    \
        convert/raw.o           convert/rgb.o           convert/rla.o   \
        convert/rle.o           convert/sgi.o           convert/tga.o   \
        convert/tiff.o          lib/bitmap.o            lib/error.o     \
        lib/general.o           lib/in_out.o            lib/memory.o    \
        show/hp.o               show/pc.o               show/sgi.o      \
        show/vfr.o              show/x11.o              utils/blur.o    \
        utils/change.o          utils/chroma.o          utils/cut.o     \
        utils/dither.o          utils/flip.o            utils/gamma.o   \
        utils/histoequal.o      utils/hsl.o             utils/mask.o    \
        utils/medianfilter.o    utils/mirror.o          utils/paste.o   \
        utils/quantize.o        utils/rotate.o          utils/sharpen.o \
        utils/slowzoom.o        utils/solid.o           utils/to24.o    \
        utils/tobw.o            utils/tohalftone.o      utils/toinverse.o \
        utils/zoom.o 		utils/convolve.o	show/linux.o
 
all:	        liblug.a	


clean:;		@rm -f $(OBJS)

install:        liblug.a
		mv liblug.a /usr/local/lib

archive:;	( cd .. ; tar cvf lug-1.0.tar lug ; compress lug-1.0.tar )

liblug.a:;	@for i in $(DIRS); do \
			( cd $$i ; make "INCS=$(INCS)" "DEFS=$(DEFS)" "CC=$(CC)" "COPTS=$(COPTS)" ) ; \
		done;
		ar scr liblug.a $(OBJS)
#
# Uncomment the nest line if you have the ranlib command.
#
###     ranlib liblug.a

