#                        Copyright (c) 1987 Bellcore
#                            All Rights Reserved
#       Permission is granted to copy or use this program, EXCEPT that it
#       may not be sold for profit, the copyright notice must be reproduced
#       on copies, and credit should be given to Bellcore where it is due.
#       BELLCORE MAKES NO WARRANTY AND ACCEPTS NO LIABILITY FOR THIS PROGRAM.

#	$Header: Makefile,v 4.14 88/08/24 16:00:08 bianchi Exp $
#	$Source: /tmp/mgrsrc/demo/icon/RCS/Makefile,v $

# icon stuff
#
#	walk,mclock,cycle  courtesy  S. D. Hawley
#
INCL = ../../lib

#	need pixrect if mgr is pixrect (or color) version
#	zoom and snap don't work in color, see NOCOLOR= below


LIB = $(INCL)/libmgr.a
MGR = ../../src
BITDIR=../../lib
BITLIB = $(BITDIR)/blitlib.a $(OTHERLIB)
CFLAGS= -I$(INCL) -I$(BITDIR)

CFILES= browse.c cycle.c cut.c iconmail.c iconmsgs.c icontoc.c mclock.c snap.c \
	walk.c window_print.c zoom.c set_colormap.c overlay.c invert_colormap.c
HFILES = mail_icons.h msgs_icons.h
OTHER = Makefile README
START=.
CPIO=icon.cpio
INSROOT=/usr/mgr
INSDIR=$(INSROOT)/bin

SMALL= browse cycle cut iconmail iconmsgs mclock walk window_print

#remove NOCOLOR modules for color versions
NOCOLOR=zoom snap
#NOCOLOR=
ALL = $(SMALL) $(NOCOLOR) set_colormap overlay invert_colormap

all:	$(ALL)

small:	$(SMALL)

fast:	$(CFILES)
		cc -c $(CFLAGS) $(CFILES)
		make all

convert_icon:	convert_icon.o $(LIB)
		cc -o convert_icon convert_icon.o $(LIB)

test2:		test2.o $(LIB)
		cc -o test2 test2.o $(LIB)

chess:		chess.o $(LIB)
		cc -o chess chess.o $(LIB)

cut:		cut.o $(LIB)
		cc -o cut cut.o $(LIB)

browse:		browse.o $(LIB)
		cc -o browse browse.o $(LIB)

walk:		walk.o $(LIB)
		cc -o walk walk.o $(LIB)

iconmail.o:	mail_icons.h

iconmail:	iconmail.o $(LIB)
		cc -o iconmail iconmail.o $(LIB)

iconmsgs.o:	msgs_icons.h

iconmsgs:	iconmsgs.o $(LIB)
		cc -o iconmsgs iconmsgs.o $(LIB)

icontoc:	icontoc.o $(LIB) $(MGR)/bitmaphead.o $(MGR)/bitmapread.o
		cc -o icontoc icontoc.o $(LIB) \
			$(MGR)/bitmaphead.o $(MGR)/bitmapread.o $(BITLIB)

snap:		snap.o $(LIB) $(MGR)/bitmaphead.o $(MGR)/bitmapread.o
		cc -o snap snap.o $(LIB) \
			$(MGR)/bitmaphead.o $(MGR)/bitmapread.o $(BITLIB)

overlay:		overlay.o $(LIB)
		cc -o overlay overlay.o $(LIB) $(BITLIB)

zoom:		zoom.o $(LIB) $(MGR)/bitmaphead.o $(MGR)/bitmapread.o
		cc -o zoom zoom.o $(LIB) \
			$(MGR)/bitmaphead.o $(MGR)/bitmapread.o $(BITLIB)

mclock:		mclock.o $(LIB) 
		cc -o mclock mclock.o $(LIB)

cycle:		cycle.o  $(LIB)
		cc -o cycle cycle.o $(LIB)

window_print:	window_print.o  $(LIB)
		cc -o window_print window_print.o $(LIB)

invert_colormap:	invert_colormap.o
		cc -o invert_colormap invert_colormap.o -lpixrect

set_colormap:	set_colormap.o
		cc -o set_colormap set_colormap.o -lpixrect

tj3:		tj3.o  $(LIB)
		cc -o tj3 tj3.o $(LIB)

tj2:		tj2.o  $(LIB)
		cc -o tj2 tj2.o $(LIB)

tj:		tj.o  $(LIB)
		cc -o tj tj.o $(LIB)

flip:		flip.o 
		cc -o flip flip.o

rotate:		rotate.o 
		cc -o rotate rotate.o

tjfilter:	tjfilter.o 
		cc -o tjfilter tjfilter.o

get_header:	get_header.o 
		cc -o get_header get_header.o

cpp_filter:	cpp_filter.o
		cc -o cpp_filter cpp_filter.o

$(ALL):		$(INCL)/term.h

install:	all $(INSDIR)
		cd $(INSDIR);  rm -f $(ALL)
		cp $(ALL) $(INSDIR)

smallinstall:	small $(INSDIR)
		cd $(INSDIR);  rm -f $(SMALL)
		cp $(SMALL) $(INSDIR)

$(INSDIR):
		mkdir $@

clean:	
		rm -f *.o core

clobber:
		rm -f $(ALL)

list:
	@for i in ${CFILES} ${HFILES} ${OTHER}; do \
		echo "${START}/$$i"; \
	done	

cpio:
	make -s list | cpio -ocv > ${CPIO}
