#
# Makefile  -  makefile for boot rom kernel
#
# Copyright (C) 1995-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.15 2007/01/06 18:30:46 gkminix Exp $
#


# Directory name of this module
MODNAME = bootrom/kernel
MODDEFS = _KERNEL_


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


# List of subdirectories
SUBDIRS = init boot arpa net


# List of source and object files:
KRNLIBS = obj/libbase.a obj/libarpa.a obj/libnet.a
INITOBJ = obj/kernel.o86
TARGETS = obj/kernel.bin


# Rules to generate the target system files
all:		kernel-$(GNU16BIT)


# Generate kernel binary
.PHONY:		kernel-gnu kernel-nognu kernel-inst

kernel-gnu:	kernel-inst

kernel-nognu:

kernel-inst:	$(TARGETS)
		@for i in $^; do				\
		  j=`basename $$i`;				\
		  $(CPATTR) $$i $(bindestdir)/$$j;		\
		done

obj/kernel.bin:	$(INITOBJ) $(KRNLIBS)


# Generate the individual kernel modules
$(INITOBJ) $(KRNLIBS):	all-recursive


# Generate all files necessary for distribution
distrib:	kernel-inst


# Install - there is nothing to be done here
install:


# Clean up
clean:		clean-general clean-recursive
		rm -f obj/*.o86 obj/*.a obj/*.map obj/*.bin

distclean:	clean

realclean:	clean

