#
# Makefile	Top level makefile for the NYS project
#				(NIS, YP, Switch)
#
# Copyright (c) 1993 Signum Support AB, Sweden.
#
# This file is part of the NYS Library.
#
# The NYS Library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public License as
# published by the Free Software Foundation; either version 2 of the
# License, or (at your option) any later version.
#
# The NYS Library 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
# Library General Public License for more details.
# 
# You should have received a copy of the GNU Library General Public
# License along with the NYS Library; see the file COPYING.LIB.  If
# not, write to the Free Software Foundation, Inc., 675 Mass Ave,
# Cambridge, MA 02139, USA.
#
# Author: Peter Eriksson <pen@signum.se>, 5 Augh 1993
#

all: libnsl

clients:
	cd yp  ; $(MAKE) $(ALLFLAGS) clnts
	cd nis ; $(MAKE) $(ALLFLAGS) clnts
	cd dns ; $(MAKE) $(ALLFLAGS) clnts
	cd nsw ; $(MAKE) $(ALLFLAGS) clnts

libnsl:
	cd yp  ; $(MAKE) $(ALLFLAGS)
	cd nis ; $(MAKE) $(ALLFLAGS)
	cd dns ; $(MAKE) $(ALLFLAGS)
	cd nsw ; $(MAKE) $(ALLFLAGS)
	$(RANLIB) lib/libnsl.a

clean:
	rm -f *.o *~ core \#* jump/_*
	cd yp  ; $(MAKE) clean
	cd nis ; $(MAKE) clean
	cd dns ; $(MAKE) clean
	cd nsw ; $(MAKE) clean

distclean:
	rm -f *.o *~ core lib/* lib/${SHARED}* \#* jump/_*
	cd yp  ; $(MAKE) distclean
	cd nis ; $(MAKE) distclean
	cd dns ; $(MAKE) distclean
	cd nsw ; $(MAKE) distclean

#*************NO USER SERVICEABLE PARTS BELOW THIS LINE**************

include Makeconfig

dll:
	$(RANLIB) lib/${SHARED}${JUMP_LIB}.a
	cd lib ;\
	$(MKIMAGE) -f -l $(JUMP_LIB) -v $(DLL_VERSION) -a $(DLL_LOADADDR) \
		-g 4096 -j 0x4000 -- ${SHARED}$(JUMP_LIB).a -lc -lgcc -lc
	cd lib ;\
	$(MKSTUBS) -f -l $(JUMP_LIB) -v $(DLL_VERSION) -a $(DLL_LOADADDR) \
		-g 4096 -j 0x4000 -- $(JUMP_LIB)
	$(STRIP) lib/$(JUMP_LIB).so.$(DLL_VERSION)
