| 1 |
prefix=/usr/local |
| 2 |
exec_prefix=$(prefix) |
| 3 |
libdir=$(exec_prefix)/lib |
| 4 |
|
| 5 |
|
| 6 |
OPUSENC?=1 |
| 7 |
|
| 8 |
CFLAGS=-pthread -D_FORTIFY_SOURCE=2 -fPIC |
| 9 |
DEBUG=-g3 |
| 10 |
OPTIMIZE=-O3 |
| 11 |
CPPFLAGS= |
| 12 |
DEFS= |
| 13 |
INSTALL=/usr/bin/install -c |
| 14 |
LDFLAGS=-pthread -Wl,--warn-common |
| 15 |
LIBS= |
| 16 |
SHELL=/bin/sh |
| 17 |
|
| 18 |
ASTMODDIR=$(libdir)/asterisk/modules |
| 19 |
MODULES=codec_opus_open_source format_ogg_opus_open_source format_vp8 res_format_attr_opus |
| 20 |
|
| 21 |
.SUFFIXES: .c .so |
| 22 |
|
| 23 |
.PHONY: all clean install uninstall $(MODULES) |
| 24 |
|
| 25 |
all: $(MODULES) |
| 26 |
|
| 27 |
clean: |
| 28 |
rm -f */*.so |
| 29 |
|
| 30 |
install: $(MODULES) |
| 31 |
$(INSTALL) -D -t $(DESTDIR)$(ASTMODDIR) */*.so |
| 32 |
|
| 33 |
uninstall: |
| 34 |
cd $(ASTMODDIR) && rm -f $(addsuffix .so,$(MODULES)) |
| 35 |
|
| 36 |
codec_opus_open_source: LIBS+=-lopus |
| 37 |
codec_opus_open_source: DEFS+=-DAST_MODULE=\"codec_opus_open_source\" \ |
| 38 |
-DAST_MODULE_SELF_SYM=__internal_codec_opus_open_source_self |
| 39 |
codec_opus_open_source: codecs/codec_opus_open_source.so |
| 40 |
|
| 41 |
format_ogg_opus_open_source: CPATH+=-I/usr/include/opus |
| 42 |
format_ogg_opus_open_source: LIBS+=-lopus -lopusfile |
| 43 |
format_ogg_opus_open_source: DEFS+=-DAST_MODULE=\"format_ogg_opus_open_source\" \ |
| 44 |
-DAST_MODULE_SELF_SYM=__internal_format_ogg_opus_open_source_self |
| 45 |
ifeq ($(OPUSENC),1) |
| 46 |
format_ogg_opus_open_source: LIBS+=-lopusenc |
| 47 |
format_ogg_opus_open_source: DEFS+=-DHAVE_OPUSENC |
| 48 |
endif |
| 49 |
format_ogg_opus_open_source: formats/format_ogg_opus_open_source.so |
| 50 |
|
| 51 |
format_vp8: DEFS+=-DAST_MODULE=\"format_vp8\" \ |
| 52 |
-DAST_MODULE_SELF_SYM=__internal_format_vp8_self |
| 53 |
format_vp8: formats/format_vp8.so |
| 54 |
|
| 55 |
res_format_attr_opus: DEFS+=-DAST_MODULE=\"res_format_attr_opus\" \ |
| 56 |
-DAST_MODULE_SELF_SYM=__internal_res_format_attr_opus_self |
| 57 |
res_format_attr_opus: res/res_format_attr_opus.so |
| 58 |
|
| 59 |
.c.so: |
| 60 |
$(CC) -o $@ $(CPATH) $(DEFS) $(CPPFLAGS) $(CFLAGS) $(DEBUG) $(OPTIMIZE) $(LIBS) -shared $(LDFLAGS) $< |