#
# ~ppr/src/misc/Makefile
# Copyright 1995, 1996, 1997, Trinity College Computing Center.
# Written by David Chappell.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted, provided
# that the above copyright notice appear in all copies and that both that
# copyright notice and this permission notice appear in supporting
# documentation.  This software is provided "as is" without express or
# implied warranty.
#
# This file was last modified 6 January 1997.
#

include ../include/global.mk

all: ppr2samba$(DOTEXE) xpprgrant$(DOTEXE)

install: $(HOMEDIR)/bin/pprsync $(HOMEDIR)/bin/ppr2samba \
	$(HOMEDIR)/bin/xppr $(HOMEDIR)/bin/xpprstat $(HOMEDIR)/install/smb.conf.sample \
	$(HOMEDIR)/bin/samba_submitter $(HOMEDIR)/bin/xpprgrant \
	$(HOMEDIR)/install/customs.ppr

ppr2samba$(DOTEXE): ppr2samba.c ../libppr.$(LIBEXT) ../include/version.h \
		../include/global_defines.h ../include/util_exits.h
	$(CC) $(CFLAGS) -o ppr2samba$(DOTEXE) ppr2samba.c ../libppr.$(LIBEXT) $(OSFLIBS)
	$(STRIP) ppr2samba$(DOTEXE)
	chmod 6711 ppr2samba$(DOTEXE)

$(HOMEDIR)/bin/pprsync: pprsync.sh
	cp pprsync.sh $(HOMEDIR)/bin/pprsync

$(HOMEDIR)/bin/ppr2samba: ppr2samba$(DOTEXE)
	$(CP) ppr2samba $(HOMEDIR)/bin/ppr2samba
	chmod 6711 $(HOMEDIR)/bin/ppr2samba$(DOTEXE)

$(HOMEDIR)/bin/xppr: xppr.sh
	$(INSTALLSCRIPT) xppr.sh $(HOMEDIR)/bin/xppr

$(HOMEDIR)/bin/xpprstat: xpprstat.sh
	$(INSTALLSCRIPT) xpprstat.sh $(HOMEDIR)/bin/xpprstat

$(HOMEDIR)/install/smb.conf.sample: smb.conf.sample
	$(CP) smb.conf.sample $(HOMEDIR)/install/smb.conf.sample

$(HOMEDIR)/bin/samba_submitter: samba_submitter.perl
	$(INSTALLSCRIPT) samba_submitter.perl $(HOMEDIR)/bin/samba_submitter

# This program must be setuid root.
$(HOMEDIR)/bin/xpprgrant: xpprgrant$(DOTEXE)
	$(RMF) $(HOMEDIR)/bin/xpprgrant$(DOTEXE)
	$(CP) xpprgrant$(DOTEXE) $(HOMEDIR)/bin/xpprgrant$(DOTEXE)

xpprgrant$(DOTEXE): xpprgrant.c ../include/global_defines.h \
		../include/util_exits.h ../libppr.$(LIBEXT)
	$(CC) $(CFLAGS) -o xpprgrant$(DOTEXE) xpprgrant.c ../libppr.$(LIBEXT)
	$(STRIP) xpprgrant$(DOTEXE)

$(HOMEDIR)/install/customs.ppr: customs.ppr
	$(INSTALLSCRIPT) customs.ppr $(HOMEDIR)/install/customs.ppr

clean:
	rm -f *~ *.bak ppr2samba$(DOTEXE) xpprgrant$(DOTEXE)

# end of file
