#
# Makefile  -  makefile for boot rom network drivers
#
# Copyright (C) 1998-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.17 2007/02/01 12:09:20 gkminix Exp $
#


# Directory name of this module
MODNAME = bootrom/netdrvr
MODDEFS = _NETDRVR_


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


# List of subdirectories
SUBDIRS = init lib dossim pktdrvr ndis2 undi


# List of source and object files:
PKTLIBS  = obj/libpktdrv.a obj/libdossim.a obj/libnetdrv.a
NDISLIBS = obj/libndis2.a obj/libdossim.a obj/libnetdrv.a
UNDILIBS = obj/libundi.a obj/libnetdrv.a
INITOBJ  = obj/netdrv.o86
TARGETS  = obj/netpkt.bin obj/netndis.bin obj/netundi.bin


# Rules to generate all target system files
all:	netdrvr-$(GNU16BIT) MD5SUMS


# Generate all network driver interface binaries
.PHONY:		netdrvr-gnu netdrvr-nognu netdrvr-inst

netdrvr-gnu:	netdrvr-inst

netdrvr-nognu:

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


# Generate the packet driver interface binary
obj/netpkt.bin:		$(INITOBJ) $(PKTLIBS)


# Generate the NDIS2 driver interface binary
obj/netndis.bin:	$(INITOBJ) $(NDISLIBS)


# Generate the UNDI driver interface binary
obj/netundi.bin:	$(INITOBJ) $(UNDILIBS)


# Generate the individual kernel modules
$(INITOBJ) $(PKTLIBS) $(NDISLIBS) $(UNDILIBS):	all-recursive


# Generate the MD5 checksum file
MD5SUMS:	all-recursive


# Generate all files necessary for distribution
distrib:	MD5SUMS netdrvr-inst


# Install
install:	install-recursive


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

distclean:	clean

realclean:	clean
		rm -f MD5SUMS

