############################################################################
#
# $Header: /home/werner/ytree/RCS/Makefile,v 1.18 1998/11/11 19:07:30 werner Exp $
#
# Makefile fuer ytree
#
############################################################################

CC          = cc

#
# ADD_CFLAGS: Add -DVI_KEYS if you want vi-cursor-keys
#

ADD_CFLAGS  = -O # -DVI_KEYS

LFLAGS	    = -s
BINDIR      = /usr/bin
MANDIR      = /usr/man/man1
MANEXT      = 1


# Uncomment the lines for your system

###########################
# LINUX with ncurses (testet with 4.1)
###########################
# If color doesn't work, comment out 
# the following line and recompile
COLOR       = -DCOLOR_SUPPORT
#CLOCK	    = -DCLOCK_SUPPORT
CFLAGS      = $(ADD_CFLAGS) $(COLOR) $(CLOCK)
LIBS        = -lncurses

###########################
# LINUX without ncurses
###########################
#CFLAGS     = -DTERMCAP $(ADD_CFLAGS)
#LIBS       = -lcurses -ltermcap

###########################
# FreeBSD (Thanks to Peter Brevik)
###########################
#CFLAGS      = -DCOLOR_SUPPORT -DNCURSES
#LIBS        = -lncurses -lmytinfo -lcompat

###########################
# DOS/Windows with DJGPP
###########################
#CC          = gcc
#CFLAGS      = $(ADD_CFLAGS) -DCOLOR_SUPPORT
#LIBS        = -lpdc -lpanel

###########################
# NeXT (Thanks to fifi)
###########################
#CFLAGS     = -DTERMCAP $(ADD_CFLAGS)
#LIBS       = -lcurses -ltermcap

############################
# UNIX SVR3 (or SCO3.2v4.2)
############################
#CFLAGS     = -DSVR3 $(ADD_CFLAGS)
#LIBS       = -lcurses -lPW # -lc_s

###########################
# Interactive
###########################
#CFLAGS     = -DSVR3 -Disc386 $(ADD_CFLAGS)
#LIBS       = -lcurses -lPW

###########################
# UNIX SVR4
###########################
#CFLAGS     = -DSVR4 $(ADD_CFLAGS)
#LIBS       = -lcurses -lgen

###########################
# OSF1
###########################
#CFLAGS     = -DOSF1 $(ADD_CFLAGS)
#LIBS       = -lcurses

###########################
# HPUX
###########################
#CFLAGS     = -Dhpux $(ADD_CFLAGS)
#LIBS       = -lcurses  -lc -lPW
#CC	    = cc -Ae

###########################
# HPUX-10.x
###########################
#CFLAGS     = -Dhpux $(ADD_CFLAGS)
#LIBS       = -lcur_colr  -lc -lPW
#CC	    = cc -Ae

###########################
# SGI IRIX Rel. 5.2
###########################
#CFLAGS     = -Dsgi $(ADD_CFLAGS)
#LIBS       = -lcurses -lgen

###########################
# Solaris 2
###########################
#CFLAGS     = $(ADD_CFLAGS) -DSVR4
#LIBS       = -lcurses -lc /usr/ucblib/libucb.a

###########################
# SUN
###########################
#CFLAGS     = $(ADD_CFLAGS)
#CC	    = acc -Xa -strconst -sys5
#LIBS       = -lcurses 

###########################
# SUN (gcc)
###########################
#CFLAGS     = $(ADD_CFLAGS)
#CC	    = gcc -I/usr/5include -L/usr/5lib
#LIBS       = -lcurses 

###########################
# IBM RS/6000 (Thanks to jum)
###########################
#CFLAGS     = $(ADD_CFLAGS)
#LIBS       = -lcurses -lPW

###########################
# ULTRIX V4.3
###########################
#CFLAGS     = -Dultrix $(ADD_CFLAGS)
#LIBS       = -lcursesX


##############################################################################


MAIN    = ytree
OBJS	= arc.o archive.o chgrp.o chmod.o chown.o clock.o color.o copy.o    \
	  delete.o dirwin.o disp.o edit.o error.o execute.o filespec.o      \
	  filewin.o freesp.o global.o group.o hex.o history.o init.o lha.o  \
	  login.o main.o match.o mkdir.o mktime.o move.o passwd.o pipe.o    \
	  print.o profile.o quit.o readtree.o rename.o rmdir.o rpm.o sort.o \
	  stat.o system.o tar.o termcap.o util.o view.o zip.o zoo.o

#

$(MAIN):	$(OBJS)
		$(CC) $(LFLAGS) -o $@ $(OBJS) $(LIBS)

install:	$(MAIN)
		cp $(MAIN) $(BINDIR)
		cp ytree.1 $(MANDIR)/$(MAIN).$(MANEXT)
		if ! [ -f $(HOME)/.ytree ]; \
		then \
		  cp ytree.conf $(HOME)/.ytree; \
		fi

clean:
		rm -f core *.o *~ *.orig *.bak

clobber:	clean
		rm -f $(MAIN)

version:
		ci -nytree-165PL0 -f -sRel -m"released as ytree-165PL0" *.c *.h Makefile *.1 \
		COPYING THANKS ytree.conf README ytree-1.65.lsm CHANGES


##################################################

arc.o: config.h ytree.h arc.c
archive.o: config.h ytree.h archive.c
chgrp.o: config.h ytree.h chgrp.c
chmod.o: config.h ytree.h chmod.c
chown.o: config.h ytree.h chown.c
color.o: config.h ytree.h color.c
copy.o: config.h ytree.h copy.c
delete.o: config.h ytree.h delete.c
dirwin.o: config.h ytree.h dirwin.c
disp.o: config.h ytree.h patchlev.h disp.c
edit.o: config.h ytree.h edit.c
error.o: config.h ytree.h error.c
execute.o: config.h ytree.h execute.c
filespec.o: config.h ytree.h filespec.c
filewin.o: config.h ytree.h filewin.c
freesp.o: config.h ytree.h freesp.c
global.o: config.h ytree.h global.c
group.o: config.h ytree.h group.c
hex.o: config.h ytree.h hex.c
history.o: config.h ytree.h history.c
init.o: config.h ytree.h init.c
lha.o: config.h ytree.h lha.c
login.o: config.h ytree.h login.c
main.o: config.h ytree.h main.c
match.o: config.h ytree.h match.c
mkdir.o: config.h ytree.h mkdir.c
mktime.o: config.h ytree.h mktime.c
move.o: config.h ytree.h move.c
passwd.o: config.h ytree.h passwd.c
pipe.o: config.h ytree.h pipe.c
print.o: ytree.h print.c config.h
profile.o: config.h ytree.h profile.c
quit.o: config.h ytree.h quit.c
readtree.o: config.h ytree.h readtree.c
rename.o: config.h ytree.h rename.c
rmdir.o: config.h ytree.h rmdir.c
rpm.o: config.h ytree.h rpm.c
sort.o: config.h ytree.h sort.c
stat.o: config.h ytree.h stat.c
system.o: config.h ytree.h system.c
tar.o: config.h ytree.h tar.c
termcap.o: config.h ytree.h termcap.c
util.o: config.h ytree.h util.c
view.o: config.h ytree.h view.c
zip.o: config.h ytree.h zip.c
zoo.o: config.h ytree.h zoo.c

