diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-01 03:32:51 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2007-09-01 03:32:51 +0000 |
commit | 4fcfbecfd91eacf8fc7441e3c645e0f72277b650 (patch) | |
tree | d3232dfe5d5d701a5653e470fb2fe2590e0b94eb /ppp | |
parent | 9162d9b002869a86d654b2bba58657384650f873 (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.
* Add some basic/broken detection of ppp in autoconf.
Merged revisions 2987 via svnmerge from
https://origsvn.digium.com/svn/zaptel/branches/1.2
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.4@2990 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'ppp')
-rw-r--r-- | ppp/Makefile | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/ppp/Makefile b/ppp/Makefile index a068fa2..86b65a6 100644 --- a/ppp/Makefile +++ b/ppp/Makefile @@ -1,25 +1,29 @@ -CC = gcc -COPTS = -O2 -g -CFLAGS = $(COPTS) -I.. -fPIC -LDFLAGS = -shared -INSTALL = install +#COPTS = -O2 -g -DESTDIR = /usr +-include ../makeopts -VERSION := $(shell awk -F '"' '/VERSION/ { print $$2; }' $(DESTDIR)/include/pppd/patchlevel.h) +CFLAGS += $(COPTS) -I.. -fPIC +LDFLAGS += -shared -LIBDIR := $(DESTDIR)/lib/pppd/$(VERSION) +INCLUDE_DIR = $(includedir)/pppd + +LIBDIR = $(libdir)/pppd/$(PPPD_VERSION) PLUGINS := zaptel.so all: $(PLUGINS) %.so: %.c - $(CC) -o $@ $(LDFLAGS) $(CFLAGS) $^ +ifeq (,$(PPPD_VERSION)) + @echo "pppd version not found (in patchlevel.h)." + @echo "Install ppp source/headers and/or ./configure --with-ppp=PATH." + exit 1 +endif + $(CC) -o $@ $(CFLAGS) $^ $(LDFLAGS) install: $(PLUGINS) - $(INSTALL) -d $(LIBDIR) - $(INSTALL) -m 0644 $? $(LIBDIR) + $(INSTALL) -d $(DESTDIR)$(LIBDIR) + $(INSTALL) -m 0644 $? $(DESTDIR)$(LIBDIR) clean: rm -f *.o *.so *.a |