# master make for metrics

# where to put binaries (from the perspective of our subdirectories)
PREFIX = 
BIN    = $(PREFIX)/usr/bin

DIRS= mccabe halstead utils kdsi 


CC=gcc
CFLAGS=-O2
LDFLAGS=

all: 	 clean progs  

progs:
	for i in $(DIRS); do (cd $$i; $(MAKE) all CC=$(CC) CFLAGS=$(CFLAGS) ); done;
	@echo metrics software made


install: 
	for i in $(DIRS); \
	do (cd $$i; $(MAKE) install BIN=$(BIN) PREFIX=$(PREFIX) ); done;
	@echo metrics software installed



clean:
	for i in $(DIRS); do (cd $$i; $(MAKE) clean); done;

test:
	@echo testing kdsi
	@cd kdsi;  PATH=$(BIN):$$PATH; export PATH; $(MAKE) -i test
	@echo " "
	@echo testing halstead
	@cd halstead;  PATH=$(BIN):$$PATH; export PATH; $(MAKE) -i test
	@echo " "
	@echo test mccabe
	@cd mccabe;  PATH=$(BIN):$$PATH; export PATH; $(MAKE) -i test

