#*************************************************************************
# Copyright (c) 2002 The University of Chicago, as Operator of Argonne
#     National Laboratory.
# Copyright (c) 2002 The Regents of the University of California, as
#     Operator of Los Alamos National Laboratory.
# EPICS BASE Versions 3.13.7
# and higher are distributed subject to a Software License Agreement found
# in file LICENSE that is included with this distribution. 
#*************************************************************************
#	base/src/gdd/Makefile.Host
#

TOP= ../../..
include $(TOP)/config/CONFIG_BASE

INC += gdd.h
INC += gddI.h
INC += gddContainer.h
INC += gddContainerI.h
INC += gddArray.h
INC += gddScalar.h
INC += gddSemaphore.h
INC += gddNewDel.h
INC += gddUtils.h
INC += gddUtilsI.h
INC += gddErrorCodes.h
INC += aitTypes.h
INC += aitConvert.h
INC += aitHelpers.h
INC += dbMapper.h
INC += gddAppTable.h
INC += gddAppFuncTable.h
INC += gddApps.h
INC += smartGDDPointer.h

AITGENSRCS := gdd.cc gddTest.cc gddAppTable.cc gddNewDel.cc \
	gddAppDefs.cc aitTypes.c aitConvert.cc aitHelpers.cc  \
	gddArray.cc gddContainer.cc gddErrorCodes.cc gddUtils.cc

LIBSRCS := gdd.cc gddTest.cc gddAppTable.cc gddNewDel.cc \
	gddAppDefs.cc aitTypes.c aitConvert.cc aitHelpers.cc dbMapper.cc \
	gddArray.cc gddContainer.cc gddErrorCodes.cc gddUtils.cc \
	smartGDDPointer.cc

LIBRARY := gdd

LIBTYPE := SHARED

gdd_RCS_WIN32 = gdd.rc

include $(TOP)/config/RULES.Host

# cannot generate these dependencies automatically
#
# Problem: Some dependencies are include files that may
#	not have been installed if we are building for
#	the first time
#	-> use explicit reference to the uninstalled files in '..'
aitConvert$(OBJ): ../aitConvert.cc aitConvertGenerated.cc\
		../aitConvert.h ../aitTypes.h


dbMapper.cc:	../gdd.h ../gddI.h ../gddContainer.h ../gddContainerI.h \
		../gddArray.h ../gddScalar.h ../gddAppTable.h ../dbMapper.h \
		gddApps.h ../aitTypes.h  ../gddUtils.h ../gddUtilsI.h

# Rules for generated files
#
aitConvertGenerated.cc: aitGen$(EXE) ../aitTypes.h
	./aitGen$(EXE)

gddApps.h : genApps$(EXE)
	./genApps$(EXE) $@

# unfortunately there is only one TESTPROD/TESTPROD_SRCS allowed
# right now
# (or many 'simple' progs:
#  TESTPROD:=a b c
#  where a is build from a.cc,   b from b.cc, c from c.cc
# )
#
# This rule, however, should be system-independent:
ifeq ($(HOST_ARCH),Borland)

aitGen$(EXE): aitGen$(OBJ) aitTypes$(OBJ)
	$(LINK.c) $^ , $@ ,,$(LINKLIBS)

genApps$(EXE): genApps$(OBJ) $(addsuffix $(OBJ), $(basename $(AITGENSRCS)))
	$(LINK.cc) $^ , $@ ,,$(LINKLIBS)

else
aitGen$(EXE): aitGen$(OBJ) aitTypes$(OBJ)
	$(LINK.c) $^ 

genApps$(EXE): genApps$(OBJ) $(addsuffix $(OBJ), $(basename $(AITGENSRCS)))
	$(LINK.cc) $^ 

clean::
	$(RM) aitConvertGenerated.cc aitGen$(EXE) genApps$(EXE)

endif #Borland
#	EOF base/src/gdd/Makefile.Host
