# Makefile - makefile for target/src/scopetools
#
# modification history
# --------------------
# 01b,15jul09,???  Modify for Requirement WIND119168
# 01a,26mar06,c_c   created.
#
# DESCRIPTION
# This file contains the makefile rules for building the scopetools libraries
#
#*/

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

LIB_BASE_NAME   = scopeutils

EXTRA_INCLUDE	=	-I$(TOOLS_SRC_ROOT)/rtilib/include/share
DOC_FILES=	

OBJS=	register.o lexer.o base64.o xmlutils.o y.tab.o
PKG_H=	y.tab.pkg.h lexer.pkg.h register.pkg.h
INDIRECT_SOURCES = y.tab.c

HDR_PATH = ../include
HEADERS = $(HDR_PATH)/eventsxml.h

include $(TOOLS_SRC_ROOT)/make/common_rules.mk

BISON ?= bison

# I haven't found an encapsulated bison app for win32 hosts yet, so
# for now we're not even attempting to generate y.tab.c.
# It also turns out that some solaris machines in Wind do not have bison
# available.  The long term fix should be to provide the bison executable via
# the clearcase environment, but for the short term, we use the pre-generated
# y.tab.* files.

ifeq ($(ENABLE_HEADER_GENERATION),1)
ifeq (x86-linux2,$(WIND_HOST_TYPE))
y.tab.c y.tab.h: parse.y
	$(BISON) -p ST -d parse.y -o y.tab.c
else
y.tab.c: y.tab.c.win32
	$(CP) y.tab.c.win32 y.tab.c
	$(CP) y.tab.h.win32 y.tab.h
endif

LOCAL_CLEAN += y.tab.c y.tab.h
endif

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

$(HDR_PATH)/eventsxml.h : register.c lexer.c base64.c xmlutils.c parse.y
	$(MAKEHEADER) -C $(MAKEHEADERPUBKEYS) -o $@ $^


# end of scopeutils/xml
