#
# Prospect: a developer's system profiler.
# Digital Tree ADT.
#
# COPYRIGHT (C) 2001-2004 Hewlett-Packard Company
#
# Authors: Doug Baskins, HP
#          Alex Tsariounov, HP
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the Free
# Software Foundation; either version 2 of the License, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
# more details.
#
# You should have received a copy of the GNU General Public License along with
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
# Place - Suite 330, Boston, MA 02111-1307, USA.
#

#
# $Id: Makefile,v 1.2 2004/01/09 20:29:27 type2 Exp $
# 

#
# dtree specific targets definitions
#
DTREE = dtree.o
.EXE = testprog

#
# dtree include files
#
.H = dtree.h

#
# dtree object files
.O = dtree_getnext.o  dtree_ins.o  dtree_malloc.o 

#
# dtree test objects files
#
DTREE_TESTOBJ = dtree_test.o

#
# CLEANED files definitions.
#
.CLN = $(.O) $(.EXE) ${DTREE_TESTOBJ} ${DTREE} 

#
# Compilation/link flags
#
# OF = Optimization
# CF = Compilation
# LF = Link
#
OF = -O2 -g
CF = -Wall $(OF)
LF = -static -lm 

#
# UNIX COMMANDS definitions.
#
# Could be overloaded by make invocations.
# RMF    = default forced rm.
#
RMF    = rm -f

###############################################################################
#                                                                             #
# Dtree targets                                                               #
#                                                                             #
###############################################################################

all: ${.EXE}

.c.o:
	@echo $@:
	$(CC) $(CF) -c $<

${DTREE}:  ${.O} ${.H}
	@echo $@:
	${LD} -r ${.O} -o $@

testprog: ${DTREE} ${DTREE_TESTOBJ}
	@echo $@:
	${CC} ${CF} -o $@ $(DTREE) $(DTREE_TESTOBJ) ${LF}

clean:
	@echo $@:
	$(RMF) $(.CLN)

distclean:
	@echo $@:
	$(RMF) $(.CLN) out* *.bak *~ cscope.out tags

