summaryrefslogtreecommitdiff
path: root/Makefile.in
blob: ad436a075df9a5a37e611a4e559b1fb9db9fc5b8 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
# Makefile for pam-afs-session.
#
# Written by Russ Allbery <rra@stanford.edu>
# Copyright 2006, 2007 Board of Trustees, Leland Stanford Jr. University
# See LICENSE for licensing terms.

srcdir		= @srcdir@
VPATH		= @srcdir@

PACKAGE		= @PACKAGE_TARNAME@
VERSION		= @PACKAGE_VERSION@
TARDIR		= $(PACKAGE)-$(VERSION)
TARNAME		= $(TARDIR).tar

prefix		= @prefix@
exec_prefix	= @exec_prefix@
libdir		= @libdir@
pamdir		= $(libdir)/security
datarootdir	= @datarootdir@
mandir		= @mandir@

CC		= @CC@
CFLAGS		= @CFLAGS@
CPPFLAGS	= -I. -I$(srcdir) @CPPFLAGS@
LD		= @LD@
LDFLAGS		= @LDFLAGS@
LIBS		= @LIBS@

INSTALL		= @INSTALL@
INSTALL_DATA	= @INSTALL_DATA@

SOURCES		= logging.c options.c public.c tokens.c
OBJECTS		= $(SOURCES:.c=.o) @LIBOBJS@

all: pam_afs_session.so $(srcdir)/pam_afs_session.5

pam_afs_session.so: $(OBJECTS)
	$(LD) -o $@ $(LDFLAGS) $(OBJECTS) $(LIBS)
	chmod 644 $@

$(srcdir)/pam_afs_session.5: $(srcdir)/pam_afs_session.pod
	pod2man --section=5 --release=$(VERSION) --center='PAM Modules' \
	    $(srcdir)/pam_afs_session.pod > $@

install: pam_afs_session.so $(srcdir)/pam_afs_session.5
	$(INSTALL) -d $(DESTDIR)$(pamdir)
	$(INSTALL) -d $(DESTDIR)$(mandir)/man5
	$(INSTALL_DATA) pam_afs_session.so \
	    $(DESTDIR)$(pamdir)/pam_afs_session.so
	$(INSTALL_DATA) $(srcdir)/pam_afs_session.5 \
	    $(DESTDIR)$(mandir)/man5/pam_afs_session.5

# A set of flags for warnings.	Add -O because gcc won't find some warnings
# without optimization turned on, and add -DDEBUG=1 so we'll also compile all
# debugging code and test it.
WARNINGS = -g -O -fPIC -DDEBUG=1 -Wall -W -Wendif-labels -Wpointer-arith \
	-Wbad-function-cast -Wwrite-strings -Wstrict-prototypes \
	-Wmissing-prototypes -Wnested-externs -Werror

warnings:
	$(MAKE) CFLAGS='$(WARNINGS)'

# This target only works when builddir == srcdir, at least for now.
dist: pam_afs_session.5
	rm -rf $(TARDIR) $(TARNAME).gz
	mkdir $(TARDIR)
	bzr log --short > CHANGES
	rsync -C --exclude /debian/ -a ./ $(TARDIR)/
	cd $(TARDIR) && ./autogen
	tar cf $(TARNAME) $(TARDIR)
	gzip -9 $(TARNAME)

clean:
	rm -f *.so *.o

distclean: clean
	rm -f Makefile config.cache config.h config.log config.status
	rm -rf $(TARDIR)

maintclean maintainer-clean: distclean
	rm -f CHANGES config.h.in config.h.in~ configure pam_afs_session.5
	rm -f $(TARNAME).gz

# Dependencies, set by hand for right now.
logging.o: logging.c config.h internal.h
options.o: options.c config.h internal.h
public.o: public.c config.h internal.h
sys-api.o: sys-api.c config.h
sys-linux.o: sys-linux.c config.h
sys-syscall.o: sys-syscall.c config.h
tokens.o: tokens.c config.h internal.h