Home | History | Annotate | Line # | Download | only in libcrypto
      1  1.39  christos #	$NetBSD: Makefile,v 1.39 2025/09/18 13:57:34 christos Exp $
      2   1.1  christos 
      3   1.1  christos # RCSid:
      4   1.1  christos #	Id: Makefile,v 1.33 1998/11/11 11:53:53 sjg Exp
      5   1.1  christos #
      6   1.1  christos #	@(#) Copyright (c) 1994 Simon J. Gerraty
      7   1.1  christos #
      8   1.1  christos #	This file is provided in the hope that it will
      9   1.1  christos #	be of use.  There is absolutely NO WARRANTY.
     10   1.1  christos #	Permission to copy, redistribute or otherwise
     11  1.30  riastrad #	use this file is hereby granted provided that
     12   1.1  christos #	the above copyright notice and this notice are
     13  1.30  riastrad #	left intact.
     14  1.30  riastrad #
     15   1.1  christos #	Please send copies of changes and bug-fixes to:
     16   1.1  christos #	sjg (at] quick.com.au
     17   1.1  christos #
     18   1.1  christos 
     19   1.1  christos LIB=	crypto
     20   1.1  christos USE_FORT?= yes	# cryptographic software
     21   1.1  christos USE_SHLIBDIR=	yes
     22   1.1  christos USE_FIPS=	no
     23  1.18  christos #DBG=-g
     24   1.1  christos 
     25   1.1  christos .include <bsd.own.mk>
     26   1.1  christos .include <bsd.shlib.mk>
     27   1.1  christos 
     28   1.6  christos CPPFLAGS+= -Dlib${LIB} -I. -I${OPENSSLSRC}/crypto -I${OPENSSLSRC}
     29  1.13  christos CPPFLAGS+= -I${OPENSSLSRC}/include -I${OPENSSLSRC}/crypto/include
     30   1.6  christos CPPFLAGS+= -I${OPENSSLSRC}/crypto/asn1 -I${OPENSSLSRC}/crypto/evp
     31  1.12       spz CPPFLAGS+= -I${OPENSSLSRC}/crypto/modes
     32  1.13  christos CPPFLAGS+= -I${OPENSSLSRC}/../include
     33  1.23  christos 
     34   1.1  christos CRYPTODIST=	${NETBSDSRCDIR}/crypto
     35  1.23  christos OPENSSLINC=	${OPENSSLSRC}/include/openssl
     36   1.1  christos 
     37   1.1  christos .include "${NETBSDSRCDIR}/crypto/Makefile.openssl"
     38  1.30  riastrad .PATH: ${OPENSSLSRC} ${OPENSSLINC}
     39  1.23  christos .PATH: ${OPENSSLSRC}/../include/openssl
     40   1.1  christos 
     41   1.1  christos .include "srcs.inc"
     42  1.23  christos .include "${.CURDIR}/../libdefault/srcs.inc"
     43  1.23  christos CPPFLAGS+= -I${.CURDIR}/../libdefault
     44  1.27  christos CPPFLAGS+= -I${OPENSSLSRC}/providers/common/include
     45  1.27  christos CPPFLAGS+= -I${OPENSSLSRC}/providers/implementations/include
     46  1.23  christos .PATH: ${.CURDIR}/../libdefault
     47  1.23  christos .include "${.CURDIR}/../libcommon/srcs.inc"
     48  1.23  christos .PATH: ${.CURDIR}/../libcommon
     49   1.1  christos 
     50   1.1  christos AFLAGS+=-DELF
     51   1.1  christos LIBDPLIBS+= crypt ${NETBSDSRCDIR}/lib/libcrypt
     52   1.1  christos 
     53   1.1  christos OS_VERSION!= ${HOST_SH} ${NETBSDSRCDIR}/sys/conf/osrelease.sh
     54   1.1  christos 
     55   1.1  christos # XXX CFLAGS: While it would be nice to know which compiler flags
     56   1.1  christos # XXX the library was built with, we don't want pathname information
     57   1.1  christos # XXX for the host toolchain embedded in the image.
     58   1.1  christos ${SRCS}: buildinf.h
     59   1.1  christos buildinf.h: Makefile
     60   1.1  christos 	@echo "#ifndef MK1MF_BUILD" >buildinf.h
     61  1.17  christos 	@echo "#define compiler_flags \"`${CC} -v 2>&1 | grep 'gcc version'`\"" >>buildinf.h
     62   1.1  christos 	@echo "#define PLATFORM \"NetBSD-${MACHINE_ARCH}\"" >>buildinf.h
     63   1.1  christos 	@echo "#define DATE \"NetBSD ${OS_VERSION}\"" >>buildinf.h
     64   1.1  christos 	@echo "#endif" >>buildinf.h
     65   1.1  christos 
     66   1.1  christos CLEANFILES+= buildinf.h
     67   1.1  christos 
     68   1.1  christos # This list is built from the contents of the include/openssl
     69   1.1  christos # directory in the OpenSSL source distribution.
     70  1.17  christos INCS+= \
     71  1.17  christos aes.h \
     72  1.17  christos asn1.h \
     73  1.17  christos asn1_mac.h \
     74  1.17  christos asn1err.h \
     75  1.17  christos asn1t.h \
     76  1.17  christos async.h \
     77  1.17  christos asyncerr.h \
     78  1.17  christos bio.h \
     79  1.17  christos bioerr.h \
     80  1.17  christos blowfish.h \
     81  1.17  christos bn.h \
     82  1.17  christos bnerr.h \
     83  1.17  christos buffer.h \
     84  1.17  christos buffererr.h \
     85  1.17  christos camellia.h \
     86  1.17  christos cast.h \
     87  1.17  christos cmac.h \
     88  1.23  christos cmp.h \
     89  1.23  christos cmp_util.h \
     90  1.23  christos cmperr.h \
     91  1.17  christos cms.h \
     92  1.17  christos cmserr.h \
     93  1.17  christos comp.h \
     94  1.17  christos comperr.h \
     95  1.17  christos conf.h \
     96  1.17  christos conf_api.h \
     97  1.17  christos conferr.h \
     98  1.23  christos configuration.h \
     99  1.23  christos conftypes.h \
    100  1.23  christos core.h \
    101  1.23  christos core_dispatch.h \
    102  1.23  christos core_names.h \
    103  1.23  christos core_object.h \
    104  1.23  christos crmf.h \
    105  1.23  christos crmferr.h \
    106  1.17  christos crypto.h \
    107  1.17  christos cryptoerr.h \
    108  1.23  christos cryptoerr_legacy.h \
    109  1.17  christos ct.h \
    110  1.17  christos cterr.h \
    111  1.23  christos decoder.h \
    112  1.23  christos decodererr.h \
    113  1.17  christos des.h \
    114  1.17  christos dh.h \
    115  1.17  christos dherr.h \
    116  1.17  christos dsa.h \
    117  1.17  christos dsaerr.h \
    118  1.17  christos dtls1.h \
    119  1.17  christos e_os2.h \
    120  1.17  christos ebcdic.h \
    121  1.17  christos ec.h \
    122  1.17  christos ecdh.h \
    123  1.17  christos ecdsa.h \
    124  1.17  christos ecerr.h \
    125  1.23  christos encoder.h \
    126  1.23  christos encodererr.h \
    127  1.17  christos engine.h \
    128  1.17  christos engineerr.h \
    129  1.17  christos err.h \
    130  1.23  christos ess.h \
    131  1.23  christos esserr.h \
    132  1.17  christos evp.h \
    133  1.17  christos evperr.h \
    134  1.23  christos fips_names.h \
    135  1.23  christos fipskey.h \
    136  1.17  christos hmac.h \
    137  1.23  christos http.h \
    138  1.23  christos httperr.h \
    139  1.17  christos kdf.h \
    140  1.17  christos kdferr.h \
    141  1.17  christos lhash.h \
    142  1.23  christos macros.h \
    143  1.17  christos md2.h \
    144  1.17  christos md4.h \
    145  1.17  christos md5.h \
    146  1.17  christos modes.h \
    147  1.17  christos obj_mac.h \
    148  1.17  christos objects.h \
    149  1.17  christos objectserr.h \
    150  1.17  christos ocsp.h \
    151  1.17  christos ocsperr.h \
    152  1.17  christos opensslconf.h \
    153  1.17  christos opensslv.h \
    154  1.17  christos ossl_typ.h \
    155  1.23  christos param_build.h \
    156  1.23  christos params.h \
    157  1.17  christos pem.h \
    158  1.17  christos pem2.h \
    159  1.17  christos pemerr.h \
    160  1.17  christos pkcs12.h \
    161  1.17  christos pkcs12err.h \
    162  1.17  christos pkcs7.h \
    163  1.17  christos pkcs7err.h \
    164  1.23  christos prov_ssl.h \
    165  1.23  christos proverr.h \
    166  1.23  christos provider.h \
    167  1.17  christos rand.h \
    168  1.17  christos randerr.h \
    169  1.17  christos rc2.h \
    170  1.17  christos rc4.h \
    171  1.17  christos ripemd.h \
    172  1.17  christos rsa.h \
    173  1.17  christos rsaerr.h \
    174  1.17  christos safestack.h \
    175  1.17  christos seed.h \
    176  1.23  christos self_test.h \
    177  1.17  christos sha.h \
    178  1.17  christos srp.h \
    179  1.17  christos srtp.h \
    180  1.17  christos ssl.h \
    181  1.17  christos ssl2.h \
    182  1.17  christos ssl3.h \
    183  1.17  christos sslerr.h \
    184  1.23  christos sslerr_legacy.h \
    185  1.17  christos stack.h \
    186  1.17  christos store.h \
    187  1.17  christos storeerr.h \
    188  1.17  christos symhacks.h \
    189  1.39  christos thread.h \
    190  1.17  christos tls1.h \
    191  1.23  christos trace.h \
    192  1.17  christos ts.h \
    193  1.17  christos tserr.h \
    194  1.17  christos txt_db.h \
    195  1.23  christos types.h \
    196  1.17  christos ui.h \
    197  1.17  christos uierr.h \
    198  1.17  christos whrlpool.h \
    199  1.17  christos x509.h \
    200  1.17  christos x509_vfy.h \
    201  1.17  christos x509err.h \
    202  1.17  christos x509v3.h \
    203  1.17  christos x509v3err.h
    204   1.1  christos 
    205   1.1  christos # IDEA - patented, but we install the header anyways
    206   1.1  christos INCS+=	idea.h
    207   1.1  christos 
    208   1.1  christos # RC5 - patented, but we install the header anyways
    209   1.1  christos INCS+=	rc5.h
    210   1.1  christos 
    211   1.1  christos # MDC2 - patented, but we install the header anyways
    212   1.1  christos INCS+=	mdc2.h
    213   1.1  christos 
    214   1.1  christos .if (${USE_FIPS} != "no")
    215   1.1  christos # FIPS
    216   1.1  christos # This part is always included, because OpenSSL does not protect
    217   1.1  christos # The FIPS include files
    218   1.1  christos .PATH: ${OPENSSLSRC}/fips ${OPENSSLSRC}/fips/rand
    219   1.1  christos INCS+=	fips.h fips_rand.h
    220   1.1  christos .endif
    221   1.1  christos 
    222   1.1  christos .if (${USE_FIPS} != "no")
    223   1.1  christos CPPFLAGS+=-DOPENSSL_FIPS
    224   1.1  christos .PATH: ${OPENSSLSRC}/fips/aes
    225   1.1  christos SRCS+=fips_aes_core.c fips_aes_selftest.c
    226   1.1  christos .PATH: ${OPENSSLSRC}/fips/des
    227   1.1  christos SRCS+=fips_des_enc.c fips_des_selftest.c fips_set_key.c
    228  1.30  riastrad # asm/fips-dx86-elf.s
    229   1.1  christos .PATH: ${OPENSSLSRC}/fips/dh
    230   1.1  christos SRCS+=fips_dh_check.c fips_dh_gen.c fips_dh_key.c
    231   1.1  christos .PATH: ${OPENSSLSRC}/fips/dsa
    232   1.1  christos SRCS+=fips_dsa_ossl.c fips_dsa_gen.c fips_dsa_selftest.c
    233   1.1  christos #.PATH: ${OPENSSLSRC}/fips/rand
    234   1.1  christos SRCS+=fips_rand.c
    235   1.1  christos .PATH: ${OPENSSLSRC}/fips/rsa
    236   1.1  christos SRCS+=fips_rsa_eay.c fips_rsa_gen.c fips_rsa_selftest.c
    237   1.1  christos SRCS+=fips_sha1dgst.c fips_sha1_selftest.c
    238   1.1  christos # asm/sx86-elf.s
    239   1.1  christos .PATH: ${OPENSSLSRC}/fips/sha1
    240   1.1  christos #.PATH: ${OPENSSLSRC}/fips
    241   1.1  christos SRCS+=fips.c fips_err_wrapper.c
    242   1.1  christos 
    243   1.1  christos SRCS+=rc5_skey.c i_skey.c mdc2dgst.c
    244   1.1  christos .endif
    245   1.1  christos 
    246  1.38  christos COPTS.eng_padlock.c = -Wno-error=stack-protector
    247  1.38  christos COPTS.bn_exp.c = -Wno-error=stack-protector
    248   1.1  christos 
    249   1.1  christos INCSDIR=/usr/include/openssl
    250   1.1  christos 
    251  1.35  riastrad VERSION_MAP=	crypto.map
    252  1.14  christos 
    253   1.7  christos PKGCONFIG=libcrypto
    254   1.7  christos .include "${.CURDIR}/../../pkgconfig.mk"
    255   1.7  christos 
    256  1.23  christos # too much of a pain to generate opensslv.h / configuration.h / fipskey.h
    257  1.23  christos GENH = \
    258  1.23  christos asn1.h \
    259  1.23  christos asn1t.h \
    260  1.23  christos bio.h \
    261  1.23  christos cmp.h \
    262  1.23  christos cms.h \
    263  1.23  christos conf.h \
    264  1.23  christos crmf.h \
    265  1.23  christos crypto.h \
    266  1.23  christos ct.h \
    267  1.23  christos err.h \
    268  1.23  christos ess.h \
    269  1.23  christos lhash.h \
    270  1.23  christos ocsp.h \
    271  1.23  christos pkcs12.h \
    272  1.23  christos pkcs7.h \
    273  1.23  christos safestack.h \
    274  1.23  christos srp.h \
    275  1.26  christos ssl.h \
    276  1.23  christos ui.h \
    277  1.23  christos x509.h \
    278  1.23  christos x509_vfy.h \
    279  1.23  christos x509v3.h
    280  1.23  christos 
    281  1.23  christos .for i in ${GENH}
    282  1.23  christos $i: $i.in
    283  1.23  christos 	${_MKTARGET_CREATE}
    284  1.33    hgutch 	${HOST_SH} ${.CURDIR}/gen ${.ALLSRC} > ${.TARGET}
    285  1.23  christos .endfor
    286  1.14  christos 
    287   1.1  christos .include <bsd.lib.mk>
    288