#
# Makefile  -  makefile for DOS utility programs
#
# Copyright (C) 2003-2007 Gero Kuhlmann   <gero@gkminix.han.de>
#
#  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
#  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.
#
# $Id: Makefile,v 1.10 2007/02/01 12:09:24 gkminix Exp $
#


# Directory name of this module
MODNAME = mknbi-dos


# Include makefile configuration
include ../../make.config
include ../../make.rules


# Source files for the target system
SSRCS86 = boot.S86 nbramdrv.S86 rmrd.S86


# Rules to generate the target system files
all:		boot-$(GNU16BIT) nbramdrv-$(GNU16BIT) rmrd-$(GNU16BIT)

.PHONY:		tools

tools:		nbramdrv-$(GNU16BIT) rmrd-$(GNU16BIT) mntnbi.pl



# Generate the boot sector binary
.PHONY:		boot-gnu boot-nognu

boot-gnu:	boot.boot

boot-nognu:

boot.boot:	boot.o86


# Generate the ramdisk driver binary
.PHONY:		nbramdrv-gnu nbramdrv-nognu

nbramdrv-gnu:	nbramdrv.sys

nbramdrv-nognu:

nbramdrv.sys:	nbramdrv.o86


# Generate the ramdisk removal program
.PHONY:		rmrd-gnu rmrd-nognu

rmrd-gnu:	rmrd.com

rmrd-nognu:

rmrd.com:	rmrd.o86


# Make all files necessary for distribution
distrib:	tools


# Install
install:	tools
		$(INSTALL) -d $(DESTDIR)$(nbmiscdir)
		$(INSTALL) -d $(DESTDIR)$(nblibdir)
		$(INSTALL_DATA) rmrd.com $(DESTDIR)$(nbmiscdir)/rmrd.com
		$(INSTALL_DATA) nbramdrv.sys $(DESTDIR)$(nbmiscdir)/nbramdrv.sys
		$(INSTALL_SCRIPT) mntnbi.pl $(DESTDIR)$(nblibdir)/mntnbi.pl


# Clean up
clean:		clean-general
		rm -f *.s86 boot.boot

distclean:	clean

realclean:	distclean
		rm -f nbramdrv.sys rmrd.com


