#
# RMS Makefile for SOI Library
#
# $__Header$
#

# --------------------------------------------------------------------
#		system specification 
# --------------------------------------------------------------------

# Path to this node system relative to the root of the
# repository area defined above (e.g. src/vc/save).

NODEPATH = soi/src/lib

# A short name for this node system

NODENAME = SOI-Library

# --------------------------------------------------------------------
#		the system's components
# --------------------------------------------------------------------

#
# The system (program, library, etc.) to be built. If you want to
# manage multiple programs, you should introduce multiple targets
# (like BIN1TARGET BIN2TARGET or any better names). In this case you 
# have to adjust the system building actions accordingly.

BINTARGET =
LIBTARGET = libSoi.a
SHAREDLIBTARGET =

# Aliases for (filesystem links to) $(BINTARGET).

ALIASES =

# The release number generator. The version number of this file will
# be used as release identifier for the whole system.

VERSIONFILE   = Release.c	# source
VERSIONOBJECT =	Release.o	# derived (if source contains program code)

# The names of the subdirectories containing subsystems which are also
# to be built.

SUBSYSTEMS =

# The regular source and header files.
#
# PUBLIC headers (of a library) would be delivered (INCLUDEPATH) to the user.
# GLOBAL and LOCAL headers wouldn't be installed.

# CPP CooL Sources

PUBLIC_P_COOL_SPECS =
GLOBAL_P_COOL_SPECS =
LOCAL_P_COOL_SPECS  =
P_COOL_IMPLS =
P_COOL_MODS  =

# CooL Sources

PUBLIC_COOL_SPECS = SqlDate.cs SqlDecimal.cs SqlFloat.cs SqlInf.cs \
 		    SqlInteger.cs SqlInterval.cs SqlChar.cs
GLOBAL_COOL_SPECS =
LOCAL_COOL_SPECS  = SoiBasics.cs
COOL_IMPLS = SqlDate.ci SqlDecimal.ci SqlFloat.ci SqlInf.ci \
             SqlInteger.ci SqlInterval.ci SqlChar.ci \
             SoiBasics.ci
COOL_MODS  =

# C Sources

PUBLIC_C_HDR =
GLOBAL_C_HDR =
LOCAL_C_HDR  =
C_SRC =

# Templates

PUBLIC_TMPL =
GLOBAL_TMPL =
LOCAL_TMPL  =

# All sources

HEADERS = $(PUBLIC_P_COOL_SPECS) $(GLOBAL_P_COOL_SPECS) $(LOCAL_P_COOL_SPECS) \
          $(PUBLIC_COOL_SPECS) $(GLOBAL_COOL_SPECS) $(LOCAL_COOL_SPECS) \
          $(PUBLIC_C_HDR) $(GLOBAL_C_HDR) $(LOCAL_C_HDR) \
          $(PUBLIC_TMPL) $(GLOBAL_TMPL) $(LOCAL_TMPL)
SOURCES = $(P_COOL_IMPLS) $(P_COOL_MODS) $(COOL_IMPLS) $(COOL_MODS) $(C_SRC) 

# The manuals

MANUALS = $(MAN1) $(MAN3) $(MAN4) $(MAN5) $(MAN7)
MAN1 =
MAN3 =
MAN4 =
MAN5 =
MAN7 =

# All source components of the system (should not be changed)

COMPONENTS = $(MANUALS) $(HEADERS) $(SOURCES) Shapefile Makefile Dependencies

# The derived files. All files, that are automatically produced during
# a build process should be listed here.

OBJECTS = $(VERSIONOBJECT) \
          $(P_COOL_MODS:.cmp=.o) \
          $(P_COOL_IMPLS:.cip=.o) \
          $(COOL_MODS:.cm=.o) \
          $(COOL_IMPLS:.ci=.o) \
          $(C_SRC:.c=.o)

PUBLIC_HEADERS = \
          $(PUBLIC_P_COOL_SPECS:.csp=.cs) $(PUBLIC_P_COOL_SPECS:.csp=.h) \
          $(PUBLIC_COOL_SPECS) $(PUBLIC_COOL_SPECS:.cs=.h) \
          $(PUBLIC_C_HDR) \
          $(PUBLIC_TMPL)
GLOBAL_HEADERS = \
          $(GLOBAL_P_COOL_SPECS:.csp=.cs) $(GLOBAL_P_COOL_SPECS:.csp=.h) \
          $(GLOBAL_COOL_SPECS) $(GLOBAL_COOL_SPEC:.cs=.h) \
          $(GLOBAL_C_HDR) \
          $(GLOBAL_TMPL)

TMPS    = $(PUBLIC_P_COOL_SPECS:.csp=.cs) $(PUBLIC_P_COOL_SPECS:.csp=.h) \
          $(GLOBAL_P_COOL_SPECS:.csp=.cs) $(GLOBAL_P_COOL_SPECS:.csp=.h) \
          $(LOCAL_P_COOL_SPECS:.csp=.cs) $(LOCAL_P_COOL_SPECS:.csp=.h) \
          $(P_COOL_MODS:.cmp=.cm) $(P_COOL_MODS:.cmp=.h) \
            $(P_COOL_MODS:.cmp=.c) $(P_COOL_MODS:.cmp=.c2m) \
          $(P_COOL_IMPLS:.cip=.ci) $(P_COOL_IMPLS:.cip=.c) \
            $(P_COOL_IMPLS:.cip=.c2m) \
          $(PUBLIC_COOL_SPECS:.cs=.h) \
          $(GLOBAL_COOL_SPECS:.cs=.h) \
          $(LOCAL_COOL_SPECS:.cs=.h) \
          $(COOL_MODS:.cm=.h) $(COOL_MODS:.cm=.c) $(COOL_MODS:.cm=.c2m) \
          $(COOL_IMPLS:.ci=.c) $(COOL_IMPLS:.ci=.c2m)

# --------------------------------------------------------------------
#		environment specifications and locations
# --------------------------------------------------------------------

# The operating system, $(_TARGET) shall be built for.

SYSTEM = s_svr_4

# The processor type.

MACHINE = t_i386

# The object file format

OFILEFMT = o_elf

# The C Compiler

CCOMP = c_att

# The base directory of the project's repository area.

BASE = /project/cpe/development

# Locations and modes for the installation of executables, header
# files, libraries and manuals.

INSTALLBASE    = /project/hoods/V2.0A/wx-541-att
INSTALLBINPATH = $(INSTALLBASE)/bin
INSTALLBINMODE = 555
INSTALLINCPATH = $(INSTALLBASE)/include
INSTALLINCMODE = 444
INSTALLLIBPATH = $(INSTALLBASE)/lib
INSTALLLIBMODE = 444
INSTALLMANPATH = $(INSTALLBASE)/man
INSTALLMANMODE = 444

# Directories, where local libraries and header files are to be
# installed for project wide use.

LOCAL        = $(BASE)
LOCALBINPATH = $(LOCAL)/bin
LOCALBINMODE = 775
LOCALINCPATH = $(LOCAL)/include
LOCALINCMODE = 664
LOCALLIBPATH = $(LOCAL)/lib
LOCALLIBMODE = 664

# --------------------------------------------------------------------
#		tools, flags, libraries etc.
# --------------------------------------------------------------------

# The following macros will be overwritten by the system root makefile

MAKE  = make
SHELL = /bin/sh

COOL  = $(LOCALBINPATH)/cool

CC = /usr/ccs/bin/cc

CPP = /usr/ccs/lib/cpp

MAKECPPFLAGS  = -P
MAKECOOLFLAGS =
MAKECFLAGS    =
MAKELDFLAGS   =

SHLIBGENFLAGS = -G -KPIC

# Preprocessor switches. (eg. -DDEBUG)

SWITCHES =

SYSLIBS  =

RANLIB   = /usr/bin/touch

# The following macros will NOT be overwritten by the system root makefile

COOLINC   = -d $(LOCALINCPATH)

INCLUDES  = -I$(LOCALINCPATH)

LOCALLIBS = $(LOCALLIBPATH)/libColibri.a $(LOCALLIBPATH)/libcool.a

PCOOLFLAGS = $(MAKECPPFLAGS) -D$(MACHINE) -D$(SYSTEM)
COOLFLAGS  = $(COOLINC) $(MAKECOOLFLAGS) 
CFLAGS     = $(INCLUDES) $(MAKECFLAGS) $(SWITCHES) -D$(MACHINE) -D$(SYSTEM)
LDFLAGS    = -L$(LOCALLIBPATH) $(MAKELDFLAGS)

# --------------------------------------------------------------------
#			default targets
# --------------------------------------------------------------------

# The default action (do not change)

all: build

# --------------------------------------------------------------------
#		Dependencies
# --------------------------------------------------------------------

include Dependencies

# --------------------------------------------------------------------
#		implicit rules 
# --------------------------------------------------------------------

include $(LOCALINCPATH)/default_build_rules

# --------------------------------------------------------------------
#		other targets
# --------------------------------------------------------------------

# The final system building action.

targets: $(BINTARGET) $(LIBTARGET) $(SHAREDLIBTARGET)

# Construction of an archive library would look like:
$(LIBTARGET): $(OBJECTS)
	@ar ruv $(LIBTARGET) $(OBJECTS); \
	($(RANLIB) $(LIBTARGET)) 2> /dev/null

# The install actions. 

# Contruction of derived sources (portable binaries)

preinstall:

localinstalltargets: localinstallbin \
		localinstalllib \
		localinstallsharedlib \
		localinstallheaders

installtargets: installbin \
		installlib installsharedlib \
		installheaders installmanuals


# The cleanup action. Removes all automatically rederivable files.

doclean:
	rm -f $(BINTARGET) $(ALIASES) $(LIBTARGET) $(SHAREDLIBTARGET) \
	      $(OBJECTS) $(TMPS)

include $(LOCALINCPATH)/general_targets
