$NetBSD: patch-af,v 1.2 1999/12/06 02:19:27 sakamoto Exp $

--- ./Makefile.orig	Wed Nov  3 06:05:02 1999
+++ ./Makefile	Mon Dec  6 11:04:20 1999
@@ -18,15 +18,9 @@
 INCLUDE=-I../utils
 CFLAGS= -Wall -g -O2
-CC=g++ $(CFLAGS) $(INCLUDE)
+CC=$(LIBTOOL) --mode=compile g++ $(CFLAGS) $(INCLUDE)
 
 # Linker and flags
-LIBDIR=-L../utils
-# Solaris users uncomment this line instead of the next one
-#LIBS=-lutils -lsocket -lnsl
-LIBS=-lutils
-LD=g++ $(LIBDIR)
-
-# Archiver
-AR=ar -cr
+LIBS=../utils/libplputils.la
+LD=$(LIBTOOL) --mode=link g++
 
 #######################################
@@ -39,18 +33,21 @@
 export LIBS
 
-all: bin/ncp bin/rfsv
+all: _utils _ncp _rfsv
+	rm -f bin/ncp bin/rfsv
+	ln -s ../ncp/ncp bin/ncp
+	ln -s ../rfsv/rfsv bin/rfsv
+
+_utils:
+	cd utils; $(MAKE)
 
-bin/ncp: $(wildcard ncp/*.cc) ncp utils/libutils.a
+_ncp:
 	cd ncp; $(MAKE)
 
-bin/rfsv: $(wildcard rfsv/*.cc) utils/libutils.a
+_rfsv:
 	cd rfsv; $(MAKE)
 
-utils/libutils.a:
-	cd utils; $(MAKE)
-
-install:
-	cp bin/rfsv /usr/local/bin/rfsv
-	cp bin/ncp /usr/local/bin/ncp
+install: all
+	cp rfsv/rfsv /usr/local/bin/rfsv
+	cp ncp/ncp /usr/local/bin/ncp
 
 clean:
@@ -60,5 +57,5 @@
 	rm -f ncp.log *~ core
 
-test: bin/ncp bin/rfsv
+test: all
 	PATH=`pwd`/bin:$${PATH}; export PATH;\
 		rfsv dir "C:/documents/"
