#
# Copyright (c) 1988 University College London
# All rights reserved.
#
# Redistribution and use in source and binary forms are permitted
# provided that the above copyright notice and this paragraph are
# duplicated in all such forms and that any documentation,
# advertising materials, and other materials related to such
# distribution and use acknowledge that the software was developed
# by the Department of Computer Science, University College London.
# The name of the University may not be used to
# endorse or promote products derived from this software without
# specific prior written permission.
# THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
# WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
#

# Makefile for a simple ODPTEST server with a simpleStats class
#
# By George Pavlou, July 1994


LIBS	=	libodpobj.a
PROGS	=	odptestsrv odptestclnt
SCRIPTS	=	sqrt.sh meanstddev.sh sqrt-lt.sh meanstddev-lt.sh
HFILES	=	simpleStats.h simpleStats.inc.h
OFILES =	simpleStats.o OdpTestSrv.o OdpTestClnt.o
CLEANFILES =	simpleStats.cc simpleStats.h \
		gdmo.log oidtable.tmp Makefile.mo

AGENTMISLIBS=	$(TOP)/agent/gms/libgms.a $(TOP)/agent/smi/libsmisntx.a \
		$(TOP)/kernel/libkernel.a
MGRMISLIBS=	$(TOP)/manager/rmib/librmib.a $(TOP)/agent/smi/libsmisntx.a \
		$(TOP)/kernel/libkernel.a
UTILIB	=	$(TOP)/util/util/libutil.a
OSILIBS	=	$(SECURITY_LIB) $(TOP)/msap/libmsap.a $(LT_LIB) \
		$(TOP)/util/sntx/libsntx.a $(OSISEC_LIB) $(X500_LIB) \
		$(ISODE)/libisode$(LPP).a


all:		lib prog

prog:		$(PROGS)

lib:		$(LIBS)

glib:

install:	install-h install-lib install-prog

clean:;		rm -f *.o *.a *.ph core $(CLEANFILES) $(PROGS) *~

install-lib:	$(LIBS)
		@for i in $(LIBS); \
		    do (echo "cp $$i $(LIB)/$$i; ranlib $(LIB)/$$i"; \
			      cp $$i $(LIB)/$$i; ranlib $(LIB)/$$i); \
		    done

install-glib:

install-h:	$(HFILES)
		@for i in $(HFILES); \
		    do (echo "cp $$i $(H)/$$i"; \
			      cp $$i $(H)/$$i); \
		    done

install-gh:

install-prog:	$(PROGS)
		@for i in $(PROGS) $(SCRIPTS); \
		    do (echo "cp $$i $(BIN)/$$i"; \
			      cp $$i $(BIN)/$$i); \
		    done

install-gprog:

install-prog:

install-man:


libodpobj.a:	simpleStats.o
		ar ruv libodpobj.a simpleStats.o
		ranlib libodpobj.a

simpleStats.o:	simpleStats.h simpleStats.inc.h simpleStats.inc.cc

simpleStats.cc simpleStats.h:	MIB.gdmo
		(GDMODIR=$(ETC)/gdmodir; export GDMODIR; $(GDMO) MIB.gdmo)

OdpTestSrv.o:	OdpTestSrv.h simpleStats.h simpleStats.inc.h

odptestsrv:	simpleStats.o OdpTestSrv.o $(AGENTMISLIBS) $(UTILIB) $(OSILIBS)
		$(CCPLUS) -o $@ simpleStats.o OdpTestSrv.o \
		$(AGENTMISLIBS) $(UTILIB) $(OSILIBS) $(LSOCKET) -lm

odptestclnt:	OdpTestClnt.o $(AGENTMISLIBS) $(UTILIB) $(OSILIBS)
		$(CCPLUS) -o $@ OdpTestClnt.o \
		$(MGRMISLIBS) $(UTILIB) $(OSILIBS) $(LSOCKET) -lm

