#
# Copyright (c) 1988 University College London
# All rights reserved.
#
# Redistribution and provide 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 provide acknowledge that the software was developed
# by the Department of Computer Science, University College London.
# The name of the University may not be provided 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 msap library (CMIS/P)
#
#CC	=	gcc -traditional
LIBS	=	$(ISODE)/libdsap.a $(ISODE)/libisode.a
LLIBS	=	$(ISODE)/lint/llib-ldsap.ln $(ISODE)/lint/llib-lisode.ln
XMPINC	=	../include

HFILES	=	$(XMPINC)/xmp.h $(XMPINC)/msap_u.h $(XMPINC)/midas_xmp.h \
		mp_utilities.h mp_integrity.h

CFILES	=	mp_set_req.c mp_get_req.c mp_create_req.c mp_delete_req.c \
		mp_action_req.c \
		mp_utilities.c \
                mp_receive.c mp_wait.c\
		mp_init.c mp_integrity.c

OFILES	=	mp_set_req.o mp_get_req.o mp_create_req.o mp_delete_req.o \
		mp_action_req.o \
		mp_utilities.o \
                mp_receive.o mp_wait.o\
		mp_init.o mp_integrity.o

CCFLAGS =	-I$(XMPINC) $(OPTIONS) -g # -O

all:		libXMP_provide.a

lib:		all

glib:		lib

install:	install-h install-lib

install-lib:	libXMP_provide.a
		@echo "cp libXMP_provide.a $(LIB)/libXMP_provide.a; \
		ranlib $(LIB)/libXMP_provide.a";\
		cp libXMP_provide.a $(LIB)/libXMP_provide.a; \
		ranlib $(LIB)/libXMP_provide.a

install-glib:

install-h:;	-@( echo "cp $(XMPINC)/xmp.h $(H)/xmp.h"; \
		cp $(XMPINC)/xmp.h $(H)/xmp.h; \
		echo "cp $(XMPINC)/midas_xmp.h $(H)/midas_xmp.h"; \
		cp $(XMPINC)/midas_xmp.h $(H)/midas_xmp.h; \
		echo "cp $(XMPINC)/msap_u.h $(H)/msap_u.h" ; \
		cp $(XMPINC)/msap_u.h $(H)/msap_u.h)

install-gh:

install-prog:

install-man:;	@(echo "cd man; ./make install-man"; \
			cd man; ./make install-man);

install-gman:

libXMP_provide.a:	$(OFILES)
		ar ruv libXMP_provide.a $(OFILES)
		ranlib libXMP_provide.a

llib-lXMP_provide.ln:	$(CFILES)
		lint -CXMP_provide $(OPTIONS) $(CFILES)

$(OFILES):	$(HFILES)

lint:		l-libXMP_provide

l-libXMP_provide:	
		lint $(LFLAGS) $(CFILES) $(LLIBS) \
		| grep -v "warning: possible pointer alignment problem"

clean:;		rm -f *.o *.a *.ln *.ph core *~

pure:		clean
		rm -f libXMP_provide.a llib-lXMP_provide.ln
