xref: /freebsd/lib/libpam/static_libpam/Makefile (revision 7cbd0a2953a27e74f8b1b261808068719c1f5260)
1*7cbd0a29SBryan Drewery#-
2*7cbd0a29SBryan Drewery# Copyright (c) 1998-2015 Juniper Networks, Inc.
3*7cbd0a29SBryan Drewery# All rights reserved.
4*7cbd0a29SBryan Drewery# Copyright (c) 2002 Networks Associates Technology, Inc.
5*7cbd0a29SBryan Drewery# All rights reserved.
6*7cbd0a29SBryan Drewery#
7*7cbd0a29SBryan Drewery# Portions of this software was developed for the FreeBSD Project by
8*7cbd0a29SBryan Drewery# ThinkSec AS and NAI Labs, the Security Research Division of Network
9*7cbd0a29SBryan Drewery# Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
10*7cbd0a29SBryan Drewery# ("CBOSS"), as part of the DARPA CHATS research program.
11*7cbd0a29SBryan Drewery#
12*7cbd0a29SBryan Drewery# Redistribution and use in source and binary forms, with or without
13*7cbd0a29SBryan Drewery# modification, are permitted provided that the following conditions
14*7cbd0a29SBryan Drewery# are met:
15*7cbd0a29SBryan Drewery# 1. Redistributions of source code must retain the above copyright
16*7cbd0a29SBryan Drewery#    notice, this list of conditions and the following disclaimer.
17*7cbd0a29SBryan Drewery# 2. Redistributions in binary form must reproduce the above copyright
18*7cbd0a29SBryan Drewery#    notice, this list of conditions and the following disclaimer in the
19*7cbd0a29SBryan Drewery#    documentation and/or other materials provided with the distribution.
20*7cbd0a29SBryan Drewery# 3. The name of the author may not be used to endorse or promote
21*7cbd0a29SBryan Drewery#    products derived from this software without specific prior written
22*7cbd0a29SBryan Drewery#    permission.
23*7cbd0a29SBryan Drewery#
24*7cbd0a29SBryan Drewery# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
25*7cbd0a29SBryan Drewery# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26*7cbd0a29SBryan Drewery# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
27*7cbd0a29SBryan Drewery# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
28*7cbd0a29SBryan Drewery# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29*7cbd0a29SBryan Drewery# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
30*7cbd0a29SBryan Drewery# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
31*7cbd0a29SBryan Drewery# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32*7cbd0a29SBryan Drewery# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
33*7cbd0a29SBryan Drewery# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34*7cbd0a29SBryan Drewery# SUCH DAMAGE.
35*7cbd0a29SBryan Drewery#
36*7cbd0a29SBryan Drewery# $FreeBSD$
37*7cbd0a29SBryan Drewery
38*7cbd0a29SBryan Drewery.PATH: ${.CURDIR}/../libpam
39*7cbd0a29SBryan Drewery
40*7cbd0a29SBryan Drewery# Only build the static library.
41*7cbd0a29SBryan DreweryLIB=	pam
42*7cbd0a29SBryan DreweryNO_PIC=
43*7cbd0a29SBryan Drewery
44*7cbd0a29SBryan Drewery# Avoid redundancy with the master Makefile.
45*7cbd0a29SBryan DreweryMAN=
46*7cbd0a29SBryan DreweryINCS=
47*7cbd0a29SBryan DreweryMLINKS=
48*7cbd0a29SBryan DreweryMK_TESTS=	no
49*7cbd0a29SBryan Drewery
50*7cbd0a29SBryan Drewery#
51*7cbd0a29SBryan Drewery# Static modules
52*7cbd0a29SBryan Drewery#
53*7cbd0a29SBryan Drewery# We build static versions of all modules and of openpam_static.o,
54*7cbd0a29SBryan Drewery# then link them all together into openpam_static_modules.o.  None of
55*7cbd0a29SBryan Drewery# the modules export any symbols, but they store structures with
56*7cbd0a29SBryan Drewery# pointers to their service functions in a linker set which the code
57*7cbd0a29SBryan Drewery# in openpam_static.c traverses to locate the individual modules.
58*7cbd0a29SBryan Drewery#
59*7cbd0a29SBryan DreweryMODULE_DIR=	../modules
60*7cbd0a29SBryan Drewery.include "${.CURDIR}/${MODULE_DIR}/modules.inc"
61*7cbd0a29SBryan DrewerySTATIC_MODULES=	${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/}
62*7cbd0a29SBryan DrewerySTATICOBJS+=	openpam_static_modules.o
63*7cbd0a29SBryan DreweryCLEANFILES+=	openpam_static.o \
64*7cbd0a29SBryan Drewery		openpam_static_modules.o
65*7cbd0a29SBryan Drewery
66*7cbd0a29SBryan Dreweryopenpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
67*7cbd0a29SBryan Drewery	${LD} -o ${.TARGET} -r --whole-archive ${.ALLSRC}
68*7cbd0a29SBryan Drewery
69*7cbd0a29SBryan Drewery.include "${.CURDIR}/../libpam/Makefile"
70