#
# 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 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

CFILES  =       print_res.c M_Get_u.c M_General.c M_Get_u_s.c M_InitReq_u.c \
                M_Set_u.c M_Set_u_s.c M_TermReq_u.c \
                M_Create_u.c M_Create_u_s.c M_Delete_u.c M_Delete_u_s.c \
                M_CancelGet_u.c M_Action_u.c M_Action_u_s.c \
                M_Wait_u.c GMD_InitReq_u.c assoc_fail_u.c \
		session_manage.c

OFILES  =       print_res.o M_Get_u.o M_General.o M_Get_u_s.o M_InitReq_u.o \
                M_Set_u.o M_Set_u_s.o M_TermReq_u.o \
                M_Create_u.o M_Create_u_s.o M_Delete_u.o M_Delete_u_s.o \
                M_CancelGet_u.o M_Action_u.o M_Action_u_s.o \
                M_Wait_u.o GMD_InitReq_u.o assoc_fail_u.o \
		session_manage.o

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


all:		lib

lib:		libXMP_use.a

glib:		lib

install:	install-h install-lib

install-lib:	libXMP_use.a # debug_test.o
		@echo "cp libXMP_use.a $(LIB)/libXMP_use.a; \
		ranlib $(LIB)/libXMP_use.a";\
		cp libXMP_use.a $(LIB)/libXMP_use.a; \
		ranlib $(LIB)/libXMP_use.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_use.a:	$(OFILES)
		ar ruv libXMP_use.a $(OFILES)
		ranlib libXMP_use.a

llib-lXMP_use.ln:	$(CFILES)
		lint -CXMP_use $(OPTIONS) $(CFILES)

$(OFILES):	$(HFILES)

lint:		l-libXMP_use

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

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

pure:		clean
		rm -f libXMP_use.a llib-lXMP_use.ln
