# $Id: Rules.bgpm,v 1.1 2011/03/11 23:06:54 jagode Exp $

ifneq ($(USE_DEBUG),)
   BGPM_LIBNAME = bgpm_debug
   DEBUG_BGPM = "-DDEBUG_BGPM"
else
   BGPM_LIBNAME = bgpm
endif


BGPM_OBJS=$(shell $(AR) t $(BGPM_INSTALL_DIR)/bgpm/lib/lib$(BGPM_LIBNAME).a && $(AR) 2>/dev/null)

MISCOBJS = $(BGPM_OBJS) $(MISCSRCS:.c=.o)

include Makefile.inc

CFLAGS += -I$(BGPM_INSTALL_DIR) -I$(BGPM_INSTALL_DIR)/spi/include/kernel/cnk $(DEBUG_BGPM)
LDFLAGS += $(BGPM_INSTALL_DIR)/bgpm/lib/lib$(BGPM_LIBNAME).a -lrt -lstdc++ 


$(BGPM_OBJS):
	$(AR) xv $(BGPM_INSTALL_DIR)/bgpm/lib/lib$(BGPM_LIBNAME).a

