#!/bin/bash
#########################################################
# 							#
# This is BashStyle-NG  				#
#							#
# Licensed under GNU GENERAL PUBLIC LICENSE v3    	#
#							#
# Copyright 2007 - 2016 Christopher Bratusek		#
#							#
#########################################################

make_build () {
	check_configure && 
	build_message && 
	generate_mo &&
	build_doc_html &&
	do_gzip_man &&
	build_end_message &&
	touch "${PWD}"/.make/build_done
}

make_install () {
	check_configure &&
	check_built &&
	check_root "install" &&
	install_message && 
	installdirs_create &&
	install_bsng && 
	post_install &&
	thanks_message
}

make_remove () {
	check_configure &&
	check_root "remove" &&
	remove_message && 
	remove_bsng &&
	post_remove
}

CLEAN_FILES=( data/bashstyle data/bashstyle-ng.pc ui/bashstyle.ui.h
		rc/bashstyle-rc i18n/??/*.mo i18n/*.pot .configure/results
		.make/build_done ui/#bashstyle.ui# ui/bashstyle.ui~
		doc/bashstyle.info doc/*.gz )

CLEAN_DIRS=( doc/html )

make_clean () {
	clean_message
	for file in "${CLEAN_FILES[@]}"; do
		rm -f "${file}"
	done

	for dir in "${CLEAN_DIRS[@]}"; do
		rm -rf "${dir}"
	done
}
