# compile task doesn't compile sources, but just copy some files
# this should be changed
#

# I put here some variables

# path, where binaries are placed 
# (they will be processed for making distribution)
export _UTT_DIST_DIR=$(shell pwd)/bin
# path, where distribution file should be placed
export _UTT_DIST_OUTPUT=$(shell pwd)


# -----------------------------------------------------------
# default task should display options
.PHONY: default
defaul:
	@echo "Using: make compile|tarball|rpm|deb"


# -----------------------------------------------------------
# -----------------------------------------------------------
# this task should compile utt application
.PHONY: compile
compile:
	if test -d ${_UTT_DIST_DIR}; then rm -fr ${_UTT_DIST_DIR}; fi
	mkdir -p ${_UTT_DIST_DIR}
	@# fake compilation
	cp -r ../utt-0.9/* ${_UTT_DIST_DIR}/
	@# we add some extra file (required during instalation)
	cp common/create_utt_config.pl ${_UTT_DIST_DIR}/
	chmod 700 ${_UTT_DIST_DIR}/create_utt_config.pl


# -----------------------------------------------------------
# this task should compile utt (if nesessery) and create tar.gz version
.PHONY: tarball
tarball: compile
	cd tarball && make

# -----------------------------------------------------------
# this task should compile utt (if nesessery) and create rpm version
.PHONY: rpm
rpm: compile
	@#we build rpm (see spec/README for details)
	cd spec && make

# -----------------------------------------------------------
# this task should compile utt (if nesessery) and create deb version
.PHONY: deb
deb: compile
	@#we build deb (see deb/README for details)
	cd deb && make

# -----------------------------------------------------------
# this task should remove compiled files and directories
.PHONY: clean
clean:
	# finally the line below should be uncomment
	rm -fr ${_UTT_DIST_DIR}

