#! /usr/bin/make -f

PROJECT_DIR		= $(CURDIR)
TK_TESTS_DIR		= $(PROJECT_DIR)/tk/tests
ANALYSE_SCRIPT		= $(PROJECT_DIR)/analyse.tcl
XREF_OUT		= $(PROJECT_DIR)/xref.out
PROC_INFO		= $(PROJECT_DIR)/procinfo.txt

#
# TARGETS AND RULES
#
all: procinfo

src-update:
	@cd $(TK_TESTS_DIR); fossil pull; fossil update trunk

xref: $(XREF_OUT)
$(XREF_OUT): $(TK_TESTS_DIR) $(ANALYSE_SCRIPT)
	@-cd $(TK_TESTS_DIR); mv -f testutils.tcl $(PROJECT_DIR)
	@cd $(TK_TESTS_DIR); fossil update trunk
	@tclsh $(ANALYSE_SCRIPT) xref

procinfo: $(PROC_INFO)
$(PROC_INFO): $(XREF_OUT) $(ANALYSE_SCRIPT)
	@tclsh $(ANALYSE_SCRIPT) procinfo

.PHONY: all src-update procinfo xref

# EOF
