# Makefile - makefile for building stethoscope runtime
#
# modification history
# --------------------
# 01b,15jul09,???  Modify for Requirement WIND119168
# 01a,10apr08,pca  created.
#
# DESCRIPTION
# This file contains the makefile rules for building the stethoscope runtime
# libraries
#
#*/

TGT_DIR=$(WIND_BASE)/target
TOOLS_SRC_ROOT = ../..

DOC_FILES     =

#TD: avoid having to have all the children Makefiles by using vpath here
#vpath %.c	$(CURDIR)/data:./daemons
LIB_BASE_NAME =	stethoscope

#OBJS		= databuffer.o genbuffer.o link.o

SUBDIRS	= data probeapi interfaces daemons signal

HDR_PATH = include

HEADERS = $(HDR_PATH)/scopestream.h $(HDR_PATH)/scopeconfig.h \
	$(HDR_PATH)/genbuffer.h $(HDR_PATH)/databuffer.h \
	$(HDR_PATH)/signals.h $(HDR_PATH)/daemons.h $(HDR_PATH)/probe.h \
	$(HDR_PATH)/scope_link.h $(HDR_PATH)/scope_rtv.h $(HDR_PATH)/siginstall.h \
	../include/share/scope/scope.h $(HDR_PATH)/streamcommon.h \
	$(HDR_PATH)/signalapi.h $(HDR_PATH)/signalheader.h


MAKEHEADERDATA = $(TOOLS_SRC_ROOT)/make/makeheader/$(WIND_HOST_TYPE)/makeheader*

ifeq ($(wildcard $(MAKEHEADERDATA)),)
include $(TOOLS_SRC_ROOT)/make/common_rules.mk
else
Default: headers

include $(TOOLS_SRC_ROOT)/make/common_rules.mk

# Public header generation (needs to occur after inclusion of rules.library,
# otherwise it hides the default build rule).

# Short cut to avoid rewriting makeheader rules for each h file
# Internal command line exports Public and Peer
MHEADERCMDLINE_INTERNAL = $(MAKEHEADER) -C $(MAKEHEADERPKGKEYS) -o $@ $^
MHEADERCMDLINE_USER    = $(MAKEHEADER) -C -k Public -o $@ $^

$(HDR_PATH)/scopestream.h : interfaces/streamcommon.c interfaces/interface_tcp.c
	$(MKDIR) $(HDR_PATH)
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/scopeconfig.h : common/scopeconfig.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/genbuffer.h : data/genbuffer.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/databuffer.h : data/databuffer.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/signals.h : signal/signalheader.c signal/signalmanager.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/daemons.h : daemons/scopedaemon.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/probe.h : daemons/probe.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/scope_link.h : daemons/link.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/scope_rtv.h : probeapi/rtv.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/siginstall.h : daemons/siginstall.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/streamcommon.h : interfaces/streamcommon.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/signalapi.h : probeapi/signalapi.c
	$(MHEADERCMDLINE_INTERNAL)

$(HDR_PATH)/signalheader.h : signal/signalheader.c
	$(MHEADERCMDLINE_INTERNAL)

../include/share/scope/scope.h: common/scopeconfig.c signal/signalmanager.c \
                                        probeapi/signalapi.c probeapi/collectapi.c probeapi/generalapi.c \
                                        probeapi/eventsapi.c probeapi/signalinstallapi.c
	$(MKDIR) ../include/share/scope
	$(MHEADERCMDLINE_USER)
endif


