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 $
4 ## $DragonFly: src/contrib/libpam/Attic/Makefile,v 1.2 2003/06/17 04:24:02 dillon Exp $
10 # major and minor numbers of this release
16 # this should be the name of this directory
17 RELNAME = Linux-PAM-$(MAJOR_REL).$(MINOR_REL)
19 # this is the name of the archive file
20 DISTFILE = $(RELNAME).tar.gz
22 # define this to indicate to subdirectories that they are part of the
24 FULL_LINUX_PAM_SOURCE_TREE=yes
25 export FULL_LINUX_PAM_SOURCE_TREE
30 # Comment out either line to disable that type of linking for *modules only*
31 # Both at once is a legal configuration!
35 # Comment out these lines to disable building dynamic/static libpam.*
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
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...
53 # NB. The following is the generic defines for compilation.
54 # They can be overridden in the default.defs file below
56 WARNINGS = -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
62 # Mode to install shared libraries with
66 # Conditional defines..
70 # need the dynamic library functions
73 # needed because pam_xxx() fn's are now in statically linked library
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.
86 # to turn on the fprintf(stderr, ..) debugging lines throughout the
87 # distribution uncomment this line
90 # For serious memory allocation tracing uncomment the following
91 #MEMORY_DEBUG=-DMEMORY_DEBUG
93 #######################################################################
94 # The pam_unix module in this file will not work on NIS based systems.#
95 #######################################################################
97 # ////////////////////////////////////////////////////
98 # // You should not modify anything below this line //
99 # ////////////////////////////////////////////////////
101 # the sub-directories to make things in
103 DIRS = modules libpam conf libpam_misc examples
109 INCLUDEDIR=-I$(shell pwd)/include
110 PAMLIB=-L$(shell pwd)/libpam
111 PAMMISCLIB=-L$(shell pwd)/libpam_misc
112 ifeq ($(DEBUG_REL),yes)
114 PAMMISCLIB += -lpamd_misc
117 PAMMISCLIB += -lpam_misc
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.
125 EXTRAS += -DLINUX_PAM
128 # build composite defines
131 LOADLIBES = $(PAMLIB) $(RDYNAMIC) $(PAMMISCLIB) $(LIBDL) $(ULIBS)
133 CFLAGS += $(EXTRAS) $(MEMORY_DEBUG) $(WARNINGS) $(INCLUDEDIR) $(PIC)
134 ifneq ($(strip $(OS)),)
137 ifneq ($(strip $(ARCH)),)
142 # export the libraries-available info; the modules should know how
143 # to deal with this...
153 export MAJOR_REL # the major release of this distribution
154 export MINOR_REL # the minor release of this distribution
155 export DEBUG_REL # for installing a debugging version of PAM
156 export OS # operating system
157 export ARCH # architecture
158 export CC # the C compiler
159 export INSTALL # to do instalations with
160 export MKDIR # to ensure directories exist
161 export CFLAGS # CC flags used to compile everything
162 export LD_D # build a shared object file (module)
163 export LD_L # build a shared library (e.g. libpam)
164 export USESONAME # does shlib link command require soname option
165 export SOSWITCH # shlib lib soname switch name
166 export NEEDSONAME # does shared library link need versioned lib
167 export LD # build a generic library
168 export LDCONFIG # rebuild the shared libraries
169 export AR # build a static library
170 export RANLIB # reorder a static library
171 export LOADLIBES # libraries needed for application linking
172 export PAMLIB # where to find the local libpam.xx file
173 export DYNTYPE # which suffix is used for libraries
174 export SHLIBMODE # file mode for shared objects
176 # where to install things
178 export FAKEROOT # for package maintainers
180 export PREFIX # basic prefix for all other directories
181 export SUPLEMENTED # where to store module helper binaries
182 export LIBDIR # where libpam and libpam_misc go
183 export SECUREDIR # where the modules will be placed
184 export INCLUDED # where to store pam---.h files
185 export CONFIGED # where pam.conf and pam.d/ go
186 export SCONFIGED # where modules' config files go
189 # Conditional exporting ( ... these go on for a while... )
198 export DYNAMIC_LIBPAM
212 @for i in $(DIRS) ; do \
213 $(MAKE) -C $$i all ; \
214 if [ $$? -ne 0 ]; then break ; fi ; \
220 .old_freezemake: Makefile
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!"
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...."
232 @for i in $(DIRS) ; do \
233 $(MAKE) -C $$i install ; \
234 if [ $$? -ne 0 ]; then break ; fi ; \
236 install ./doc/man/*.3 $(PREFIX)/man/man3/
237 install ./doc/man/*.8 $(PREFIX)/man/man8/
244 @for i in $(DIRS) ; do \
245 $(MAKE) -C $$i remove ; \
250 @for i in $(DIRS) ; do \
251 $(MAKE) -C $$i clean ; \
255 @for i in $(DIRS) doc; do \
256 $(MAKE) -C $$i extraclean ; \
260 @$(MAKE) -C conf check
263 @$(MAKE) -C conf RCScheck
265 # this can be used to see what hasn't been check'd into RCS
268 @find . \( -type f -a -perm 644 \) -print
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
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
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-)