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 | |
| 17 | ifdef prefix |
| 18 | exec_prefix=$(prefix) |
| 19 | lib_prefix=$(exec_prefix) |
| 20 | inc_prefix=$(lib_prefix) |
| 21 | man_prefix=$(prefix) |
| 22 | else |
| 23 | prefix=/usr |
| 24 | exec_prefix= |
| 25 | lib_prefix=$(exec_prefix) |
| 26 | inc_prefix=$(prefix) |
| 27 | man_prefix=$(prefix) |
| 28 | endif |
| 29 | |
| 30 | # Target directories |
| 31 | |
| 32 | MANDIR=$(FAKEROOT)$(man_prefix)/man |
| 33 | SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin |
| 34 | INCDIR=$(FAKEROOT)$(inc_prefix)/include |
| 35 | LIBDIR=$(FAKEROOT)$(lib_prefix)/lib |
| 36 | |
| 37 | # common defines for libcap (suitable for 2.2.1+ Linux kernels) |
| 38 | VERSION=1 |
Andrew Morgan | f2e0a44 | 2007-07-10 20:58:05 -0700 | [diff] [blame^] | 39 | MINOR=10 |
Andrew Morgan | 2c9c053 | 2007-07-10 20:50:21 -0700 | [diff] [blame] | 40 | # |
| 41 | |
| 42 | # Compilation specifics |
| 43 | |
| 44 | CC=gcc |
| 45 | COPTFLAGS=-O2 |
| 46 | DEBUG=-g #-DDEBUG |
| 47 | WARNINGS=-ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \ |
| 48 | -Wpointer-arith -Wcast-qual -Wcast-align \ |
| 49 | -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \ |
| 50 | -Wnested-externs -Winline -Wshadow -pedantic |
| 51 | LD=ld |
| 52 | LDFLAGS=-s #-g |
| 53 | |
| 54 | IPATH=-I$(topdir)/libcap/include |
| 55 | INCS=$(topdir)/libcap/include/sys/capability.h |
| 56 | LIBS=-L$(topdir)/libcap -lcap |
| 57 | CFLAGS=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH) |
| 58 | |
| 59 | # Global cleanup stuff |
| 60 | |
| 61 | LOCALCLEAN=rm -f *~ core |
| 62 | DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f |
| 63 | |
| 64 | # Flags to pass down recursive makes |
| 65 | |
| 66 | MAKE_DEFS = CC='$(CC)' CFLAGS='$(CFLAGS)' \ |
| 67 | LD='$(LD)' LIBS='$(LIBS)' LDFLAGS='$(LDFLAGS)' \ |
| 68 | VERSION='$(VERSION)' MINOR='$(MINOR)' \ |
| 69 | LIBDIR='$(LIBDIR)' INCDIR='$(INCDIR)' \ |
| 70 | SBINDIR='$(SBINDIR)' MANDIR='$(MANDIR)' |