@echo off
rem @(#) 1.17 src/somc/comp/somstars.bat, somc.utils, som3.0 12/17/96 18:34:00 [12/22/96 21:25:46]

rem COMPONENT_NAME: some
rem
rem ORIGINS: 27
rem
rem
rem  25H7912  (C)  COPYRIGHT International Business Machines Corp. 1992,1996,1996  
rem All Rights Reserved
rem Licensed Materials - Property of IBM
rem US Government Users Restricted Rights - Use, duplication or
rem disclosure restricted by GSA ADP Schedule Contract with IBM Corp.

rem Batch file to convert to explicit stars for interface references.
rem If you intend to program with SOM using the C bindings, you
rem need to select one of the two possible forms of C bindings:
rem the strict CORBA-compliant form in which '*'s are NOT exposed
rem in object references, or the C++ form in which '*'s are visible
rem in object references.  This second form is more appropriate if
rem you plan to move your class implementations from C to C++ at
rem some future point.  This choice will determine how object
rem references will appear in all of your C programs.  For example,
rem to declare a reference to an instance of class Foo, you would code
rem either
rem
rem    Foo afoo;    /* Strict CORBA compliant form */
rem
rem or
rem
rem    Foo *afoo;   /* C++ migration or OIDL-compatible form */
rem
rem Depending on your choice of coding style, you must run either
rem the 'somcorba' command (for the CORBA compliant form) or the
rem 'somstars' command (for the C++ form).  These commands will
rem generate an appropriate set of C header files for the classes
rem in the SOMobjects toolkit.  If you decide to use 'somstars',
rem you should also set the SMADDSTAR variable in your local
rem environment.  All subsequent use of the SOM Compiler depends
rem on this environment variable to indicate the use of the
rem 'somstars' style.  For example,
rem
rem     set SMADDSTAR=1
rem
rem If you later decide to switch from one coding style to the
rem other, any C code that you have already written will then
rem need to be converted (by you) to the other form.  Also, if
rem switching from the 'somstars' style to the 'somcorba' style,
rem the SMADDSTAR variable must be removed from your environment.
rem Note that all of the sample C programs provided with the
rem toolkit assume the use of the CORBA-compliant coding style
rem (somcorba).

rem SETLOCAL
IF "%SOMBASE%"=="" GOTO sombase
IF "%SC%"=="" GOTO somsc

IF "%SOMDRIVE%"=="" GOTO body
%SOMDRIVE%

:body
echo Generating the SOM C Bindings:
echo (Warning, these bindings are not CORBA-compliant)
CD %SOMBASE%\include
IF NOT EXIST som.hc GOTO drive:
ATTRIB -R som.h
rem ATTRIB -R gen_c.efw
rem ATTRIB -R gen_ew16.efw
rem ATTRIB -R gen_mw16.efw
COPY som.hs       som.h > NUL
rem COPY gen_c.efs    gen_c.efw  > NUL
rem COPY gen_ew16.efs gen_ew16.efw  > NUL
rem COPY gen_mw16.efs gen_mw16.efw > NUL
IF EXIST somcorba.bld DEL somcorba.bld
SET SMNOADDSTAR=
%SC% -%% -maddstar -mwinmult -mnochk -sh *.idl
IF NOT ERRORLEVEL 0 GOTO end
echo somstars.bld > somstars.bld
IF EXIST somdtype.idl %SC% -maddstar -mwinmult -mnochk -sh -DEMIT_SOMDTYPES somdtype.idl
GOTO end

:sombase
    ECHO SOMBASE should be set before running somstars.
    GOTO end

:somsc
    ECHO SC should be set before running somstars.
    GOTO end

:drive
    ECHO SOM is not installed on the current drive, please set SOMDRIVE.

:end
    rem ENDLOCAL
