#
# Makefile for prefix daemon.
#
# $Id: Makefile,v 1.4 1989/11/14 17:23:13 adam Exp $ SPRITE (Berkeley)
#
# Copyright (c) 1988, 1989 by the Regents of the University of California
# Copyright (c) 1988, 1989 by Adam de Boor
# Copyright (c) 1989 by Berkeley Softworks
#
# Permission to use, copy, modify, and distribute this
# software and its documentation for any non-commercial purpose
# and without fee is hereby granted, provided that the above copyright
# notice appears in all copies.  The University of California,
# Berkeley Softworks and Adam de Boor make no representations about
# the suitability of this software for any purpose.  It is provided
# "as is" without express or implied warranty.
#

#
# Owner of the various binaries
#
OWNER		= adam

#
# ETCDIR is where the daemon goes
#
BINDIR		= /usr/public
ETCDIR		= /usr/etc
#
# Mode system-control clients and customs should be. In a hostile environment,
# this should be 700 and OWNER should be root
#
ETCMODE		= 755

#
# Include PMake common description
#
DEPFILE		?= dependencies.mk
VARS_ONLY	= yes
#include	"../common.mk"

#
# Additional path definitions
#
.PATH.h		: $(INCLUDE) ../customs
.PATH.a		: $(LSTDIR) $(SPRITEDIR) 
.PATH.c		: ../customs

CFLAGS		+= -I. -DEXPORTS=\"/etc/exports\"
#CC		= gcc -O -fstrength-reduce -finline-functions
#
# If making a profiled version, give the proper flags and configure pieces of
# code properly. Note this isn't done on a sun because the last time I profiled
# pmake on a sun, it died in the profiling code...
#
#if make(prof) && !defined(sun)
CFLAGS		+= -pg -DPROF
#endif

OBJS		= child.o export.o import.o main.o mount.o printf.o rpc.o \
                  sunrpc.o xdr.o

prefix		: $(OBJS) -llst -lrpcsvc
	$(CC) $(CFLAGS) $(LDFLAGS) $(.ALLSRC) -o $(.TARGET)

install		: prefix
	install -o $(OWNER) -m $(ETCMODE) prefix $(ETCDIR)

clean		:: .NOEXPORT
	rm -f prefix *.o

HDRS		= prefix.h sunrpc.h

#
# Declare additional sources for which dependencies should be generated
#
depend		: $(OBJS:S|.o$|.c|g)

#include "$(DEPFILE)"

