# NSS-multidomain: NSS module for multidomain authentification
# Copyright (C) 2001, 2002 LibertySurf Telecom, Antoniu-George Savu
# 
# 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., 59 Temple Place - Suite 330, Boston, MA
# 02111-1307, USA.

all install distclean clean:
	$(MAKE) -C src $@

distclean: localdistclean

localdistclean:
	$(RM) config.log config.cache config.status

configure: configure.in
	autoconf

################################################################

DIST_LIST = \
	AUTHORS \
	configure \
	configure.in \
	config.h.in \
	COPYING \
	Makefile \
	NEWS \
	README \
	README.makedb \
	src/Config.mk.in \
	src/.cvsignore \
	src/Makefile \
	src/make-db.c \
	src/multidomain-auth.c \
	src/nss-test.c

# VERSION have to be specified on command line
DIST_NAME = nss-multidomain
DIST_EXTS = tar.bz2 tar.gz
DIST = $(DIST_NAME)-$(VERSION)
DISTS = $(DIST_EXTS:%=$(DIST_NAME)-$(VERSION).%)
TAR = tar
TAR_BZ2 = -cvjf
TAR_GZ = -cvzf

dist: $(DISTS:%=../%)

../$(DIST).tar.bz2: ../$(DIST_NAME)-$(VERSION) $(DIST_LIST)
	cd .. && $(TAR) $(TAR_BZ2) $(@F) $(DIST_LIST:%=$(DIST_NAME)-$(VERSION)/%)

../$(DIST).tar.gz: ../$(DIST_NAME)-$(VERSION) $(DIST_LIST)
	cd .. && $(TAR) $(TAR_GZ) $(@F) $(DIST_LIST:%=$(DIST_NAME)-$(VERSION)/%)

../$(DIST_NAME)-$(VERSION):
	ln -s $(DIST_NAME) $@
