make.rules (2464B)
1 # 2 ## Optional prefixes: 3 # 4 5 # common 'packaging' directoty 6 7 FAKEROOT=$(DESTDIR) 8 9 # Autoconf-style prefixes are activated when $(prefix) is defined. 10 # Otherwise binaries and libraries are installed in /{lib,sbin}/, 11 # header files in /usr/include/ and documentation in /usr/man/man?/. 12 # These choices are motivated by the fact that getcap and setcap are 13 # administrative operations that could be needed to recover a system. 14 15 ifndef lib 16 lib=$(shell ldd /usr/bin/ld|egrep "ld-linux|ld.so"|cut -d/ -f2) 17 endif 18 19 ifdef prefix 20 exec_prefix=$(prefix) 21 lib_prefix=$(exec_prefix) 22 inc_prefix=$(lib_prefix) 23 man_prefix=$(prefix)/share 24 else 25 prefix=/usr 26 exec_prefix= 27 lib_prefix=$(exec_prefix) 28 inc_prefix=$(prefix) 29 man_prefix=$(prefix)/share 30 endif 31 32 # Target directories 33 34 MANDIR=$(FAKEROOT)$(man_prefix)/man 35 SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin 36 INCDIR=$(FAKEROOT)$(inc_prefix)/include 37 LIBDIR=$(FAKEROOT)$(lib_prefix)/$(lib) 38 PKGCONFIGDIR=$(FAKEROOT)$(prefix)/$(lib)/pkgconfig 39 40 # common defines for libcap 41 LIBTITLE=libcap 42 VERSION=2 43 MINOR=24 44 # 45 46 # Compilation specifics 47 48 KERNEL_HEADERS := $(topdir)/libcap/include/uapi 49 IPATH += -fPIC -I$(KERNEL_HEADERS) -I$(topdir)/libcap/include 50 51 #CC := gcc 52 CFLAGS += -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 53 BUILD_CC := $(CC) 54 BUILD_CFLAGS := $(CFLAGS) $(IPATH) 55 #AR := ar 56 #RANLIB := ranlib 57 DEBUG = #-DDEBUG 58 WARNINGS=-Wall -Wwrite-strings \ 59 -Wpointer-arith -Wcast-qual -Wcast-align \ 60 -Wstrict-prototypes -Wmissing-prototypes \ 61 -Wnested-externs -Winline -Wshadow 62 #LD=$(CC) -Wl,-x -shared 63 #LDFLAGS := #-g 64 65 SYSTEM_HEADERS = /usr/include 66 INCS=$(topdir)/libcap/include/sys/capability.h 67 LDFLAGS += -L$(topdir)/libcap 68 CFLAGS += -Dlinux $(WARNINGS) $(DEBUG) 69 PAM_CAP := $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi) 70 INDENT := $(shell if [ -n "$(which indent 2>/dev/null)" ]; then echo "| indent -kr" ; fi) 71 DYNAMIC := $(shell if [ ! -d "$(topdir)/.git" ]; then echo yes; fi) 72 LIBATTR := yes 73 74 # When installing setcap, set its inheritable bit to be able to place 75 # capabilities on files. It can be used in conjunction with pam_cap 76 # (associated with su and certain users say) to make it useful for 77 # specially blessed users. If you wish to drop this install feature, 78 # use this command when running install 79 # 80 # make RAISE_SETFCAP=no install 81 # 82 RAISE_SETFCAP := $(LIBATTR) 83 84 # Global cleanup stuff 85 86 LOCALCLEAN=rm -f *~ core 87 DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f