summaryrefslogtreecommitdiff
path: root/Make.Rules
diff options
context:
space:
mode:
authorAnas Nashif <anas.nashif@intel.com>2012-11-03 20:31:18 -0700
committerAnas Nashif <anas.nashif@intel.com>2012-11-03 20:31:18 -0700
commitb138da4a4b9d57b850ca4d0061969f5e3299861d (patch)
tree3e20a6f4a29bfe91b2b51f416673d9fad1e0b7c7 /Make.Rules
downloadlibcap-b138da4a4b9d57b850ca4d0061969f5e3299861d.tar.gz
libcap-b138da4a4b9d57b850ca4d0061969f5e3299861d.tar.bz2
libcap-b138da4a4b9d57b850ca4d0061969f5e3299861d.zip
Imported Upstream version 2.22upstream/2.22
Diffstat (limited to 'Make.Rules')
-rw-r--r--Make.Rules86
1 files changed, 86 insertions, 0 deletions
diff --git a/Make.Rules b/Make.Rules
new file mode 100644
index 0000000..8393738
--- /dev/null
+++ b/Make.Rules
@@ -0,0 +1,86 @@
+#
+## 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?/.
+# These choices are motivated by the fact that getcap and setcap are
+# administrative operations that could be needed to recover a system.
+
+ifndef lib
+lib=$(shell ldd /usr/bin/ld|fgrep ld-linux|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=22
+#
+
+# Compilation specifics
+
+KERNEL_HEADERS := $(topdir)/libcap/include
+IPATH += -fPIC -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
+
+CC := gcc
+CFLAGS := -O2 -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
+BUILD_CC := $(CC)
+BUILD_CFLAGS := $(CFLAGS) $(IPATH)
+AR := ar
+RANLIB := ranlib
+DEBUG = -g #-DDEBUG
+WARNINGS=-Wall -Wwrite-strings \
+ -Wpointer-arith -Wcast-qual -Wcast-align \
+ -Wstrict-prototypes -Wmissing-prototypes \
+ -Wnested-externs -Winline -Wshadow
+LD=$(CC) -Wl,-x -shared
+LDFLAGS := #-g
+
+SYSTEM_HEADERS = /usr/include
+INCS=$(topdir)/libcap/include/sys/capability.h
+LDFLAGS += -L$(topdir)/libcap
+CFLAGS += -Dlinux $(WARNINGS) $(DEBUG)
+PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
+INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi)
+DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi)
+LIBATTR := yes
+
+# When installing setcap, set its inheritable bit to be able to place
+# capabilities on files. It can be used in conjunction with pam_cap
+# (associated with su and certain users say) to make it useful for
+# specially blessed users. If you wish to drop this install feature,
+# use this command when running install
+#
+# make RAISE_SETFCAP=no install
+#
+RAISE_SETFCAP := $(LIBATTR)
+
+# Global cleanup stuff
+
+LOCALCLEAN=rm -f *~ core
+DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f