include ../../Config.mk

SUBDIRS    	 = 
LIBSRCS    	 = lex.pp_cd_yy.c \
		   cdlparser.tab.c \
		   cd.c \
	           as_op_print.c \
		   as_op_semcheck.c \
		   as_op_tagsec.c \
		   as_op_validate.c

ifeq ($(PP_PRODUCT),pemx)
LIBSRCS +=         as_op_get_qid.c \
                   as_op_type_compare.c
endif

LIB_NAME	 = libpp_cd
SHARED_LIB_MAJOR = 1
SHARED_LIB_MINOR = 0
SHARED_LIB = $(LIB_NAME).so.$(SHARED_LIB_MAJOR).$(SHARED_LIB_MINOR)
FLEX = $(FW_TOPDIR)/bin/flex

include $(PP_BUILD_SYS_DIR)/Top.mk

clean-local::
	rm -f cdlparser.tab.c cdlparser.tab.h lex.pp_cd_yy.c

cdlparser.tab.c cdlparser.tab.h: cdlparser.y
	bison -p pp_cd_yy -d $<

lex.pp_cd_yy.c: cdlparser.tab.h cdlparser.l
	$(FLEX) -Ppp_cd_yy cdlparser.l

cdlparser.tab.o lex.pp_cd_yy.o: cdlparser.tab.h include/pp/cd.h
