# Makefile
# This file holds the make rules for the libysnmp
DEBUG :=

CXX  := @CXX@ -Wall
AR  := ar
DEFS :=
INCLUDES := -I@top_srcdir@ -I../.. -I@top_srcdir@/libs/yasn -I@srcdir@
CFLAGS := @CFLAGS@ @MODULE_CPPFLAGS@ @INLINE_FLAGS@
LDFLAGS:= @LDFLAGS@ -lyate
INCFILES := @top_srcdir@/yateclass.h @top_srcdir@/libs/yasn/yateasn.h @srcdir@/yatesnmp.h

PROGS=
LIBS = libysnmp.a
OBJS = snmp.o

LOCALFLAGS =
LOCALLIBS =
COMPILE = $(CXX) $(DEFS) $(DEBUG) $(INCLUDES) $(CFLAGS)
LINK = $(CXX) $(LDFLAGS)

prefix = @prefix@
exec_prefix = @exec_prefix@

# include optional local make rules
-include YateLocal.mak

.PHONY: all debug ddebug xdebug
all: $(LIBS) $(LIBD) $(PROGS)

debug:
	$(MAKE) all DEBUG=-g3 MODSTRIP=

ddebug:
	$(MAKE) all DEBUG='-g3 -DDEBUG' MODSTRIP=

xdebug:
	$(MAKE) all DEBUG='-g3 -DXDEBUG' MODSTRIP=

.PHONY: strip
strip: all
	strip --strip-debug --discard-locals $(PROGS)

.PHONY: clean
clean:
	@-$(RM) $(PROGS) $(LIBS) $(LIBD) $(OBJS) core 2>/dev/null

%.o: @srcdir@/%.cpp $(INCFILES)
	$(COMPILE) -c $<

Makefile: @srcdir@/Makefile.in ../../config.status
	cd ../.. && ./config.status

libysnmp.a: $(OBJS)
	$(AR) rcs $@ $^
