#*********************************************************************
#
# File:          Makefile 
#
# Project:       Type conversion library
#
# Description:   GNU Makefile for building the test application
#
# Author(s):     Faranguiss Poncet
#
# Original:   	 January 1997
#
# $Revision: 1.8 $                              $Author: poncet $
# $Date: 98/06/12 11:47:28 $			$State: Rel $
#
# $Log:	Makefile,v $
# Revision 1.8  98/06/12  11:47:28  11:47:28  poncet (F.Poncet)
# Added "DevMulMove" type for conversion to string (Maxe dev server).
# 
# Revision 1.7  98/06/10  14:33:25  14:33:25  poncet (F.Poncet)
# Added the conversion for (DevMotorLong to string) and (DevMotorFloat
# to string) in the library and the associated test code in test prog.
# 
# Revision 1.6  97/04/10  10:15:39  10:15:39  poncet (F.Poncet)
# Changed link flags such as to link first with ../lib/$(OS) before searching
# for $(DSHOME)/lib/$(OS).
# 
# Revision 1.5  97/03/21  14:05:04  14:05:04  poncet (F.Poncet)
# File unchanged. Archived for compatible revision numbers with libtcapi
# 
# Revision 1.4  97/01/21  15:40:56  15:40:56  poncet (F.Poncet)
# File unchanged. Archived for compatible revision numbers.
# 
# Revision 1.3  97/01/20  17:25:41  17:25:41  poncet (F.Poncet)
# Makefile converted to GNU Multi-plateform Makefile. To be called by gmake.
# 
# Revision 1.2  97/01/10  11:36:08  11:36:08  poncet (F.Poncet)
# File unchanged. Archived for compatible revision number.
# 
# Revision 1.1  96/11/25  18:12:13  18:12:13  poncet (F.Poncet)
# Initial revision
# 
#
#
# Copyright (c) 1997 by European Synchrotron Radiation Facility,
#                       Grenoble, France
#
#**********************************************************************
#

#---------------------------------------------------------------------
#	This Makefile works with the GNU make (sometimes called gmake)
#	It makes use of the GNU make conditional statements to support
#	multiple platforms. To use this makefile for a particular platform
#	call GNU make with the appropriate symbol for that platform
#	defined e.g. "gmake __hp9000s700=1 unix=1 all". The following symbols
#	are used to identify the following platforms :
#
#	__hp9000s700	=	HPUX 9000 series 700 
#	_solaris	=	Solaris 
#	sun		=	SunOS
#	_UCC		=	OS9 Fastrak Ultra-C Compiler
#	unix		=	various unix flavours (Solaris, HPUX, Lynx, Linux)
#	lynx		=	LynxOS
#	
#--------------------------------------------------------------------
#
#       The variables DSHOME is set inside this Makefile. So it does
#       not use your own environment varaible $DSHOME.
#
#       Only TWO plateforms are supported in this Makefile : Hpux and Solaris
#
#
#--------------------------------------------------------------------
#
DSHOME	= /segfs/dserver


ifdef __hp9000s700
LIB_HOME     =  $(DSHOME)/lib/hpux10.2
endif
ifdef _solaris
LIB_HOME     =  $(DSHOME)/lib/solaris
endif


#---------------------------------------------------------------------
# All include file and standard library pathes
#
#		make sure to get always the new include files 
#		under ../include
#

INCLDIRS =  	-I ../include \
		-I $(DSHOME)/include

#---------------------------------------------------------------------
# All necessary compiler flags for UNIX
#
#                	Libraries


NAME =	-o 


ifdef __hp9000s700
CC      =	/bin/cc
LIBDIRS =	-L ../lib/hpux10.2 -L $(LIB_HOME)
CFLAGS  =	-Aa -g -DEBUG -Dunix -D_HPUX_SOURCE -c $(INCLDIRS)
LFLAGS =	$(LIBDIRS) -ldsapi -ldbapi -ldsxdr -ldsxdr_all -ldld
endif

ifdef _solaris
CC      =	/opt/SUNWspro/bin/cc
LIBDIRS =	-L ../lib/solaris -L $(LIB_HOME)
CFLAGS  =	-Xa -g -Dsolaris -DEBUG -c $(INCLDIRS)
LFLAGS =	$(LIBDIRS) -ldsapi -ldbapi -ldsxdr -ldsxdr_all -ldl
endif




#---------------------------------------------------------------------
# RCS options to lock and check out a version.
# Or to check in a new version.
#
#
#    call format :
#
#         gmake __hp9000s700=1 unix=1 VERSION=y.xx LOGMSG=.... RCSCI
#         gmake __hp9000s700=1 unix=1 VERSION=y.xx RCSCO
#         gmake __hp9000s700=1 unix=1 VERSION=y.xx RCSLOCK
#

#               RCS lock options
RCSLOCK =      	co -l -r$(VERSION)
#               RCS check out options
RCSCO   =      	co -r$(VERSION)
#               RCS check in options
RCSCI   =      	ci -u -f -s"Rel" -r$(VERSION) -m"$(LOCKMSG)"


#               all include files
INCL     =	tc_api.h \
		tc_str.h

#               source files
SRC	 =	test_tc.c Makefile

#               object files for archive library
OBJS	=	test_tc.o



#--------------------------------------------------------------------
# What has to be made
#
#		The application to test the libtcapi library

APPLI =	test_tc



#---------------------------------------------------------------------
# build libraries
#

	
all:		$(APPLI)



test_tc :	$(OBJS)
		$(CC) $(NAME) $@ $(OBJS) $(LFLAGS)



clean:	
		-rm -f $(OBJS) 


clobber:	clean
		-rm -f $(APPLI)


lock:
		$(RCSLOCK) $(SRC)

co:
		$(RCSCO) $(SRC)

ci:
		$(RCSCI) $(SRC)

