diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-08-31 06:54:20 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-08-31 06:54:20 +0000 |
commit | 41af29bedd67d1a5509f8afcefd903c02f2689e3 (patch) | |
tree | 9fbf56793534bfe4e67a4d927a339e1fc89db89a /ppp | |
parent | e2383cfa769550fd700038299bc477095057a9f6 (diff) |
* 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
Diffstat (limited to 'ppp')
-rw-r--r-- | ppp/Makefile | 17 |
1 files changed, 11 insertions, 6 deletions
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 |