From 41af29bedd67d1a5509f8afcefd903c02f2689e3 Mon Sep 17 00:00:00 2001 From: tzafrir Date: Fri, 31 Aug 2007 06:54:20 +0000 Subject: * Maintain the same meaning of DESTDIR and INSTALL_PREFIX as in main Makefile * Document ppp support to the best of my knowledge. * Err clearly if the VERSION was not found. git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@2987 5390a7c7-147a-4af0-8ec9-7488f05a26cb --- ppp/Makefile | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'ppp') diff --git a/ppp/Makefile b/ppp/Makefile index a068fa2..ac6e5a9 100644 --- a/ppp/Makefile +++ b/ppp/Makefile @@ -4,22 +4,27 @@ CFLAGS = $(COPTS) -I.. -fPIC LDFLAGS = -shared INSTALL = install -DESTDIR = /usr +INSTALL_PREFIX = /usr +INCLUDE_DIR = $(INSTALL_PREFIX)/include/pppd -VERSION := $(shell awk -F '"' '/VERSION/ { print $$2; }' $(DESTDIR)/include/pppd/patchlevel.h) - -LIBDIR := $(DESTDIR)/lib/pppd/$(VERSION) +VERSION := $(shell awk -F '"' '/VERSION/ { print $$2; }' $(INCLUDE_DIR)/patchlevel.h) +LIBDIR = $(INSTALL_PREFIX)/lib/pppd/$(VERSION) PLUGINS := zaptel.so all: $(PLUGINS) %.so: %.c +ifeq (,$(VERSION)) + @echo "pppd version not found (in patchlevel.h)." + @echo "Install ppp source/headers and/or point INCLUDE_DIR to them." + exit 1 +endif $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ install: $(PLUGINS) - $(INSTALL) -d $(LIBDIR) - $(INSTALL) -m 0644 $? $(LIBDIR) + $(INSTALL) -d $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 0644 $? $(DESTDIR)$(LIBDIR) clean: rm -f *.o *.so *.a -- cgit v1.2.3