xref: /freebsd/lib/libpam/static_libpam/Makefile (revision d85550da9d09ad12b5246122263905748493b267)
17cbd0a29SBryan Drewery#-
27cbd0a29SBryan Drewery# Copyright (c) 1998-2015 Juniper Networks, Inc.
37cbd0a29SBryan Drewery# All rights reserved.
47cbd0a29SBryan Drewery# Copyright (c) 2002 Networks Associates Technology, Inc.
57cbd0a29SBryan Drewery# All rights reserved.
67cbd0a29SBryan Drewery#
77cbd0a29SBryan Drewery# Portions of this software was developed for the FreeBSD Project by
87cbd0a29SBryan Drewery# ThinkSec AS and NAI Labs, the Security Research Division of Network
97cbd0a29SBryan Drewery# Associates, Inc.  under DARPA/SPAWAR contract N66001-01-C-8035
107cbd0a29SBryan Drewery# ("CBOSS"), as part of the DARPA CHATS research program.
117cbd0a29SBryan Drewery#
127cbd0a29SBryan Drewery# Redistribution and use in source and binary forms, with or without
137cbd0a29SBryan Drewery# modification, are permitted provided that the following conditions
147cbd0a29SBryan Drewery# are met:
157cbd0a29SBryan Drewery# 1. Redistributions of source code must retain the above copyright
167cbd0a29SBryan Drewery#    notice, this list of conditions and the following disclaimer.
177cbd0a29SBryan Drewery# 2. Redistributions in binary form must reproduce the above copyright
187cbd0a29SBryan Drewery#    notice, this list of conditions and the following disclaimer in the
197cbd0a29SBryan Drewery#    documentation and/or other materials provided with the distribution.
207cbd0a29SBryan Drewery# 3. The name of the author may not be used to endorse or promote
217cbd0a29SBryan Drewery#    products derived from this software without specific prior written
227cbd0a29SBryan Drewery#    permission.
237cbd0a29SBryan Drewery#
247cbd0a29SBryan Drewery# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
257cbd0a29SBryan Drewery# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
267cbd0a29SBryan Drewery# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
277cbd0a29SBryan Drewery# ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
287cbd0a29SBryan Drewery# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
297cbd0a29SBryan Drewery# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
307cbd0a29SBryan Drewery# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
317cbd0a29SBryan Drewery# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
327cbd0a29SBryan Drewery# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
337cbd0a29SBryan Drewery# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
347cbd0a29SBryan Drewery# SUCH DAMAGE.
357cbd0a29SBryan Drewery#
367cbd0a29SBryan Drewery# $FreeBSD$
377cbd0a29SBryan Drewery
38*d85550daSEnji Cooper.PATH: ${SRCTOP}/lib/libpam
397cbd0a29SBryan Drewery
407cbd0a29SBryan Drewery# Only build the static library.
417cbd0a29SBryan DreweryLIB=	pam
427cbd0a29SBryan DreweryNO_PIC=
437cbd0a29SBryan Drewery
447cbd0a29SBryan Drewery# Avoid redundancy with the master Makefile.
457cbd0a29SBryan DreweryMAN=
467cbd0a29SBryan DreweryINCS=
477cbd0a29SBryan DreweryMLINKS=
487cbd0a29SBryan DreweryMK_TESTS=	no
497cbd0a29SBryan Drewery
507cbd0a29SBryan Drewery#
517cbd0a29SBryan Drewery# Static modules
527cbd0a29SBryan Drewery#
537cbd0a29SBryan Drewery# We build static versions of all modules and of openpam_static.o,
547cbd0a29SBryan Drewery# then link them all together into openpam_static_modules.o.  None of
557cbd0a29SBryan Drewery# the modules export any symbols, but they store structures with
567cbd0a29SBryan Drewery# pointers to their service functions in a linker set which the code
577cbd0a29SBryan Drewery# in openpam_static.c traverses to locate the individual modules.
587cbd0a29SBryan Drewery#
597cbd0a29SBryan DreweryMODULE_DIR=	../modules
607cbd0a29SBryan Drewery.include "${.CURDIR}/${MODULE_DIR}/modules.inc"
617cbd0a29SBryan DrewerySTATIC_MODULES=	${MODULES:C/.*/${MODULE_DIR}\/&\/lib&.a/}
627cbd0a29SBryan DrewerySTATICOBJS+=	openpam_static_modules.o
637cbd0a29SBryan DreweryCLEANFILES+=	openpam_static.o \
647cbd0a29SBryan Drewery		openpam_static_modules.o
657cbd0a29SBryan Drewery
667cbd0a29SBryan Dreweryopenpam_static_modules.o: openpam_static.o ${STATIC_MODULES}
677ef4651aSAlexander Kabaev	${CC} -nostdlib ${CFLAGS} -o ${.TARGET} -r -Wl,--whole-archive ${.ALLSRC}
687cbd0a29SBryan Drewery
69*d85550daSEnji Cooper.include "${.CURDIR:H}/libpam/Makefile"
70