home *** CD-ROM | disk | FTP | other *** search
/ SGI Hot Mix 17 / Hot Mix 17.iso / HM17_SGI / research / external / rpc / Makefile < prev    next >
Encoding:
Makefile  |  1997-07-08  |  5.3 KB  |  177 lines

  1. #    $Id: Makefile,v 1.9 1997/01/29 23:25:26 kirk Exp $
  2. #
  3. #
  4. #  Copyright (c) 1988-1997, Research Systems Inc.  All rights reserved.
  5. #  This software includes information which is proprietary to and a
  6. #  trade secret of Research Systems, Inc.  It is not to be disclosed
  7. #  to anyone outside of this organization. Reproduction by any means
  8. #  whatsoever is  prohibited without express written permission.
  9. #
  10. #
  11. # makefile for new rpc routines.
  12. #
  13. # Purpose:
  14. #     This makefile is used to build the routines that make up
  15. #    the IDL rpc system.
  16. #
  17. # Edits:
  18. #     The following macro might need to be edited if the location
  19. #    of IDL is not the standard location on your system.
  20.  
  21. IDL_DIR = /usr/local/rsi/idl
  22.  
  23. # Define macros used in the makefile.
  24.  
  25. SERVER_OBJS = rpc_srvr.o rpc_tout.o
  26. CLIENT_OBJ  = rpc_clnt.o 
  27.  
  28.  
  29. # The following macros are defined when this file recurses and should 
  30. # not be edited since they are overridden at run time.
  31.  
  32. LD_SYS_PRE     =
  33. LD_SYS_POST     =   
  34. FLAGS         = 
  35. C_FLAGS        = -c $(FLAGS)
  36. LD         = ld
  37. CC        = cc
  38. SHELL        = /bin/sh
  39.  
  40. # The following macro is used to define sub-directory of the IDL_DIR/bin
  41. # directory for the system the file run on.
  42.  
  43. BIN_DIR     = 
  44.  
  45. # Some systems (sun os) use flags to specify dynamic libs and static ones
  46. # during link time.
  47.  
  48. BDYNAMIC    =
  49. BSTATIC        =
  50. SO_VERSION     = 
  51. SHL_EXTENSION    =so
  52. SHL_LD_FLAGS    =
  53.  
  54. TEST_POST    =
  55.  
  56. LD_LIBRARY_PATH = .
  57.  
  58. # build the loader flags that are required to build the idlrpc executable.
  59. # If this is a sun system you will need to have motif installed!
  60.  
  61. LD_FLAGS = $(LD_SYS_PRE) -L$(IDL_DIR)/bin/$(BIN_DIR) -lidl \
  62.     $(LD_SYS_POST) $(BSTATIC) -lXm -lXt -lXext -lX11 $(BDYNAMIC) -ltermcap -lm 
  63.  
  64. # The following is the default entry point. This section will determine 
  65. # what system we are on and call make again with the correct flags set.
  66.  
  67. all : 
  68.     @echo "OS type detected: "`uname`
  69.     @case `uname` in \
  70.        "SunOS") if [ -d /proc -a `mach` = i386 ]; then \
  71.                    make rpclib "FLAGS=-DSOLARIS -Xa -xlibmieee" \
  72.             "LD_SYS_PRE=-L/usr/openwin/lib -L/usr/dt/lib -R.:/usr/dt/lib" \
  73.             "LD_SYS_POST= -lnsl -lintl -lgen  -lsunmath" \
  74.             "SHL_CFLAGS=-K pic" \
  75.             "SHL_LD_FLAGS=-Bsymbolic -z nodefs -R . -G" \
  76.             "TEST_LD_FLAGS= -z defs -i -R . -L." \
  77.             "TEST_POST=-lnsl" \
  78.             "BIN_DIR=bin.solaris2.x86"; \
  79.                   elif [ -d /proc ]; then \
  80.                    make rpclib "FLAGS= -DSOLARIS" \
  81.             "LD_SYS_PRE=-L/usr/openwin/lib -L/usr/dt/lib -R.:/usr/dt/lib" \
  82.             "LD_SYS_POST= -lnsl -lsunmath" \
  83.             "SHL_CFLAGS=-K pic" \
  84.             "SHL_LD_FLAGS=-Bsymbolic -z nodefs -R . -G" \
  85.             "TEST_LD_FLAGS= -z defs -i -R . -L." \
  86.             "TEST_POST=-lnsl" \
  87.             "BIN_DIR=bin.solaris2.sparc"; \
  88.             else \
  89.                     make rpclib "CC=acc" \
  90.             "LD_SYS_PRE=$(IDL_DIR)/bin/bin.sunos.4.1/idl.o -L/usr/local/IXImd12x/lib" \
  91.             "BDYNAMIC=-Bdynamic" \
  92.             "BSTATIC=-Bstatic" \
  93.             "SHL_CFLAGS= -PIC" \
  94.             "LD_SYS_POST=-lMesaaux -lMesatk -lMesaGLU -lMesaGL" \
  95.             "SHL_LD_FLAGS= -assert pure-text" \
  96.             "TEST_LD_FLAGS=-L. -Bdynamic" \
  97.             "SO_VERSION=.5.0" \
  98.             "BIN_DIR=bin.sunos.4.1"; \
  99.                fi  \
  100.         ;; \
  101.        "AIX") make rpclib \
  102.             "LD=cc" \
  103.             "SHL_EXTENSION=a" \
  104.             "SHL_LD_FLAGS= -bM:SRE -bE:idl_rpc.export -bnoentry" \
  105.             "TEST_LD_FLAGS=-L." \
  106.             "BIN_DIR=bin.ibm" ;; \
  107.        "HP-UX") make rpclib  \
  108.             "FLAGS=-Aa -D_HPUX_SOURCE" \
  109.             "LD_SYS_PRE= -Wl,+b,. -Wl,+s -Wl,-E -L. -L/usr/lib/X11R5 -L/usr/lib/Motif1.2" \
  110.             "LD_SYS_POST= -lidl_cdf -lidl_netcdf -lidl_hdf -lMesaaux -lMesatk -lMesaGLU -lMesaGL -lcurses -lM -lcl -ldld" \
  111.             "BIN_DIR=bin.hp" \
  112.             "SHL_CFLAGS=+z" \
  113.             "SHL_LD_FLAGS= -b -Brestricted +b . +s" \
  114.             "SHL_EXTENSION= sl" \
  115.             "TEST_LD_FLAGS= -Wl,+b,. -Wl,+s -L.";; \
  116.        "IRIX" )  make rpclib "BIN_DIR=bin.sgi" \
  117.             "SHL_CFLAGS=-KPIC" \
  118.             "SHL_LD_FLAGS=-Bsymbolic -shared" \
  119.             "TEST_LD_FLAGS=-L. -rpath ." \
  120.             "LD_SYS_POST= /usr/lib/fixade.o -lidl_gmalloc -lfpe";; \
  121.        "OSF1" )  make rpclib "BIN_DIR=bin.alpha" \
  122.             "SHL_LD_FLAGS=-expect_unresolved '*' -shared" \
  123.             "TEST_LD_FLAGS=-L. -Wl,-rpath,." \
  124.             "FLAGS= -float";; \
  125.        "Linux" ) make rpclib \
  126.             "LD_SYS_PRE=$(IDL_DIR)/bin/bin.linux/idl.o -L/usr/X11R6/lib" \
  127.             "SHL_CFLAGS= -fPIC" \
  128.             "LD_SYS_POST=-Wl,-rpath,.  -lidl_cdf -lidl_netcdf -lidl_hdf -lMesaaux -lMesatk -lMesaGLU -lMesaGL" \
  129.             "SHL_LD_FLAGS= -shared" \
  130.             "TEST_LD_FLAGS=-L. -Wl,-rpath,." \
  131.             "BIN_DIR=bin.linux";; \
  132.        *) echo "This system is not supported" ;; \
  133.        esac
  134.  
  135. # The following is the entry point that triggers the actuall build 
  136.  
  137. rpclib: idlrpc  libidl_rpc.$(SHL_EXTENSION)$(SO_VERSION) idl_rpc_test \
  138.         idl_rpc_obsolete.o example
  139.  
  140. idlrpc: $(SERVER_OBJS)
  141.     rm -f rpc_xdr.o
  142.     $(CC) $(C_FLAGS) rpc_xdr.c
  143.     $(CC) -o idlrpc $(SERVER_OBJS) rpc_xdr.o $(LD_FLAGS)
  144.     rm -f rpc_xdr.o
  145.  
  146. # Build the client API shared library. 
  147.  
  148. libidl_rpc.$(SHL_EXTENSION)$(SO_VERSION): rpc_clnt.o
  149.     $(CC) $(C_FLAGS) $(SHL_CFLAGS) -DIDL_RPC_CLIENT rpc_xdr.c 
  150.     $(LD) $(SHL_LD_FLAGS) -o libidl_rpc.$(SHL_EXTENSION)$(SO_VERSION) \
  151.             rpc_clnt.o rpc_xdr.o 
  152.  
  153. rpc_clnt.o:
  154.     $(CC) $(C_FLAGS) $(SHL_CFLAGS) rpc_clnt.c
  155.  
  156. # Build the testing routine.
  157.  
  158. idl_rpc_test: idl_rpc_test.o
  159.     $(CC) -o idl_rpc_test $(TEST_LD_FLAGS) idl_rpc_test.o \
  160.             -lidl_rpc $(TEST_POST)
  161.  
  162. example : example.o
  163.     $(CC) -o example $(TEST_LD_FLAGS) example.o \
  164.             -lidl_rpc $(TEST_POST)
  165.  
  166. tidy: 
  167.     rm -f $(CLIENT_OBJS) $(SERVER_OBJS)
  168. clean : 
  169.     rm -f libidl_rpc.* idlrpc $(SERVER_OBJS) rpc_clnt.o example.o \
  170.         rpc_xdr.o idl_rpc_test idl_rpc_test.o idl_rpc_obsolete.o
  171.  
  172. .SUFFIXES: .c .o
  173.  
  174. .c.o :
  175.     $(CC) $(C_FLAGS) $*.c
  176.  
  177.