Merge from vendor branch FILE:
[dragonfly.git] / contrib / libpam / Makefile
CommitLineData
984263bc
MD
1##
2## $Id: Makefile,v 1.31 1997/04/05 07:04:25 morgan Exp morgan $
3## $FreeBSD: src/contrib/libpam/Makefile,v 1.1.1.1.6.2 2001/06/11 15:28:09 markm Exp $
1de703da 4## $DragonFly: src/contrib/libpam/Attic/Makefile,v 1.2 2003/06/17 04:24:02 dillon Exp $
984263bc
MD
5##
6## $Log: Makefile,v $
7##
8##
9
10# major and minor numbers of this release
11MAJOR_REL=0
12MINOR_REL=65
13DEBUG_REL=no
14#DEBUG_REL=yes
15
16# this should be the name of this directory
17RELNAME = Linux-PAM-$(MAJOR_REL).$(MINOR_REL)
18
19# this is the name of the archive file
20DISTFILE = $(RELNAME).tar.gz
21
22# define this to indicate to subdirectories that they are part of the
23# full source tree.
24FULL_LINUX_PAM_SOURCE_TREE=yes
25export FULL_LINUX_PAM_SOURCE_TREE
26
27DYNLOAD="dl"
28DYNTYPE="so"
29
30# Comment out either line to disable that type of linking for *modules only*
31# Both at once is a legal configuration!
32DYNAMIC=-DPAM_DYNAMIC
33#STATIC=-DPAM_STATIC
34
35# Comment out these lines to disable building dynamic/static libpam.*
36DYNAMIC_LIBPAM=yes
37#STATIC_LIBPAM=yes
38
39# All combinations of the above four variable definitions are legal,
40# however, not defining either dynamic or static modules and yet
41# creating a some flavor of LIBPAM will make an authentication library
42# that always fails!
43
44# Here we indicate which libraries are present on the local system
45# they control the building of some modules in this distribution
46# Note, these definitions are all "export"ed below...
47
48HAVE_PWDBLIB=no
49HAVE_CRACKLIB=no
50HAVE_AFSLIBS=no
51HAVE_KRBLIBS=no
52
53# NB. The following is the generic defines for compilation.
54# They can be overridden in the default.defs file below
55#
56WARNINGS = -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
57 -Wpointer-arith -Wcast-qual -Wcast-align \
58 -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \
59 -Wnested-externs -Winline -Wshadow -pedantic
60PIC=-fPIC
61
62# Mode to install shared libraries with
63SHLIBMODE=644
64
65#
66# Conditional defines..
67#
68
69ifdef DYNAMIC
70# need the dynamic library functions
71LIBDL=-l$(DYNLOAD)
72ifdef STATIC_LIBPAM
73# needed because pam_xxx() fn's are now in statically linked library
74RDYNAMIC = -rdynamic
75endif
76endif
77
78# Here we include the defines for the preferred operating system
79# these include things like CC, CFLAGS and destination directories
80# etc.. By default, this is a symbolic link to one of the .defs files
81# the .../defs/ directory. Please take a moment to check that you are
82# using the correct one.
83
84include default.defs
85
86# to turn on the fprintf(stderr, ..) debugging lines throughout the
87# distribution uncomment this line
88#EXTRAS += -DDEBUG
89
90# For serious memory allocation tracing uncomment the following
91#MEMORY_DEBUG=-DMEMORY_DEBUG
92
93#######################################################################
94# The pam_unix module in this file will not work on NIS based systems.#
95#######################################################################
96
97# ////////////////////////////////////////////////////
98# // You should not modify anything below this line //
99# ////////////////////////////////////////////////////
100
101# the sub-directories to make things in
102
103DIRS = modules libpam conf libpam_misc examples
104
105#
106# basic defines
107#
108
109INCLUDEDIR=-I$(shell pwd)/include
110PAMLIB=-L$(shell pwd)/libpam
111PAMMISCLIB=-L$(shell pwd)/libpam_misc
112ifeq ($(DEBUG_REL),yes)
113 PAMLIB += -lpamd
114 PAMMISCLIB += -lpamd_misc
115else
116 PAMLIB += -lpam
117 PAMMISCLIB += -lpam_misc
118endif
119
120
121# This is Linux-PAM and not a version from Sun etc..
122# [Note, this does not describe the operating system you are using
123# only that you are compiling the "Linux" (read FREE) implementation
124# of Pluggable Authentication Modules.
125EXTRAS += -DLINUX_PAM
126
127#
128# build composite defines
129#
130
131LOADLIBES = $(PAMLIB) $(RDYNAMIC) $(PAMMISCLIB) $(LIBDL) $(ULIBS)
132
133CFLAGS += $(EXTRAS) $(MEMORY_DEBUG) $(WARNINGS) $(INCLUDEDIR) $(PIC)
134ifneq ($(strip $(OS)),)
135CFLAGS += -D$(OS)
136endif
137ifneq ($(strip $(ARCH)),)
138CFLAGS += -D$(ARCH)
139endif
140
141#
142# export the libraries-available info; the modules should know how
143# to deal with this...
144#
145export HAVE_PWDBLIB
146export HAVE_CRACKLIB
147export HAVE_AFSLIBS
148export HAVE_KRBLIBS
149
150#
151# generic exports
152#
153export MAJOR_REL # the major release of this distribution
154export MINOR_REL # the minor release of this distribution
155export DEBUG_REL # for installing a debugging version of PAM
156export OS # operating system
157export ARCH # architecture
158export CC # the C compiler
159export INSTALL # to do instalations with
160export MKDIR # to ensure directories exist
161export CFLAGS # CC flags used to compile everything
162export LD_D # build a shared object file (module)
163export LD_L # build a shared library (e.g. libpam)
164export USESONAME # does shlib link command require soname option
165export SOSWITCH # shlib lib soname switch name
166export NEEDSONAME # does shared library link need versioned lib
167export LD # build a generic library
168export LDCONFIG # rebuild the shared libraries
169export AR # build a static library
170export RANLIB # reorder a static library
171export LOADLIBES # libraries needed for application linking
172export PAMLIB # where to find the local libpam.xx file
173export DYNTYPE # which suffix is used for libraries
174export SHLIBMODE # file mode for shared objects
175#
176# where to install things
177#
178export FAKEROOT # for package maintainers
179#
180export PREFIX # basic prefix for all other directories
181export SUPLEMENTED # where to store module helper binaries
182export LIBDIR # where libpam and libpam_misc go
183export SECUREDIR # where the modules will be placed
184export INCLUDED # where to store pam---.h files
185export CONFIGED # where pam.conf and pam.d/ go
186export SCONFIGED # where modules' config files go
187
188#
189# Conditional exporting ( ... these go on for a while... )
190#
191ifdef DYNAMIC
192export DYNAMIC
193endif
194ifdef STATIC
195export STATIC
196endif
197ifdef DYNAMIC_LIBPAM
198export DYNAMIC_LIBPAM
199endif
200ifdef STATIC_LIBPAM
201export STATIC_LIBPAM
202endif
203ifdef MEMORY_DEBUG
204export MEMORY_DEBUG
205endif
206
207##
208## the rules
209##
210
211all: .freezemake
212 @for i in $(DIRS) ; do \
213 $(MAKE) -C $$i all ; \
214 if [ $$? -ne 0 ]; then break ; fi ; \
215 done
216
217.freezemake:
218# Do nothing
219
220.old_freezemake: Makefile
221 @touch .freezemake
222 @echo "*WARNING*: If you are running a system that is dependent"
223 @echo " on PAM to work. DO NOT make sterile NOR make remove."
224 @echo " These options will delete the PAM files on your system"
225 @echo " and make it unusable!"
226 @echo ""
227 @echo "If you are in any doubt, just do 'make all' (or just"
228 @echo "'make'). It is likely that this is the SAFEST thing to do...."
229 @exit 1
230
231install:
232 @for i in $(DIRS) ; do \
233 $(MAKE) -C $$i install ; \
234 if [ $$? -ne 0 ]; then break ; fi ; \
235 done
236 install ./doc/man/*.3 $(PREFIX)/man/man3/
237 install ./doc/man/*.8 $(PREFIX)/man/man8/
238
239sterile: .freezemake
240 @$(MAKE) remove
241 @$(MAKE) extraclean
242
243remove: .freezemake
244 @for i in $(DIRS) ; do \
245 $(MAKE) -C $$i remove ; \
246 done
247
248clean:
249 @rm -f *~ core
250 @for i in $(DIRS) ; do \
251 $(MAKE) -C $$i clean ; \
252 done
253
254extraclean:
255 @for i in $(DIRS) doc; do \
256 $(MAKE) -C $$i extraclean ; \
257 done
258
259check:
260 @$(MAKE) -C conf check
261
262RCScheck:
263 @$(MAKE) -C conf RCScheck
264
265# this can be used to see what hasn't been check'd into RCS
266
267open:
268 @find . \( -type f -a -perm 644 \) -print
269
270release:
271 @egrep '^DEBUG\_REL\=yes' Makefile|grep -v grep > /dev/null ;\
272 if [ $$? -eq 0 ]; then \
273 echo "You should first set DEBUG_REL to no" ; exit 1 ; fi
274 $(MAKE) extraclean
275 rm -f .freezemake
276 touch .filelist .RCSlist
277 chmod 600 .filelist .RCSlist
278 cd .. ; find $(RELNAME) \! -type d -print | fgrep -v RCS | fgrep -v 'conf/.md5sum' > $(RELNAME)/.filelist
279 cd .. ; find $(RELNAME) -type f -print | fgrep RCS | fgrep -v 'conf/.RCSsum' > $(RELNAME)/.RCSlist
280 chmod 400 .filelist .RCSlist
281 $(MAKE) check
282 $(MAKE) RCScheck
283 (cat .filelist ; echo $(RELNAME)/conf/.md5sum) | (cd .. ; tar -cz -f$(DISTFILE) -T-)
284 (cat .RCSlist ; echo $(RELNAME)/conf/.RCSsum) | (cd .. ; tar -cz -fRCS+$(DISTFILE) -T-)