#
# RcsID = " $Header: Makefile,v 1.5 98/11/19 17:00:53 taurel Exp $ ";
#
#*********************************************************************
#
# File:          Makefile
#
# Project:      Dataport
#
# Description:  Makefile for dataport libraries for hpux, solaris, sunos,
#		 
#
# Author(s):    A.Gotz
#
# Original:     21/10/96
#
# $Log:	Makefile,v $
# Revision 1.5  98/11/19  17:00:53  17:00:53  taurel (E.Taurel)
# Change optionin co dependency.
# 
# Revision 1.4  98/11/19  16:54:48  16:54:48  taurel (E.Taurel)
# Adapted to new Makefile system using gmake.
# 
# Revision 1.3  98/11/19  10:56:45  10:56:45  goetz (Andy Goetz)
# *** empty log message ***
# 
# Revision 1.2  1996/10/21 17:47:22  goetz
# *** empty log message ***
#
#
# Copyright (c) 1996 by European Synchrotron Radiation Facility
#                       Grenoble, France
#
#**********************************************************************
#

#
#		Makefile to generate the dataport libraries
#

HOME = $(DSHOME)/system/dataport

ifdef __hp9000s700
LIB_DIR = hpux10.2
OS = 700
endif

ifdef _solaris
LIB_DIR = solaris
OS = Solaris
endif

ifdef _UCC
LIB_DIR = ucc
CDEFESRF = /usr/local/os9/dd/DEFS
OS = OS-9 Ultra-C
endif

ifdef linux
LIB_DIR =  linux
OS = Linux
endif


ifdef unix
ifdef _solaris
CFLAGS = -O -Xa -D_solaris -I$(HOME)/include
else
CFLAGS = -O -Aa -D_HPUX_SOURCE -I$(HOME)/include
endif
endif

ifdef _UCC
CFLAGS = -mode=c89 -to osk -tp 020 -eas=. -x il -I $(HOME)/include \
	 -I $(CDEFESRF)
ICODE_CFLAGS = -mode=c89 -to osk -tp 020 -e il -I $(HOME)/include
endif

ifdef linux
CFLAGS  =       -Dlinux -Dunix -D_BSD_SOURCE -D_SVID_SOURCE -ansi \
		-I$(HOME)/include
endif

ifdef unix
AR = ar -rv
endif

#
SRC = dataport_os9.c \
      dataport_ux.c \
      sema.c \
      shared.c 
#
#
all:	libdataport.a
#
#
clean:
	rm -f *.dbg *.stb core  
	rm -f *.r *.o *.ic
#
#
ifdef unix
libdataport.a:	dataport_ux.o sema.o shared.o
	@echo Generating dataport library for $(OS) system
	rm -f $(LIB_DIR)/libdataport.a
	$(AR) $(LIB_DIR)/libdataport.a dataport_ux.o \
	sema.o shared.o
endif

#

ifdef _UCC
libdataport.a:	dataport_os9.o
	@echo Generating dataport library for OS-9 Ultra_C system
	libgen dataport_os9.o -co=$(LIB_DIR)/$@
endif

#
#
dataport_ux.o:	dataport_ux.c
	$(CC)  $(CFLAGS) -c dataport_ux.c
#
#
sema.o:	sema.c
	$(CC)  $(CFLAGS) -c sema.c
#
#
shared.o:	shared.c
	$(CC)  $(CFLAGS) -c shared.c
#
#
ci:	
	ci -u -f -s"Rel" -r$(VERSION) -m"$(LOCKMSG)" $(SRC)
#
#
co:
	co -r$(VERSION) $(SRC)
#
#
lock:
	co -l -r$(VERSION) $(SRC)
#
#
#	For OS-9
#	--------
#
#
dataport_os9.r:	dataport_os9.c
	$(CC) $(CFLAGS) dataport_os9.c
#
#
dataport_os9.o:	dataport_os9.c
	$(CC) $(CFLAGS) dataport_os9.c
#
#
