Update the build system
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>
This commit is contained in:
parent
8c2ece4514
commit
df369009fa
|
@ -1,3 +1,4 @@
|
||||||
*.o
|
*.o
|
||||||
|
*.o.d
|
||||||
*.so
|
*.so
|
||||||
.*.swp
|
.*.swp
|
||||||
|
|
44
Makefile
44
Makefile
|
@ -1,30 +1,48 @@
|
||||||
ASTSRC?=../asterisk
|
ASTSRC?=../asterisk
|
||||||
|
|
||||||
-include $(ASTSRC)/menuselect.makeopts $(ASTSRC)/menuselect.makedeps
|
|
||||||
|
|
||||||
LOADABLE_MODS=chan_openbsc
|
|
||||||
|
|
||||||
ASTTOPDIR=$(ASTSRC)
|
ASTTOPDIR=$(ASTSRC)
|
||||||
INCLUDE=-I$(ASTSRC)/include -I/usr/local/include
|
|
||||||
|
|
||||||
|
# Asterisk configure options
|
||||||
ifneq ($(wildcard $(ASTSRC)/makeopts),)
|
ifneq ($(wildcard $(ASTSRC)/makeopts),)
|
||||||
include $(ASTSRC)/makeopts
|
include $(ASTSRC)/makeopts
|
||||||
endif
|
endif
|
||||||
|
|
||||||
ifeq ($(OSARCH),SunOS)
|
# Need to replicate some of the Asterisk top makefile logic
|
||||||
ASTLIBDIR=/opt/asterisk/lib
|
# 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
|
else
|
||||||
ASTLIBDIR=$(libdir)/asterisk
|
# These are used for all but Darwin
|
||||||
|
SOLINK=-shared
|
||||||
|
ifneq ($(findstring BSD,$(OSARCH)),)
|
||||||
|
_ASTLDFLAGS+=-L/usr/local/lib
|
||||||
|
endif
|
||||||
endif
|
endif
|
||||||
MODULES_DIR=$(ASTLIBDIR)/modules
|
|
||||||
|
ifeq ($(OSARCH),SunOS)
|
||||||
|
SOLINK=-shared -fpic -L/usr/local/ssl/lib -lrt
|
||||||
|
endif
|
||||||
|
|
||||||
|
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
|
all: _all
|
||||||
|
|
||||||
include $(ASTTOPDIR)/Makefile.moddir_rules
|
include $(ASTTOPDIR)/Makefile.moddir_rules
|
||||||
|
|
||||||
%.so: %.o
|
|
||||||
$(CC) -shared -o $@ $<
|
|
||||||
|
|
||||||
%.o: %.c
|
|
||||||
$(CC) -fPIC $(INCLUDE) -DAST_MODULE=\"$*\" -o $@ -c $<
|
|
||||||
|
|
||||||
|
|
Reference in New Issue