#
# RMS Makefile for DIO
#
# $__Header$
#

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

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

NODEPATH = dio/src

# A short name for this node system

NODENAME = DIO

# --------------------------------------------------------------------
#		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 = lobdio.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 = DialogIF.cs \
	WindowObj.cs Event.cs Window.cs Dialog.cs Radio.cs \
	Format.cs Intfield.cs MainWin.cs Table.cs Push.cs Toggle.cs \
	Button.cs Label.cs Datefield.cs Bcdfield.cs Textfield.cs \
	Doublefield.cs Control.cs Stringfield.cs SelectBox.cs \
	SmallSet.cs ComboBox.cs Applic.cs \
	StringList.cs StringSList.cs IdentMap.cs \
	DoiServ.cs DioBasics.cs
GLOBAL_COOL_SPECS =
LOCAL_COOL_SPECS  = Doi.cs DoiMotif.cs DoiBasics.cs
COOL_IMPLS = DialogIF.ci \
	WindowObj.ci Event.ci Window.ci Dialog.ci Radio.ci \
	Format.ci Intfield.ci MainWin.ci Table.ci Push.ci Toggle.ci \
	Button.ci Label.ci Datefield.ci Bcdfield.ci Textfield.ci \
	Doublefield.ci Control.ci Stringfield.ci SelectBox.ci \
	SmallSet.ci ComboBox.ci Applic.ci \
	IdentMap.ci StringList.ci StringSList.ci \
	DoiMotif.ci DoiServ.ci Doi.ci DioBasics.ci
COOL_MODS  =

# C Sources

PUBLIC_C_HDR =
GLOBAL_C_HDR =
LOCAL_C_HDR  =
C_SRC = doiDebug.c doiXifB.c doiXifGP.c doiXifM.c ResHandler.c

# 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 =

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

BASE = /project/cpe/development

# 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

include $(LOCALINCPATH)/general_macros

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

SWITCHES  = -D$(MACHINE) -D$(SYSTEM) -DSYSV

COOLINC   = -d $(LOCALINCPATH)

INCLUDES  = -I$(LOCALINCPATH)

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

PCOOLFLAGS = $(MAKECPPFLAGS)
COOLFLAGS  = $(COOLINC) $(MAKECOOLFLAGS) 
CFLAGS     = $(INCLUDES) $(MAKECFLAGS) $(SWITCHES)
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

# Construction of a shared library would look like:
#$(SHAREDLIBTARGET): $(OBJECTS)
#	$(CC) $(SHLIBGENFLAGS) -o $(SHAREDLIBTARGET) $(OBJECTS)
	
# 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) core

include $(LOCALINCPATH)/general_targets
