blob: 89cf5e7a2ad77e0306a01e0d860c43a2daddeb45 [file] [log] [blame] [edit]
CROSS_COMPILE=@CROSS_COMPILE@
CC=$(CROSS_COMPILE)@CC@
COPTS=@CFLAGS@
DESTDIR = $(INSTROOT)@DESTDIR@
BINDIR = $(DESTDIR)/sbin
MANDIR = $(DESTDIR)/share/man/man8
LIBDIR = $(DESTDIR)/lib/pppd/$(VERSION)
CFLAGS = $(COPTS) -I.. -I../../include -fPIC
LDFLAGS_PROG := $(LDFLAGS)
export LDFLAGS LDFLAGS_PROG
LDFLAGS += -shared
# need the following option, otherwise linking plugins might fail with undef errors (Gentoo bug 210837)
LDFLAGS += -Wl,--allow-shlib-undefined
INSTALL = install
# EAP-TLS
CFLAGS += -DUSE_EAPTLS=1
SUBDIRS := pppoe pppoatm pppol2tp
# Uncomment the next line to include the radius authentication plugin
SUBDIRS += radius
PLUGINS := minconn.so passprompt.so passwordfd.so winbind.so
# This setting should match the one in ../Makefile.linux
MPPE=y
ifdef MPPE
CFLAGS += -DMPPE=1
endif
# include dependencies if present
ifeq (.depend,$(wildcard .depend))
include .depend
endif
all: $(PLUGINS)
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d all || exit $$?; done
%.so: %.c
$(CC) $(LDFLAGS) $(CFLAGS) -o $@ $^ $(LIBS)
VERSION = $(shell awk -F '"' '/VERSION/ { print $$2; }' ../patchlevel.h)
install: $(PLUGINS)
$(INSTALL) -d $(LIBDIR)
$(INSTALL) $? $(LIBDIR)
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d install || exit $$?; done
clean:
rm -f *.o *.so *.a
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d clean || exit $$?; done
depend:
$(CPP) -M $(CFLAGS) *.c >.depend
for d in $(SUBDIRS); do $(MAKE) $(MFLAGS) -C $$d depend || exit $$?; done