#
# Makefile for buildkernel script package
#
#Copyleft:
#    Buildkernel is used to create a new linux kernel from the raw source
#    and patches.
#    Copyright (C) 1997, 1998 William Stearns <wstearns@pobox.com>
#
#    This program is free software; you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation; either version 2 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program; if not, write to the Free Software
#    Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#    The author can also be reached at:
#        William Stearns
#email:  wstearns@pobox.com              (preferred)
#web:    http://www.pobox.com/~wstearns
#snail:  544 Winchester Place
#        Colchester VT, 05446
#
#Make sure buildkernel has BKSCRIPTVER updated when this changes
BKSCRIPTVER = 0.83

BINDIR = /usr/bin
DOCFILES = COPYING QUICKSTART TURBOSTART-NEWESTSTABLE buildkernel.doc buildkernel-${BKSCRIPTVER}.lsm index.html
DOCDIR = /usr/doc/buildkernel-${BKSCRIPTVER}


install: 
	@echo -n "Installing files... "
	@echo -n "buildkernel... "
	@install -o root -g root -m 0755 buildkernel ${BINDIR}/buildkernel
	@echo -n "doc directory... "
	@install -o root -g root -m 0755 -d ${DOCDIR}
	@echo -n "${DOCFILES}... "
	@install -o root -g root -m 0644 ${DOCFILES} ${DOCDIR}
	@echo done!
	@if [ ! -f /etc/bkrc ] ; then \
	install -o root -g root -m 0644 bkrc /etc ; \
	else \
	echo /etc/bkrc already exists, not overwriting ; \
	fi

distribs:
	@echo This should only need to be used by the author in 
	@echo packing up the buildkernel package.
	cd .. \
	&& tar cf - buildkernel-${BKSCRIPTVER}/ | \
	gzip -9 > buildkernel-${BKSCRIPTVER}.tar.gz \
	&& rm -f buildkernel-current \
	&& ln -sf buildkernel-${BKSCRIPTVER} buildkernel-current \
	&& tar cf - buildkernel-current/* | \
	gzip -9 > buildkernel-current.tar.gz \
	&& cd buildkernel-${BKSCRIPTVER}
