I originally derived the Makefile from one found randomly on the net. But now, I rewrote it based on the one found in Asterisk tree. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>master
parent
8c2ece4514
commit
df369009fa
@ -1,3 +1,4 @@
|
||||
*.o
|
||||
*.o.d
|
||||
*.so
|
||||
.*.swp
|
||||
|
@ -1,30 +1,48 @@
|
||||
ASTSRC?=../asterisk
|
||||
|
||||
-include $(ASTSRC)/menuselect.makeopts $(ASTSRC)/menuselect.makedeps
|
||||
|
||||
LOADABLE_MODS=chan_openbsc
|
||||
|
||||
ASTTOPDIR=$(ASTSRC)
|
||||
INCLUDE=-I$(ASTSRC)/include -I/usr/local/include
|
||||
|
||||
# Asterisk configure options
|
||||
ifneq ($(wildcard $(ASTSRC)/makeopts),)
|
||||
include $(ASTSRC)/makeopts
|
||||
endif
|
||||
|
||||
ifeq ($(OSARCH),SunOS)
|
||||
ASTLIBDIR=/opt/asterisk/lib
|
||||
# Need to replicate some of the Asterisk top makefile logic
|
||||
# CFLAGS
|
||||
_ASTCFLAGS:=-I$(ASTTOPDIR)/include $(CONFIG_CFLAGS) $(COPTS)
|
||||
_ASTLDFLAGS:=$(CONFIG_LDFLAGS) $(LDOPTS)
|
||||
|
||||
# Link of shared objects
|
||||
ifneq ($(findstring darwin,$(OSARCH)),)
|
||||
_ASTCFLAGS+=-D__Darwin__
|
||||
SOLINK=-dynamic -bundle -Xlinker -macosx_version_min -Xlinker 10.4 -Xlinker -undefined -Xlinker dynamic_lookup -force_flat_namespace
|
||||
else
|
||||
ASTLIBDIR=$(libdir)/asterisk
|
||||
# These are used for all but Darwin
|
||||
SOLINK=-shared
|
||||
ifneq ($(findstring BSD,$(OSARCH)),)
|
||||
_ASTLDFLAGS+=-L/usr/local/lib
|
||||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(OSARCH),SunOS)
|
||||
SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
|
||||
endif
|
||||
MODULES_DIR=$(ASTLIBDIR)/modules
|
||||
|
||||
ifeq ($(OSARCH),OpenBSD)
|
||||
SOLINK=-shared -fpic
|
||||
endif
|
||||
|
||||
# Menuselect stuff
|
||||
-include $(ASTTOPDIR)/menuselect.makeopts $(ASTTOPDIR)/menuselect.makedeps
|
||||
|
||||
# Modules rules
|
||||
MODULE_PREFIX=chan
|
||||
MENUSELECT_CATEGORY=CHANNELS
|
||||
MENUSELECT_DESCRIPTION=Channel Drivers
|
||||
|
||||
all: _all
|
||||
|
||||
include $(ASTTOPDIR)/Makefile.moddir_rules
|
||||
|
||||
%.so: %.o
|
||||
$(CC) -shared -o $@ $<
|
||||
|
||||
%.o: %.c
|
||||
$(CC) -fPIC $(INCLUDE) -DAST_MODULE=\"$*\" -o $@ -c $<
|
||||
|
||||
|
Reference in new issue