#
# 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	=	libodpsntx.a libodpobj.a
GLIBS	=	libodpsntx.a
PROGS	=	odptestsrv odptestclnt
SCRIPTS	=	sqrt.sh meanstddev.sh sqrt-lt.sh meanstddev-lt.sh
HFILES	=	ODP-types.h ODP-Sntx.h MeanStdDev.h \
		simpleStats.h simpleStats.inc.h
CLEANFILES =	ODP_tables.c ODP-types.h ODP-Sntx.c ODP-Sntx.h \
		simpleStats.cc simpleStats.h \
		attrcmpl.log gdmo.log oidtable.tmp Makefile.attr Makefile.mo

OSNTXFILES =	ODP_tables.o ODP-Sntx.o
OMIBFILES =	simpleStats.o

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:		$(GLIBS)

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:	$(GLIBS)
		@for i in $(GLIBS); \
		    do (echo "cp $$i $(LIB)/$$i; ranlib $(LIB)/$$i"; \
			      cp $$i $(LIB)/$$i; ranlib $(LIB)/$$i); \
		    done

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:


libodpsntx.a:	$(OSNTXFILES)
		ar ruv libodpsntx.a $(OSNTXFILES)
		ranlib libodpsntx.a

libodpobj.a:	$(OMIBFILES)
		ar ruv libodpobj.a $(OMIBFILES)
		ranlib libodpobj.a

ODP_tables.c ODP-types.h \
ODP-Sntx.c ODP-Sntx.h \
MeanStdDev.h \
simpleStats.cc simpleStats.h:	ODP.py MIB.gdmo
		$(GDMOASN-CMPL) ODP.py MIB.gdmo

ODP_tables.o:	ODP-types.h

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

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

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

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

