| # |
| ## Optional prefixes: |
| # |
| |
| # common 'packaging' directoty |
| |
| FAKEROOT=$(DESTDIR) |
| |
| # Autoconf-style prefixes are activated when $(prefix) is defined. |
| # Otherwise binaries and libraraies are installed in /{lib,sbin}/, |
| # header files in /usr/include/ and documentation in /usr/man/man?/. |
| |
| ifndef lib |
| lib=$(shell ldd /usr/bin/ld|fgrep libc.|cut -d/ -f2) |
| endif |
| |
| ifdef prefix |
| exec_prefix=$(prefix) |
| lib_prefix=$(exec_prefix) |
| inc_prefix=$(lib_prefix) |
| man_prefix=$(prefix)/share |
| else |
| prefix=/usr |
| exec_prefix= |
| lib_prefix=$(exec_prefix) |
| inc_prefix=$(prefix) |
| man_prefix=$(prefix)/share |
| endif |
| |
| # Target directories |
| |
| MANDIR=$(FAKEROOT)$(man_prefix)/man |
| SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin |
| INCDIR=$(FAKEROOT)$(inc_prefix)/include |
| LIBDIR=$(FAKEROOT)$(lib_prefix)/$(lib) |
| |
| # common defines for libcap |
| LIBTITLE=libcap |
| VERSION=2 |
| MINOR=10 |
| # |
| |
| # Compilation specifics |
| |
| CC ?= gcc |
| AR ?= ar |
| RANLIB ?= ranlib |
| COPTFLAGS=-O2 |
| DEBUG=-g #-DDEBUG |
| WARNINGS=-fPIC -Wall -Wwrite-strings \ |
| -Wpointer-arith -Wcast-qual -Wcast-align \ |
| -Wstrict-prototypes -Wmissing-prototypes \ |
| -Wnested-externs -Winline -Wshadow |
| LD=$(CC) -Wl,-x -shared |
| LDFLAGS=#-g |
| |
| KERNEL_HEADERS = $(topdir)/libcap/include |
| SYSTEM_HEADERS = /usr/include |
| IPATH += -I$(topdir)/libcap/include -I$(KERNEL_HEADERS) |
| INCS=$(topdir)/libcap/include/sys/capability.h |
| LIBS=-L$(topdir)/libcap -lcap |
| CFLAGS=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH) |
| PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi) |
| # Global cleanup stuff |
| |
| LOCALCLEAN=rm -f *~ core |
| DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f |
| |
| # Flags to pass down recursive makes |
| |
| MAKE_DEFS = CC='$(CC)' CFLAGS='$(CFLAGS)' \ |
| LD='$(LD)' LIBS='$(LIBS)' LDFLAGS='$(LDFLAGS)' \ |
| VERSION='$(VERSION)' MINOR='$(MINOR)' \ |
| LIBDIR='$(LIBDIR)' INCDIR='$(INCDIR)' \ |
| SBINDIR='$(SBINDIR)' MANDIR='$(MANDIR)' |