# Makefile
# This file holds the make rules for the libyatesip

DEBUG :=

CXX  := @CXX@ -Wall
AR  := ar
DEFS :=
INCLUDES := -I@top_srcdir@ -I../.. -I@srcdir@
CFLAGS := @CFLAGS@ @MODULE_CPPFLAGS@ @INLINE_FLAGS@
LDFLAGS:= @LDFLAGS@
YATELIBS := -L../.. -lyate @LIBS@
INCFILES := @top_srcdir@/yatemime.h @top_srcdir@/yatephone.h @srcdir@/yatesdp.h

PROGS=
LIBS = libyatesdp.a
OBJS = media.o session.o parser.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) $(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) $(OBJS) core 2>/dev/null

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

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

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