#
#    YPS-0.2, NIS-Server for Linux
#    Copyright (C) 1994  Tobias Reber
#
#    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., 675 Mass Ave, Cambridge, MA 02139, USA.
#
#
#	(#)$Id: Makefile,v 0.17 1994/01/02 22:48:22 root Exp $
#
#	$Author: root $
#	$Log: Makefile,v $
# Revision 0.17  1994/01/02  22:48:22  root
# Added strict prototypes
#
# Revision 0.16  1994/01/02  20:08:57  root
# Added GPL notice
#
# Revision 0.15  1994/01/01  21:42:28  root
# Added depend target
#
SRCS=yp_clnt.c yp_xdr.c ypclnt.c ypgetdom.c
LIBYPOBJS=ypclnt.o ypgetdom.o yp_clnt.o yp_xdr.o
INCLUDES=# -I../include
DEFINES=-DYPDIR=\"$(YPDIR)\" -DHAS_GETDOMAINNAME # -DYPBROADCAST
CDEBUGFLAGS= -O -Wall -Wstrict-prototypes # -DDEBUG

LIBDIR=/usr/local/lib
YPDIR=/var/yp
DEFAULTDOMAIN=zdv

CFLAGS=$(CDEBUGFLAGS) $(INCLUDES) $(DEFINES)

all: libyp.a

libyp.a: $(LIBYPOBJS)
	rm -f $@
	ar qc $@ $(LIBYPOBJS)

ypgetdom.o:	ypgetdom.c
	$(CC) $(CFLAGS) -c $<

install: all
	-mkdir -p $(YPDIR)
	echo "$(DEFAULTDOMAIN)" > $(YPDIR)/.domainname
	install -m 644 libyp.a $(LIBDIR)

clean:
	-for i in *.[ch]; do \
		ci "$$i" || ( co -l "$$i" && ci "$$i" ) \
	done
	-rm -f *.o core libyp.a

ifeq (.depend,$(wildcard .depend))
include .depend
endif

depend: $(SRCS)
	$(CPP) $(CFLAGS) -M $(SRCS) > .depend
