blob: d5151d3bf91d263a695d60898b74515fa828113d [file] [log] [blame]
Andrew Morgan2c9c0532007-07-10 20:50:21 -07001#
Andrew Morganf2e0a442007-07-10 20:58:05 -07002# $Id: Make.Rules,v 1.5 1999/11/18 06:06:02 morgan Exp $
Andrew Morgan2c9c0532007-07-10 20:50:21 -07003#
4
5#
6## Optional prefixes:
7#
8
9# common 'packaging' directoty
10
11FAKEROOT=
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 Morgan5216fff2007-07-10 22:38:22 -070017ifndef lib
18lib=lib
19endif
20
Andrew Morgan2c9c0532007-07-10 20:50:21 -070021ifdef prefix
22exec_prefix=$(prefix)
23lib_prefix=$(exec_prefix)
24inc_prefix=$(lib_prefix)
Andrew Morgan5216fff2007-07-10 22:38:22 -070025man_prefix=$(prefix)/share
Andrew Morgan2c9c0532007-07-10 20:50:21 -070026else
27prefix=/usr
28exec_prefix=
29lib_prefix=$(exec_prefix)
30inc_prefix=$(prefix)
Andrew Morgan5216fff2007-07-10 22:38:22 -070031man_prefix=$(prefix)/share
Andrew Morgan2c9c0532007-07-10 20:50:21 -070032endif
33
34# Target directories
35
36MANDIR=$(FAKEROOT)$(man_prefix)/man
37SBINDIR=$(FAKEROOT)$(exec_prefix)/sbin
38INCDIR=$(FAKEROOT)$(inc_prefix)/include
Andrew Morgan5216fff2007-07-10 22:38:22 -070039LIBDIR=$(FAKEROOT)$(lib_prefix)/$(lib)
Andrew Morgan2c9c0532007-07-10 20:50:21 -070040
41# common defines for libcap (suitable for 2.2.1+ Linux kernels)
42VERSION=1
Andrew Morgan5216fff2007-07-10 22:38:22 -070043MINOR=95
Andrew Morgan2c9c0532007-07-10 20:50:21 -070044#
45
46# Compilation specifics
47
48CC=gcc
49COPTFLAGS=-O2
Andrew Morgan5216fff2007-07-10 22:38:22 -070050DEBUG=-O2 -g #-DDEBUG
51WARNINGS=-fPIC -D_POSIX_SOURCE -Wall -Wwrite-strings \
Andrew Morgan2c9c0532007-07-10 20:50:21 -070052 -Wpointer-arith -Wcast-qual -Wcast-align \
Andrew Morgan5216fff2007-07-10 22:38:22 -070053 -Wstrict-prototypes -Wmissing-prototypes \
54 -Wnested-externs -Winline -Wshadow
Andrew Morgan2c9c0532007-07-10 20:50:21 -070055LD=ld
56LDFLAGS=-s #-g
57
58IPATH=-I$(topdir)/libcap/include
59INCS=$(topdir)/libcap/include/sys/capability.h
60LIBS=-L$(topdir)/libcap -lcap
61CFLAGS=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH)
62
63# Global cleanup stuff
64
65LOCALCLEAN=rm -f *~ core
66DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f
67
68# Flags to pass down recursive makes
69
70MAKE_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)'