/**/# Compiler flags, loader flags and libraries
#if defined(vax) || defined(sun)
CFLAGS= -DBSD -O4 -traditional
#else
#ifdef _IBMR2
CFLAGS= -DAIX -D_NO_PROTO -O
#endif
#endif
MFLAGS=
LFLAGS=
#ifdef _IBMR2
LIBS=   -lcurses
#else
LIBS=   -ltermcap
#endif
MLIBS=
/**/# Additional local libraries
LLIBS=

/**/# --------------------------------------------------------------------- #

/**/# Some needed commands to create utree
#if defined(vax) || defined(sun)
CC=     gcc
#else
CC=	cc
#endif
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 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 \
	stat.c term.c tree.c util.c vars.c vers.c
OBJS=   main.o bind.o comm.o echo.o edit.o file.o help.o hist.o list.o \
	stat.o term.o tree.o util.o vars.o vers.o

/**/# --------------------------------------------------------------------- #

all::    utree utree.prlist

utree:  $(UTREE)

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

utree.prlist:   $(UTPRL)

/**/# 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):        $(DEFS)
	$(CC) $(CFLAGS) -c $<

/**/# --------------------------------------------------------------------- #

