Blame crypt/Makefile

Packit 6c4009
# Copyright (C) 1996-2018 Free Software Foundation, Inc.
Packit 6c4009
# This file is part of the GNU C Library.
Packit 6c4009
Packit 6c4009
# The GNU C Library is free software; you can redistribute it and/or
Packit 6c4009
# modify it under the terms of the GNU Lesser General Public
Packit 6c4009
# License as published by the Free Software Foundation; either
Packit 6c4009
# version 2.1 of the License, or (at your option) any later version.
Packit 6c4009
Packit 6c4009
# The GNU C Library is distributed in the hope that it will be useful,
Packit 6c4009
# but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 6c4009
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
Packit 6c4009
# Lesser General Public License for more details.
Packit 6c4009
Packit 6c4009
# You should have received a copy of the GNU Lesser General Public
Packit 6c4009
# License along with the GNU C Library; if not, see
Packit 6c4009
# <http://www.gnu.org/licenses/>.
Packit 6c4009
Packit 6c4009
#
Packit 6c4009
#	Sub-makefile for crypt() portion of the library.
Packit 6c4009
#
Packit 6c4009
subdir	:= crypt
Packit 6c4009
Packit 6c4009
include ../Makeconfig
Packit 6c4009
Packit 6c4009
headers := crypt.h
Packit 6c4009
Packit 6c4009
extra-libs := libcrypt
Packit 6c4009
extra-libs-others := $(extra-libs)
Packit 6c4009
Packit 6c4009
libcrypt-routines := crypt-entry md5-crypt sha256-crypt sha512-crypt crypt \
Packit 6c4009
		     crypt_util
Packit 6c4009
Packit 6c4009
tests := cert md5c-test sha256c-test sha512c-test badsalttest
Packit 6c4009
Packit 6c4009
ifeq ($(nss-crypt),yes)
Packit 6c4009
nss-cpp-flags := -DUSE_NSS \
Packit 6c4009
  -I$(shell nss-config --includedir) -I$(shell nspr-config --includedir)
Packit 6c4009
CPPFLAGS-sha256-crypt.c += $(nss-cpp-flags)
Packit 6c4009
CPPFLAGS-sha512-crypt.c += $(nss-cpp-flags)
Packit 6c4009
CPPFLAGS-md5-crypt.c += $(nss-cpp-flags)
Packit 6c4009
LDLIBS-crypt.so = -lfreebl3
Packit 6c4009
else
Packit 6c4009
libcrypt-routines += md5 sha256 sha512
Packit 6c4009
Packit 6c4009
tests += md5test sha256test sha512test
Packit 6c4009
Packit 6c4009
# The test md5test-giant uses up to 400 MB of RSS and runs on a fast
Packit 6c4009
# machine over a minute.
Packit 6c4009
xtests = md5test-giant
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
include ../Rules
Packit 6c4009
Packit 6c4009
ifneq ($(nss-crypt),yes)
Packit 6c4009
md5-routines := md5 $(filter md5%,$(libcrypt-sysdep_routines))
Packit 6c4009
sha256-routines := sha256 $(filter sha256%,$(libcrypt-sysdep_routines))
Packit 6c4009
sha512-routines := sha512 $(filter sha512%,$(libcrypt-sysdep_routines))
Packit 6c4009
Packit 6c4009
$(objpfx)md5test: $(patsubst %, $(objpfx)%.o,$(md5-routines))
Packit 6c4009
$(objpfx)md5test-giant: $(patsubst %, $(objpfx)%.o,$(md5-routines))
Packit 6c4009
$(objpfx)sha256test: $(patsubst %, $(objpfx)%.o,$(sha256-routines))
Packit 6c4009
$(objpfx)sha512test: $(patsubst %, $(objpfx)%.o,$(sha512-routines))
Packit 6c4009
endif
Packit 6c4009
Packit 6c4009
ifeq (yes,$(build-shared))
Packit 6c4009
$(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.so
Packit 6c4009
else
Packit 6c4009
$(addprefix $(objpfx),$(tests)): $(objpfx)libcrypt.a
Packit 6c4009
endif