Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 1 | # |
Andrew Morgan | f2e0a44 | 2007-07-10 20:58:05 -0700 | [diff] [blame] | 2 | # $Id: Make.Rules,v 1.5 1999/11/18 06:06:02 morgan Exp $ |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 3 | # |
| 4 | |
| 5 | # |
| 6 | ## Optional prefixes: |
| 7 | # |
| 8 | |
| 9 | # common 'packaging' directoty |
| 10 | |
| 11 | FAKEROOT= |
| 12 | |
| 13 | # Autoconf-style prefixes are activated when $(prefix) is defined. |
| 14 | # Otherwise binaries and libraraies are installed in /{lib,sbin}/, |
| 15 | # header files in /usr/include/ and documentation in /usr/man/man?/. |
| 16 | |
Andrew Morgan | 5216fff | 2007-07-10 22:38:22 -0700 | [diff] [blame^] | 17 | ifndef lib |
| 18 | lib=lib |
| 19 | endif |
| 20 | |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 21 | ifdef prefix |
| 22 | exec_prefix=$(prefix) |
| 23 | lib_prefix=$(exec_prefix) |
| 24 | inc_prefix=$(lib_prefix) |
Andrew Morgan | 5216fff | 2007-07-10 22:38:22 -0700 | [diff] [blame^] | 25 | man_prefix=$(prefix)/share |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 26 | else |
| 27 | prefix=/usr |
| 28 | exec_prefix= |
| 29 | lib_prefix=$(exec_prefix) |
| 30 | inc_prefix=$(prefix) |
Andrew Morgan | 5216fff | 2007-07-10 22:38:22 -0700 | [diff] [blame^] | 31 | man_prefix=$(prefix)/share |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 32 | endif |
| 33 | |
| 34 | # Target directories |
| 35 | |
| 36 | MANDIR=$(FAKEROOT)$(man_prefix)/man |
| 37 | SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin |
| 38 | INCDIR=$(FAKEROOT)$(inc_prefix)/include |
Andrew Morgan | 5216fff | 2007-07-10 22:38:22 -0700 | [diff] [blame^] | 39 | LIBDIR=$(FAKEROOT)$(lib_prefix)/$(lib) |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 40 | |
| 41 | # common defines for libcap (suitable for 2.2.1+ Linux kernels) |
| 42 | VERSION=1 |
Andrew Morgan | 5216fff | 2007-07-10 22:38:22 -0700 | [diff] [blame^] | 43 | MINOR=95 |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 44 | # |
| 45 | |
| 46 | # Compilation specifics |
| 47 | |
| 48 | CC=gcc |
| 49 | COPTFLAGS=-O2 |
Andrew Morgan | 5216fff | 2007-07-10 22:38:22 -0700 | [diff] [blame^] | 50 | DEBUG=-O2 -g #-DDEBUG |
| 51 | WARNINGS=-fPIC -D_POSIX_SOURCE -Wall -Wwrite-strings \ |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 52 | -Wpointer-arith -Wcast-qual -Wcast-align \ |
Andrew Morgan | 5216fff | 2007-07-10 22:38:22 -0700 | [diff] [blame^] | 53 | -Wstrict-prototypes -Wmissing-prototypes \ |
| 54 | -Wnested-externs -Winline -Wshadow |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 55 | LD=ld |
| 56 | LDFLAGS=-s #-g |
| 57 | |
| 58 | IPATH=-I$(topdir)/libcap/include |
| 59 | INCS=$(topdir)/libcap/include/sys/capability.h |
| 60 | LIBS=-L$(topdir)/libcap -lcap |
| 61 | CFLAGS=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH) |
| 62 | |
| 63 | # Global cleanup stuff |
| 64 | |
| 65 | LOCALCLEAN=rm -f *~ core |
| 66 | DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f |
| 67 | |
| 68 | # Flags to pass down recursive makes |
| 69 | |
| 70 | MAKE_DEFS = CC='$(CC)' CFLAGS='$(CFLAGS)' \ |
| 71 | LD='$(LD)' LIBS='$(LIBS)' LDFLAGS='$(LDFLAGS)' \ |
| 72 | VERSION='$(VERSION)' MINOR='$(MINOR)' \ |
| 73 | LIBDIR='$(LIBDIR)' INCDIR='$(INCDIR)' \ |
| 74 | SBINDIR='$(SBINDIR)' MANDIR='$(MANDIR)' |