#
#       Makefile for UTREE
#       Udo Munk, Thu Aug 13 16:10:41 1992
#
#       @(#) utree 3.04-um (Udo Munk) Aug 13 1992 Makefile
#
#       Version: Coherent 4.0

# Compiler flags, loader flags and libraries
CFLAGS= -O -f -VPSTR -T0
LFLAGS=
LIBS=   -lterm
MLIBS=  -lm
# Additional local libraries
LLIBS=

# --------------------------------------------------------------------- #

# Some needed commands to create utree
CC=     cc
CP=     cp
STRIP=  strip

# --------------------------------------------------------------------- #

# Utree executables
UTREE=  ../bin/utree
UTPRL=  ../bin/utree.prlist

# --------------------------------------------------------------------- #

# Utree header files
DEFS=   conf.h cmds.h defs.h help.h hist.h keys.h list.h page.h term.h vars.h

# Utree sources and objects
SRCS=   main.c bind.c comm.c echo.c edit.c file.c help.c hist.c list.c \
	page.c stat.c term.c tree.c util.c vars.c vers.c ../sup/vfprintf.c ../sup/vsprintf.c
OBJS=   main.o bind.o comm.o echo.o edit.o file.o help.o hist.o list.o \
	page.o stat.o term.o tree.o util.o vars.o vers.o vfprintf.o vsprintf.o

# --------------------------------------------------------------------- #

all:    utree utree.prlist
	@echo "all done."

utree:  $(UTREE)
	@echo "utree done."

strip:  $(UTREE)
	$(CP) $(UTREE) $(UTREE)+sym
	$(STRIP) $(UTREE)

utree.prlist:   $(UTPRL)
	@echo "utree.prlist done."

# Compile and link utree
$(UTREE):       $(OBJS)
	$(CC) $(CFLAGS) $(LFLAGS) $(OBJS) -o $@ $(LIBS) $(LLIBS)

# Compile and link utree.prlist
$(UTPRL):       utree.prlist.c
	$(CC) -s $(CFLAGS) $(MFLAGS) $(LFLAGS) $? -o $@ $(MLIBS) $(LIBS) $(LLIBS)

# Clean up
clean:
	rm -f core *.o

# --------------------------------------------------------------------- #

$(OBJS): $(SRCS) $(DEF)

# --------------------------------------------------------------------- #
