#
# ~ppr/src/libppr/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.
#
# Last modified 27 February 1997.
#

include ../include/global.mk

all: ../libppr.$(LIBEXT)

install: ../libppr.$(LIBEXT) $(HOMEDIR)/lib/play_local.pl \
	$(HOMEDIR)/lib/pprpopup.pl $(HOMEDIR)/lib/speach.pl

# notice that we leave no space after $(LIBCMD)
../libppr.$(LIBEXT): myalloc.$(OBJ) datestamp.$(OBJ) ppr_sscanf.$(OBJ) \
		tokenize.$(OBJ) padded.$(OBJ) readqfile.$(OBJ) \
		unreadqfile.$(OBJ) daemon.$(OBJ) alert.$(OBJ) quote.$(OBJ) \
		getdouble.$(OBJ) findres.$(OBJ) dtostr.$(OBJ) torf.$(OBJ) \
		protected.$(OBJ) icmp.$(OBJ) lock.$(OBJ) money.$(OBJ) \
    	    	charge.$(OBJ) jobid.$(OBJ) pagesize.$(OBJ) disk_space.$(OBJ) \
    	    	wrap.$(OBJ) reswidth.$(OBJ) strsignal.$(OBJ) options.$(OBJ) \
		dimens.$(OBJ) sizelist.$(OBJ) foptions.$(OBJ) ali_str.$(OBJ) \
		ppr_gcmd.$(OBJ) gnodename.$(OBJ) nodeid.$(OBJ) readppd.$(OBJ) \
		destspec.$(OBJ) getopt.$(OBJ)
	rm -f ../libppr.$(LIBEXT)
	$(LIBCMD) ../libppr.$(LIBEXT) >/dev/null 2>&1
	$(LIBCMD) ../libppr.$(LIBEXT) datestamp.$(OBJ) ppr_sscanf.$(OBJ) \
		tokenize.$(OBJ) padded.$(OBJ) readqfile.$(OBJ) \
		unreadqfile.$(OBJ) daemon.$(OBJ) alert.$(OBJ) \
		quote.$(OBJ) getdouble.$(OBJ) findres.$(OBJ) dtostr.$(OBJ) \
		torf.$(OBJ) protected.$(OBJ) icmp.$(OBJ) lock.$(OBJ) \
		money.$(OBJ) charge.$(OBJ) jobid.$(OBJ) pagesize.$(OBJ) \
		myalloc.$(OBJ) disk_space.$(OBJ) wrap.$(OBJ) reswidth.$(OBJ) \
		strsignal.$(OBJ) options.$(OBJ) dimens.$(OBJ) sizelist.$(OBJ) \
		foptions.$(OBJ) ali_str.$(OBJ) ppr_gcmd.$(OBJ) \
		gnodename.$(OBJ) nodeid.$(OBJ) readppd.$(OBJ) destspec.$(OBJ) \
		getopt.$(OBJ)

myalloc.$(OBJ): myalloc.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c myalloc.c

datestamp.$(OBJ): datestamp.c
	$(CC) $(CFLAGS) -c datestamp.c

ppr_sscanf.$(OBJ): ppr_sscanf.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c ppr_sscanf.c

tokenize.$(OBJ): tokenize.c
	$(CC) $(CFLAGS) -c tokenize.c

padded.$(OBJ): padded.c
	$(CC) $(CFLAGS) -c padded.c

readqfile.$(OBJ): readqfile.c ../include/global_defines.h ../include/global_structs.h
	$(CC) $(CFLAGS) -c readqfile.c

unreadqfile.$(OBJ): unreadqfile.c ../include/global_defines.h ../include/global_structs.h
	$(CC) $(CFLAGS) -c unreadqfile.c

daemon.$(OBJ): daemon.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c daemon.c

alert.$(OBJ): alert.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c alert.c

quote.$(OBJ): quote.c
	$(CC) $(CFLAGS) -c quote.c

getdouble.$(OBJ): getdouble.c
	$(CC) $(CFLAGS) -c getdouble.c

dtostr.$(OBJ): dtostr.c
	$(CC) $(CFLAGS) -c dtostr.c

torf.$(OBJ): torf.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c torf.c

protected.$(OBJ): protected.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c protected.c

icmp.$(OBJ): icmp.c
	$(CC) $(CFLAGS) -c icmp.c

lock.$(OBJ): lock.c
	$(CC) $(CFLAGS) -c lock.c

money.$(OBJ): money.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c money.c

charge.$(OBJ): charge.c ../include/global_defines.h ../include/global_structs.h
	$(CC) $(CFLAGS) -c charge.c

jobid.$(OBJ): jobid.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c jobid.c

pagesize.$(OBJ): pagesize.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c pagesize.c

disk_space.$(OBJ): disk_space.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c disk_space.c

findres.$(OBJ): findres.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c findres.c

wrap.$(OBJ): wrap.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c wrap.c

reswidth.$(OBJ): reswidth.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c reswidth.c

strsignal.$(OBJ): strsignal.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c strsignal.c

options.$(OBJ): options.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c options.c

dimens.$(OBJ): dimens.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c dimens.c

sizelist.$(OBJ): sizelist.c ../include/global_defines.h ../include/global_structs.h
	$(CC) $(CFLAGS) -c sizelist.c

foptions.$(OBJ): foptions.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c foptions.c

ali_str.$(OBJ): ali_str.c ../include/global_defines.h
	$(CC) $(CFLAGS) -DATALKTYPE_$(ATALKTYPE) -c ali_str.c

ppr_gcmd.$(OBJ): ppr_gcmd.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c ppr_gcmd.c

gnodename.$(OBJ): gnodename.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c gnodename.c

nodeid.$(OBJ): nodeid.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c nodeid.c

ppad_readppd.$(OBJ): ppad_readppd.c ../include/global_defines.h \
		../include/ppad.h ../include/util_exits.h
	$(CC) $(CFLAGS) -c ppad_readppd.c

destspec.$(OBJ): destspec.c ../include/global_defines.h
	$(CC) $(CFLAGS) -c destspec.c

getopt.$(OBJ): getopt.c ../include/global_defines.h ../include/global_structs.h
	$(CC) $(CFLAGS) -c getopt.c

$(HOMEDIR)/lib/pprpopup.pl: pprpopup.pl
	$(CP) pprpopup.pl $(HOMEDIR)/lib/pprpopup.pl

$(HOMEDIR)/lib/play_local.pl: play_local.pl
	$(CP) play_local.pl $(HOMEDIR)/lib/play_local.pl

$(HOMEDIR)/lib/speach.pl: speach.pl
	$(CP) speach.pl $(HOMEDIR)/lib/speach.pl

# clean up
clean:
	rm -f *.bak *~ *.bck *.$(OBJ) ../libppr.$(LIBEXT)

# end of file
