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 $
9 # major and minor numbers of this release
15 # this should be the name of this directory
16 RELNAME = Linux-PAM-$(MAJOR_REL).$(MINOR_REL)
18 # this is the name of the archive file
19 DISTFILE = $(RELNAME).tar.gz
21 # define this to indicate to subdirectories that they are part of the
23 FULL_LINUX_PAM_SOURCE_TREE=yes
24 export FULL_LINUX_PAM_SOURCE_TREE
29 # Comment out either line to disable that type of linking for *modules only*
30 # Both at once is a legal configuration!
34 # Comment out these lines to disable building dynamic/static libpam.*
38 # All combinations of the above four variable definitions are legal,
39 # however, not defining either dynamic or static modules and yet
40 # creating a some flavor of LIBPAM will make an authentication library
43 # Here we indicate which libraries are present on the local system
44 # they control the building of some modules in this distribution
45 # Note, these definitions are all "export"ed below...
52 # NB. The following is the generic defines for compilation.
53 # They can be overridden in the default.defs file below
55 WARNINGS = -ansi -D_POSIX_SOURCE -Wall -Wwrite-strings \
56 -Wpointer-arith -Wcast-qual -Wcast-align \
57 -Wtraditional -Wstrict-prototypes -Wmissing-prototypes \
58 -Wnested-externs -Winline -Wshadow -pedantic
61 # Mode to install shared libraries with
65 # Conditional defines..
69 # need the dynamic library functions
72 # needed because pam_xxx() fn's are now in statically linked library
77 # Here we include the defines for the preferred operating system
78 # these include things like CC, CFLAGS and destination directories
79 # etc.. By default, this is a symbolic link to one of the .defs files
80 # the .../defs/ directory. Please take a moment to check that you are
81 # using the correct one.
85 # to turn on the fprintf(stderr, ..) debugging lines throughout the
86 # distribution uncomment this line
89 # For serious memory allocation tracing uncomment the following
90 #MEMORY_DEBUG=-DMEMORY_DEBUG
92 #######################################################################
93 # The pam_unix module in this file will not work on NIS based systems.#
94 #######################################################################
96 # ////////////////////////////////////////////////////
97 # // You should not modify anything below this line //
98 # ////////////////////////////////////////////////////
100 # the sub-directories to make things in
102 DIRS = modules libpam conf libpam_misc examples
108 INCLUDEDIR=-I$(shell pwd)/include
109 PAMLIB=-L$(shell pwd)/libpam
110 PAMMISCLIB=-L$(shell pwd)/libpam_misc
111 ifeq ($(DEBUG_REL),yes)
113 PAMMISCLIB += -lpamd_misc
116 PAMMISCLIB += -lpam_misc
120 # This is Linux-PAM and not a version from Sun etc..
121 # [Note, this does not describe the operating system you are using
122 # only that you are compiling the "Linux" (read FREE) implementation
123 # of Pluggable Authentication Modules.
124 EXTRAS += -DLINUX_PAM
127 # build composite defines
130 LOADLIBES = $(PAMLIB) $(RDYNAMIC) $(PAMMISCLIB) $(LIBDL) $(ULIBS)
132 CFLAGS += $(EXTRAS) $(MEMORY_DEBUG) $(WARNINGS) $(INCLUDEDIR) $(PIC)
133 ifneq ($(strip $(OS)),)
136 ifneq ($(strip $(ARCH)),)
141 # export the libraries-available info; the modules should know how
142 # to deal with this...
152 export MAJOR_REL # the major release of this distribution
153 export MINOR_REL # the minor release of this distribution
154 export DEBUG_REL # for installing a debugging version of PAM
155 export OS # operating system
156 export ARCH # architecture
157 export CC # the C compiler
158 export INSTALL # to do instalations with
159 export MKDIR # to ensure directories exist
160 export CFLAGS # CC flags used to compile everything
161 export LD_D # build a shared object file (module)
162 export LD_L # build a shared library (e.g. libpam)
163 export USESONAME # does shlib link command require soname option
164 export SOSWITCH # shlib lib soname switch name
165 export NEEDSONAME # does shared library link need versioned lib
166 export LD # build a generic library
167 export LDCONFIG # rebuild the shared libraries
168 export AR # build a static library
169 export RANLIB # reorder a static library
170 export LOADLIBES # libraries needed for application linking
171 export PAMLIB # where to find the local libpam.xx file
172 export DYNTYPE # which suffix is used for libraries
173 export SHLIBMODE # file mode for shared objects
175 # where to install things
177 export FAKEROOT # for package maintainers
179 export PREFIX # basic prefix for all other directories
180 export SUPLEMENTED # where to store module helper binaries
181 export LIBDIR # where libpam and libpam_misc go
182 export SECUREDIR # where the modules will be placed
183 export INCLUDED # where to store pam---.h files
184 export CONFIGED # where pam.conf and pam.d/ go
185 export SCONFIGED # where modules' config files go
188 # Conditional exporting ( ... these go on for a while... )
197 export DYNAMIC_LIBPAM
211 @for i in $(DIRS) ; do \
212 $(MAKE) -C $$i all ; \
213 if [ $$? -ne 0 ]; then break ; fi ; \
219 .old_freezemake: Makefile
221 @echo "*WARNING*: If you are running a system that is dependent"
222 @echo " on PAM to work. DO NOT make sterile NOR make remove."
223 @echo " These options will delete the PAM files on your system"
224 @echo " and make it unusable!"
226 @echo "If you are in any doubt, just do 'make all' (or just"
227 @echo "'make'). It is likely that this is the SAFEST thing to do...."
231 @for i in $(DIRS) ; do \
232 $(MAKE) -C $$i install ; \
233 if [ $$? -ne 0 ]; then break ; fi ; \
235 install ./doc/man/*.3 $(PREFIX)/man/man3/
236 install ./doc/man/*.8 $(PREFIX)/man/man8/
243 @for i in $(DIRS) ; do \
244 $(MAKE) -C $$i remove ; \
249 @for i in $(DIRS) ; do \
250 $(MAKE) -C $$i clean ; \
254 @for i in $(DIRS) doc; do \
255 $(MAKE) -C $$i extraclean ; \
259 @$(MAKE) -C conf check
262 @$(MAKE) -C conf RCScheck
264 # this can be used to see what hasn't been check'd into RCS
267 @find . \( -type f -a -perm 644 \) -print
270 @egrep '^DEBUG\_REL\=yes' Makefile|grep -v grep > /dev/null ;\
271 if [ $$? -eq 0 ]; then \
272 echo "You should first set DEBUG_REL to no" ; exit 1 ; fi
275 touch .filelist .RCSlist
276 chmod 600 .filelist .RCSlist
277 cd .. ; find $(RELNAME) \! -type d -print | fgrep -v RCS | fgrep -v 'conf/.md5sum' > $(RELNAME)/.filelist
278 cd .. ; find $(RELNAME) -type f -print | fgrep RCS | fgrep -v 'conf/.RCSsum' > $(RELNAME)/.RCSlist
279 chmod 400 .filelist .RCSlist
282 (cat .filelist ; echo $(RELNAME)/conf/.md5sum) | (cd .. ; tar -cz -f$(DISTFILE) -T-)
283 (cat .RCSlist ; echo $(RELNAME)/conf/.RCSsum) | (cd .. ; tar -cz -fRCS+$(DISTFILE) -T-)