include ./Makeconfig

include ./Makerules

LIBS=

ifndef OPTFLAGS
OPTFLAGS= -O2 -fomit-frame-pointer
endif

ifndef DAEMON
DAEMON = -DDAEMON
endif

CFLAGS = -DSERVER $(WFLAGS) $(OPTFLAGS) $(INC) $(XCFLAGS) $(DAEMON)

OBJS=ypbind_new.o daemon.o error.o

PROGS=	ypbind
SUBDIR=	domainname ypwhich ypcat ypmatch yppoll ypset #yppasswd

all: $(PROGS) subdir

ypbind: $(OBJS)
	$(CC) $(LDFLAGS) -o $@ $(OBJS) $(LIBS)

subdir:
	for d in $(SUBDIR); do \
	  (cd $$d; $(MAKE) $(TARGET)); \
	done

clean: FRC
	$(RM) -f $(PROGS) $(OBJS) *.a *.o *~ core
	$(MAKE) TARGET=clean subdir

install: $(PROGS) subdir
	install -c -s $(PROGS) $(USRSBINDIR)

FRC:
