# get base-dir (logarch-x)
base=`pwd | sed 's/^.*\///'`

all:
	@echo "Nothing to do... just type make install"
	@echo "to install logarch to /usr/sbin and copy"
	@echo "a sample config-file to /etc/logarch.conf"

# install script
install:
	install logarch /usr/sbin
	install examples/logarch.conf /etc
	@mkdir -p /etc/logarch.d
	@mkdir -p /var/log/old


# remove installed script
uninstall:
	@rm /usr/sbin/logarch


# create distrubution-tar.bz2
dist:
	@echo $$[`cat buildnum 2>/dev/null`+1] > buildnum
	@echo -e "\ncreating $(base).tar.bz2 in parent-dir. Build `cat buildnum`"
	@base=$(base) \
	&& cd .. \
	&& tar cvjf $$base.tar.bz2 $$base \
	&& echo -e "\ncreating $$base.tar.gz in parent-dir. Build `cat $$base/buildnum`" \
	&& tar cvzf $$base.tar.gz $$base
