Commit 27808e36 authored by Richard Mudgett's avatar Richard Mudgett

* Made no longer compile *.lo files they are identical to *.o files.

* Made compile the pritest, rosetest, and testprilib utilities using the
static libpri library.  No more forgetting to install the library after a
change and wondering why it still did not work.  The pridump utility is
still dynamically linked.

* Made compile the utilities by default.


git-svn-id: https://origsvn.digium.com/svn/libpri/branches/1.4@2294 2fbb986a-6c06-0410-b554-c9c1f0a7f128
parent 4af121db
...@@ -10,15 +10,15 @@ ...@@ -10,15 +10,15 @@
# it under the terms of the GNU General Public License as published by # it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or # the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version. # (at your option) any later version.
# #
# This program is distributed in the hope that it will be useful, # This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of # but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details. # GNU General Public License for more details.
# #
# You should have received a copy of the GNU General Public License # You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software # along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
# #
# #
# Uncomment if you want libpri not send PROGRESS_INDICATOR w/ALERTING # Uncomment if you want libpri not send PROGRESS_INDICATOR w/ALERTING
...@@ -65,31 +65,7 @@ STATIC_OBJS= \ ...@@ -65,31 +65,7 @@ STATIC_OBJS= \
rose_qsig_name.o \ rose_qsig_name.o \
version.o version.o
DYNAMIC_OBJS= \ DYNAMIC_OBJS= \
copy_string.lo \ $(STATIC_OBJS)
pri.lo \
q921.lo \
prisched.lo \
q931.lo \
pri_aoc.lo \
pri_cc.lo \
pri_facility.lo \
asn1_primitive.lo \
rose.lo \
rose_address.lo \
rose_etsi_aoc.lo \
rose_etsi_cc.lo \
rose_etsi_diversion.lo \
rose_etsi_ect.lo \
rose_etsi_mwi.lo \
rose_other.lo \
rose_q931.lo \
rose_qsig_aoc.lo \
rose_qsig_cc.lo \
rose_qsig_ct.lo \
rose_qsig_diversion.lo \
rose_qsig_mwi.lo \
rose_qsig_name.lo \
version.lo
CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_OPT) $(COVERAGE_CFLAGS) CFLAGS=-Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -g -fPIC $(ALERTING) $(LIBPRI_OPT) $(COVERAGE_CFLAGS)
INSTALL_PREFIX=$(DESTDIR) INSTALL_PREFIX=$(DESTDIR)
INSTALL_BASE=/usr INSTALL_BASE=/usr
...@@ -115,11 +91,13 @@ endif ...@@ -115,11 +91,13 @@ endif
endif endif
ifeq (${OSARCH},SunOS) ifeq (${OSARCH},SunOS)
CFLAGS += -DSOLARIS -I../zaptel-solaris CFLAGS += -DSOLARIS -I../zaptel-solaris
LDCONFIG = LDCONFIG =
LDCONFIG_FLAGS = \# # Trick to comment out the period in the command below LDCONFIG_FLAGS = \# # Trick to comment out the period in the command below
#INSTALL_PREFIX = /opt/asterisk # Uncomment out to install in standard Solaris location for 3rd party code #INSTALL_PREFIX = /opt/asterisk # Uncomment out to install in standard Solaris location for 3rd party code
endif endif
UTILITIES= pridump pritest rosetest testprilib
export PRIVERSION export PRIVERSION
PRIVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .) PRIVERSION:=$(shell GREP=$(GREP) AWK=$(AWK) build_tools/make_version .)
...@@ -145,7 +123,7 @@ CFLAGS += -m32 ...@@ -145,7 +123,7 @@ CFLAGS += -m32
SOFLAGS += -m32 SOFLAGS += -m32
endif endif
all: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY) all: $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY) $(UTILITIES)
update: update:
@if [ -d .svn ]; then \ @if [ -d .svn ]; then \
...@@ -171,37 +149,37 @@ ifneq (${OSARCH},SunOS) ...@@ -171,37 +149,37 @@ ifneq (${OSARCH},SunOS)
install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include install -m 644 libpri.h $(INSTALL_PREFIX)$(INSTALL_BASE)/include
install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(libdir) install -m 755 $(DYNAMIC_LIBRARY) $(INSTALL_PREFIX)$(libdir)
#if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then /sbin/restorecon -v $(INSTALL_PREFIX)$(libdir)/$(DYNAMIC_LIBRARY); fi #if [ -x /usr/sbin/sestatus ] && ( /usr/sbin/sestatus | grep "SELinux status:" | grep -q "enabled"); then /sbin/restorecon -v $(INSTALL_PREFIX)$(libdir)/$(DYNAMIC_LIBRARY); fi
( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf libpri.so.$(SONAME) libpri.so) ( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf $(DYNAMIC_LIBRARY) libpri.so)
install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(libdir) install -m 644 $(STATIC_LIBRARY) $(INSTALL_PREFIX)$(libdir)
if test $$(id -u) = 0; then $(LDCONFIG) $(LDCONFIG_FLAGS) $(INSTALL_PREFIX)$(libdir); fi if test $$(id -u) = 0; then $(LDCONFIG) $(LDCONFIG_FLAGS) $(INSTALL_PREFIX)$(libdir); fi
else else
install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h install -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include -m 644 libpri.h
install -f $(INSTALL_PREFIX)$(libdir) -m 755 $(DYNAMIC_LIBRARY) install -f $(INSTALL_PREFIX)$(libdir) -m 755 $(DYNAMIC_LIBRARY)
( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf libpri.so.$(SONAME) libpri.so) ( cd $(INSTALL_PREFIX)$(libdir) ; ln -sf $(DYNAMIC_LIBRARY) libpri.so)
install -f $(INSTALL_PREFIX)$(libdir) -m 644 $(STATIC_LIBRARY) install -f $(INSTALL_PREFIX)$(libdir) -m 644 $(STATIC_LIBRARY)
endif endif
uninstall: uninstall:
@echo "Removing Libpri" @echo "Removing Libpri"
rm -f $(INSTALL_PREFIX)$(libdir)/libpri.so.$(SONAME) rm -f $(INSTALL_PREFIX)$(libdir)/$(STATIC_LIBRARY)
rm -f $(INSTALL_PREFIX)$(libdir)/libpri.so rm -f $(INSTALL_PREFIX)$(libdir)/libpri.so
rm -f $(INSTALL_PREFIX)$(libdir)/libpri.a rm -f $(INSTALL_PREFIX)$(libdir)/$(DYNAMIC_LIBRARY)
rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h rm -f $(INSTALL_PREFIX)$(INSTALL_BASE)/include/libpri.h
pritest: pritest.o pritest: pritest.o $(STATIC_LIBRARY)
$(CC) -o pritest pritest.o -L. -lpri $(CFLAGS) $(CC) -o $@ $< $(STATIC_LIBRARY) $(CFLAGS)
testprilib.o: testprilib.c testprilib.o: testprilib.c
$(CC) $(CFLAGS) -D_REENTRANT -D_GNU_SOURCE -o $@ -c $< $(CC) $(CFLAGS) -D_REENTRANT -D_GNU_SOURCE $(MAKE_DEPS) -c -o $@ $<
testprilib: testprilib.o testprilib: testprilib.o $(STATIC_LIBRARY)
$(CC) -o testprilib testprilib.o -L. -lpri -lpthread $(CFLAGS) $(CC) -o $@ $< $(STATIC_LIBRARY) -lpthread $(CFLAGS)
pridump: pridump.o pridump: pridump.o $(DYNAMIC_LIBRARY)
$(CC) -o pridump pridump.o -L. -lpri $(CFLAGS) $(CC) -o $@ $< -L. -lpri $(CFLAGS)
rosetest: rosetest.o rosetest: rosetest.o $(STATIC_LIBRARY)
$(CC) -o rosetest rosetest.o -L. -lpri $(CFLAGS) $(CC) -o $@ $< $(STATIC_LIBRARY) $(CFLAGS)
MAKE_DEPS= -MD -MT $@ -MF .$(subst /,_,$@).d -MP MAKE_DEPS= -MD -MT $@ -MF .$(subst /,_,$@).d -MP
...@@ -218,7 +196,7 @@ $(STATIC_LIBRARY): $(STATIC_OBJS) ...@@ -218,7 +196,7 @@ $(STATIC_LIBRARY): $(STATIC_OBJS)
$(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS) $(DYNAMIC_LIBRARY): $(DYNAMIC_OBJS)
$(CC) $(SOFLAGS) -o $@ $(DYNAMIC_OBJS) $(CC) $(SOFLAGS) -o $@ $(DYNAMIC_OBJS)
$(LDCONFIG) $(LDCONFIG_FLAGS) . $(LDCONFIG) $(LDCONFIG_FLAGS) .
ln -sf libpri.so.$(SONAME) libpri.so ln -sf $(DYNAMIC_LIBRARY) libpri.so
version.c: FORCE version.c: FORCE
@build_tools/make_version_c > $@.tmp @build_tools/make_version_c > $@.tmp
...@@ -226,9 +204,9 @@ version.c: FORCE ...@@ -226,9 +204,9 @@ version.c: FORCE
@rm -f $@.tmp @rm -f $@.tmp
clean: clean:
rm -f *.o *.so *.lo *.so.$(SONAME) rm -f *.o *.so *.lo
rm -f testprilib $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY) rm -f $(STATIC_LIBRARY) $(DYNAMIC_LIBRARY)
rm -f pritest pridump rm -f $(UTILITIES)
rm -f .*.d rm -f .*.d
.PHONY: .PHONY:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment