aboutsummaryrefslogtreecommitdiffstats
path: root/Make.Rules
blob: 0bd3554c6888e1949a9684bd587f6556ccf7472c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
#
# $Id: Make.Rules,v 1.5 1999/11/18 06:06:02 morgan Exp $
#

#
## Optional prefixes:
#

# common 'packaging' directoty

FAKEROOT=

# 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?/.

ifndef lib
lib=lib
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=04
#

# Compilation specifics

CC=gcc
COPTFLAGS=-O2
DEBUG=-O2 -g #-DDEBUG
WARNINGS=-fPIC -Wall -Wwrite-strings \
        -Wpointer-arith -Wcast-qual -Wcast-align \
        -Wstrict-prototypes -Wmissing-prototypes \
        -Wnested-externs -Winline -Wshadow
LD=$(CC) -Wl,-x -shared
LDFLAGS=#-g

KERNEL_HEADERS = $(topdir)/libcap/include
SYSTEM_HEADERS = /usr/include
IPATH += -I$(topdir)/libcap/include -I$(KERNEL_HEADERS)
INCS=$(topdir)/libcap/include/sys/capability.h
LIBS=-L$(topdir)/libcap -lcap
CFLAGS=-Dlinux $(WARNINGS) $(DEBUG) $(COPTFLAG) $(IPATH)
PAM_CAP ?= $(shell if [ -f /usr/include/security/pam_modules.h ]; then echo yes ; else echo no ; fi)
# Global cleanup stuff

LOCALCLEAN=rm -f *~ core
DISTCLEAN=@find . \( -name '*.orig' -o -name '*.rej' \) | xargs rm -f

# Flags to pass down recursive makes

MAKE_DEFS = CC='$(CC)' CFLAGS='$(CFLAGS)' \
	LD='$(LD)' LIBS='$(LIBS)' LDFLAGS='$(LDFLAGS)' \
	VERSION='$(VERSION)' MINOR='$(MINOR)' \
	LIBDIR='$(LIBDIR)' INCDIR='$(INCDIR)' \
	SBINDIR='$(SBINDIR)' MANDIR='$(MANDIR)'