⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 makefile

📁 cryptlib安全工具包
💻
📖 第 1 页 / 共 5 页
字号:
#****************************************************************************
#*																			*
#*							Makefile for cryptlib 3.3.x						*
#*						Copyright Peter Gutmann 1995-2007					*
#*																			*
#****************************************************************************

# This makefile contains extensive amounts of, uhh, business logic which,
# alongside further logic in the cryptlib OS-specific header files, ensures
# that cryptlib auto-configures itself and builds out of the box on most
# systems.  Before you ask about redoing the makefile using autoconf, have a
# look at what it would take to move all of this logic across to another
# build mechanism.
#
# "The makefile is looking really perverse.  You're getting the hang of it"
#														- Chris Wedgwood.
# At least it doesn't pipe itself through sed yet.
#
# (Note that as of 3.1 beta 3, it does pipe itself through sed on non-Unix
#  systems to retarget Unix-specific files to OS-specific ones and perform
#  various other operations that aren't easily possible by adding another
#  level of recursion).
#
# The self-test program pulls in parts of cryptlib to ensure that the self-
# configuration works.  Because this is handled by the makefile, you can't
# just 'make testlib' after making changes, you need to use 'make; make
# testlib'.

# Naming information: Major and minor version numbers and project and library
# names (static lib, shared lib, and OS X dylib).  The patch level is always
# zero because patches imply bugs and my code is perfect.
#
# Note that when updating these values it'll also be necessary to update the
# equivalents in tools/buildall.sh.

MAJ		= 3
MIN		= 3
PLV		= 2
PROJ	= cl
LIBNAME	= lib$(PROJ).a
SLIBNAME = lib$(PROJ).so.$(MAJ).$(MIN).$(PLV)
DYLIBNAME = lib$(PROJ).$(MAJ).$(MIN).dylib

# Compiler options.  By default this builds the release version of the code,
# to build the debug version (which is useful for finding compiler bugs and
# system-specific peculiarities) remove the NDEBUG define.  Many problems
# will now trigger an assertion at the point of failure rather than returning
# an error status from 100 levels down in the code, although as of 3.3.2
# many of the earlier assertions have been turned into REQUIRES/ENSURES
# predicates that are applied even in the release version.
#
# Note that the gcc build uses -fomit-frame-pointer to free up an extra
# register on x86 (which desperately needs it), this will screw up gdb if
# you try and debug a version compiled with this option.
#
# If the OS supports it, the multithreaded version of cryptlib will be built.
# To specifically disable this add -DNO_THREADS.
#
# Further cc flags are gathered dynamically at runtime via the ccopts.sh
# script.

CFLAGS		= "-c -D__UNIX__ -DNDEBUG -I."

# To link the self-test code with a key database, uncomment the following
# and substitute the name or names of the database libraries you'll be using.

# TESTLIB	= -lodbc
# TESTLIB	= -lmysql
# TESTLIB	= -L/oracle/product/server/9i/lib -lclient9

# Paths and command names.  We have to be careful with comments attached to
# path defines because some makes don't strip trailing spaces.
#
# The reason for the almost-identical defines for path and dir is because of
# the braindamaged BSDI mkdir (and rmdir) that break if the path ends in a
# '/', it's easier to have separate defines than to drop a '/' into every
# path.

STATIC_OBJ_PATH = ./static-obj/
STATIC_OBJ_DIR = ./static-obj
SHARED_OBJ_PATH = ./shared-obj/
SHARED_OBJ_DIR = ./shared-obj
CPP			= $(CC) -E
LD			= $(CC)
AR			= ar
SHELL		= /bin/sh
OSNAME		= `uname`
LINKFILE	= link.tmp

# Default target and obj file path.  This is changed depending on whether
# we're building the static or shared library, the default is to build the
# static library.

TARGET		= $(LIBNAME)
OBJPATH		= $(STATIC_OBJ_PATH)

# Some makes don't pass defines down when they recursively invoke make, so we
# need to manually pass them along.  The following macro contains all defines
# that we want to pass to recursive calls to make.

DEFINES		= $(TARGET) OBJPATH=$(OBJPATH) OSNAME=$(OSNAME)

# Cross-compilation/non-Unix options, which are just the standard ones with
# Unix-specific entries (-D__UNIX__, use of uname to identify the system)
# removed.  The actual values are explicitly given in the rules for each non-
# Unix target.

XCFLAGS		= -c -DNDEBUG -I.
XDEFINES	= $(TARGET) OBJPATH=$(OBJPATH) CROSSCOMPILE=1

# Cross-compilation paths.  The Palm SDK under Cygwin only understands
# heavily-escaped absolute MSDOS pathnames, so it's necessary to specify
# (for example)
# -I"c:/Program\\\ Files/PalmSource/Palm\\\ OS\\\ Developer\\\ Suite/sdk-6/"
# as the SDK path.  In practice it's easier to dump all the files in their
# own partition, which is what the Palm SDK target below assumes.  Note that
# if you change this you'll also have to change the path value in
# tools/buildlib.sh.

PALMSDK_PATH	= "d:/Palm\\\ SDK/sdk-6"

#****************************************************************************
#*																			*
#*								Common Dependencies							*
#*																			*
#****************************************************************************

# The object files that make up cryptlib.

ASMOBJS		= $(OBJPATH)md5asm.o $(OBJPATH)rmdasm.o $(OBJPATH)sha1asm.o

BNOBJS		= $(OBJPATH)bn_add.o $(OBJPATH)bn_asm.o $(OBJPATH)bn_ctx.o \
			  $(OBJPATH)bn_div.o $(OBJPATH)bn_exp.o $(OBJPATH)bn_exp2.o \
			  $(OBJPATH)bn_gcd.o $(OBJPATH)bn_lib.o $(OBJPATH)bn_mod.o \
			  $(OBJPATH)bn_mont.o $(OBJPATH)bn_mul.o $(OBJPATH)bn_recp.o \
			  $(OBJPATH)bn_shift.o $(OBJPATH)bn_sqr.o $(OBJPATH)bn_word.o

CERTOBJS	= $(OBJPATH)certrev.o $(OBJPATH)certschk.o $(OBJPATH)certsign.o \
			  $(OBJPATH)certval.o $(OBJPATH)chain.o $(OBJPATH)chk_cert.o \
			  $(OBJPATH)chk_chn.o $(OBJPATH)chk_use.o $(OBJPATH)comp_get.o \
			  $(OBJPATH)comp_set.o $(OBJPATH)dn.o $(OBJPATH)dnstring.o \
			  $(OBJPATH)ext.o $(OBJPATH)ext_add.o $(OBJPATH)ext_chk.o \
			  $(OBJPATH)ext_copy.o $(OBJPATH)ext_def.o $(OBJPATH)ext_rd.o \
			  $(OBJPATH)ext_wr.o $(OBJPATH)imp_exp.o $(OBJPATH)read.o \
			  $(OBJPATH)trustmgr.o $(OBJPATH)write.o

CRYPTOBJS	= $(OBJPATH)aes_modes.o $(OBJPATH)aescrypt.o $(OBJPATH)aeskey.o \
			  $(OBJPATH)aestab.o $(OBJPATH)bfecb.o $(OBJPATH)bfenc.o \
			  $(OBJPATH)bfskey.o $(OBJPATH)castecb.o $(OBJPATH)castenc.o \
			  $(OBJPATH)castskey.o $(OBJPATH)descbc.o $(OBJPATH)desecb.o \
			  $(OBJPATH)desecb3.o $(OBJPATH)desenc.o $(OBJPATH)desskey.o \
			  $(OBJPATH)icbc.o $(OBJPATH)iecb.o $(OBJPATH)iskey.o \
			  $(OBJPATH)rc2cbc.o $(OBJPATH)rc2ecb.o $(OBJPATH)rc2skey.o \
			  $(OBJPATH)rc4enc.o $(OBJPATH)rc4skey.o $(OBJPATH)rc5ecb.o \
			  $(OBJPATH)rc5enc.o $(OBJPATH)rc5skey.o $(OBJPATH)skipjack.o

CTXOBJS		= $(OBJPATH)ctx_3des.o $(OBJPATH)ctx_aes.o $(OBJPATH)ctx_attr.o \
			  $(OBJPATH)ctx_bf.o $(OBJPATH)ctx_cast.o $(OBJPATH)ctx_des.o \
			  $(OBJPATH)ctx_dh.o $(OBJPATH)ctx_dsa.o $(OBJPATH)ctx_ecdsa.o \
			  $(OBJPATH)ctx_elg.o $(OBJPATH)ctx_hmd5.o $(OBJPATH)ctx_hrmd.o \
			  $(OBJPATH)ctx_hsha.o $(OBJPATH)ctx_hsha2.o $(OBJPATH)ctx_idea.o \
			  $(OBJPATH)ctx_md2.o $(OBJPATH)ctx_md4.o $(OBJPATH)ctx_md5.o \
			  $(OBJPATH)ctx_misc.o $(OBJPATH)ctx_rc2.o $(OBJPATH)ctx_rc4.o \
			  $(OBJPATH)ctx_rc5.o $(OBJPATH)ctx_ripe.o $(OBJPATH)ctx_rsa.o \
			  $(OBJPATH)ctx_sha.o $(OBJPATH)ctx_sha2.o $(OBJPATH)ctx_skip.o \
			  $(OBJPATH)kg_dlp.o $(OBJPATH)kg_ecc.o $(OBJPATH)kg_prime.o \
			  $(OBJPATH)kg_rsa.o $(OBJPATH)keyload.o $(OBJPATH)key_rd.o \
			  $(OBJPATH)key_wr.o

DEVOBJS		= $(OBJPATH)dev_attr.o $(OBJPATH)fortezza.o $(OBJPATH)pkcs11.o \
			  $(OBJPATH)pkcs11_init.o $(OBJPATH)pkcs11_pkc.o \
			  $(OBJPATH)pkcs11_rw.o $(OBJPATH)system.o

ENVOBJS		= $(OBJPATH)cms_denv.o $(OBJPATH)cms_env.o $(OBJPATH)cms_envpre.o \
			  $(OBJPATH)decode.o $(OBJPATH)encode.o $(OBJPATH)env_attr.o \
			  $(OBJPATH)pgp_denv.o $(OBJPATH)pgp_env.o $(OBJPATH)res_actn.o \
			  $(OBJPATH)res_denv.o $(OBJPATH)res_env.o

HASHOBJS	= $(OBJPATH)md2dgst.o $(OBJPATH)md4dgst.o $(OBJPATH)md5dgst.o \
			  $(OBJPATH)rmddgst.o $(OBJPATH)sha1dgst.o $(OBJPATH)sha2.o

IOOBJS		= $(OBJPATH)cmp_tcp.o $(OBJPATH)dns.o $(OBJPATH)dns_srv.o \
			  $(OBJPATH)file.o $(OBJPATH)http_rd.o $(OBJPATH)http_parse.o \
			  $(OBJPATH)http_wr.o $(OBJPATH)memory.o $(OBJPATH)net.o \
			  $(OBJPATH)net_proxy.o $(OBJPATH)net_trans.o $(OBJPATH)net_url.o \
			  $(OBJPATH)stream.o $(OBJPATH)tcp.o

KEYSETOBJS	= $(OBJPATH)dbms.o $(OBJPATH)ca_add.o $(OBJPATH)ca_clean.o \
			  $(OBJPATH)ca_issue.o $(OBJPATH)ca_misc.o $(OBJPATH)ca_rev.o \
			  $(OBJPATH)dbx_misc.o $(OBJPATH)dbx_rd.o $(OBJPATH)dbx_wr.o \
			  $(OBJPATH)http.o $(OBJPATH)key_attr.o $(OBJPATH)ldap.o \
			  $(OBJPATH)odbc.o $(OBJPATH)pgp.o $(OBJPATH)pgp_rd.o \
			  $(OBJPATH)pkcs12.o $(OBJPATH)pkcs15.o $(OBJPATH)pkcs15_add.o \
			  $(OBJPATH)pkcs15_adpb.o $(OBJPATH)pkcs15_adpr.o \
			  $(OBJPATH)pkcs15_atrd.o $(OBJPATH)pkcs15_atwr.o \
			  $(OBJPATH)pkcs15_get.o $(OBJPATH)pkcs15_rd.o \
			  $(OBJPATH)pkcs15_set.o $(OBJPATH)pkcs15_wr.o

KRNLOBJS	= $(OBJPATH)attr_acl.o $(OBJPATH)certm_acl.o $(OBJPATH)init.o \
			  $(OBJPATH)int_msg.o $(OBJPATH)key_acl.o $(OBJPATH)mech_acl.o \
			  $(OBJPATH)msg_acl.o $(OBJPATH)obj_acc.o $(OBJPATH)objects.o \
			  $(OBJPATH)sec_mem.o $(OBJPATH)semaphore.o $(OBJPATH)sendmsg.o

LIBOBJS		= $(OBJPATH)cryptapi.o $(OBJPATH)cryptcrt.o $(OBJPATH)cryptctx.o \
			  $(OBJPATH)cryptdev.o $(OBJPATH)cryptenv.o $(OBJPATH)cryptkey.o \
			  $(OBJPATH)cryptlib.o $(OBJPATH)cryptses.o $(OBJPATH)cryptusr.o

MECHOBJS	= $(OBJPATH)keyex.o $(OBJPATH)keyex_int.o $(OBJPATH)keyex_rw.o \
			  $(OBJPATH)mech_cwrap.o $(OBJPATH)mech_drv.o $(OBJPATH)mech_int.o \
			  $(OBJPATH)mech_pkwrap.o $(OBJPATH)mech_privk.o \
			  $(OBJPATH)mech_sig.o $(OBJPATH)obj_qry.o $(OBJPATH)sign.o \
			  $(OBJPATH)sign_cms.o $(OBJPATH)sign_int.o $(OBJPATH)sign_pgp.o \
			  $(OBJPATH)sign_rw.o $(OBJPATH)sign_x509.o

MISCOBJS	= $(OBJPATH)asn1_algid.o $(OBJPATH)asn1_chk.o $(OBJPATH)asn1_rd.o \
			  $(OBJPATH)asn1_wr.o $(OBJPATH)asn1_ext.o $(OBJPATH)base64.o \
			  $(OBJPATH)base64_id.o $(OBJPATH)int_api.o $(OBJPATH)int_attr.o \
			  $(OBJPATH)int_env.o $(OBJPATH)int_err.o $(OBJPATH)int_mem.o \
			  $(OBJPATH)int_string.o $(OBJPATH)int_time.o $(OBJPATH)java_jni.o \
			  $(OBJPATH)misc_rw.o $(OBJPATH)os_spec.o $(OBJPATH)pgp_misc.o \
			  $(OBJPATH)pgp_rw.o $(OBJPATH)random.o $(OBJPATH)rand_x917.o \
			  $(OBJPATH)unix.o $(OBJPATH)user.o $(OBJPATH)user_attr.o \
			  $(OBJPATH)user_cfg.o $(OBJPATH)user_rw.o

SESSOBJS	= $(OBJPATH)certstore.o $(OBJPATH)cmp.o $(OBJPATH)cmp_rd.o \
			  $(OBJPATH)cmp_wr.o $(OBJPATH)ocsp.o $(OBJPATH)pnppki.o \
			  $(OBJPATH)rtcs.o $(OBJPATH)scep.o $(OBJPATH)scep_cli.o \
			  $(OBJPATH)scep_svr.o $(OBJPATH)scorebrd.o \
			  $(OBJPATH)sess_attr.o $(OBJPATH)sess_iattr.o \
			  $(OBJPATH)sess_rw.o $(OBJPATH)session.o $(OBJPATH)ssh.o \
			  $(OBJPATH)ssh1.o $(OBJPATH)ssh2.o $(OBJPATH)ssh2_chn.o \
			  $(OBJPATH)ssh2_cli.o $(OBJPATH)ssh2_cry.o \
			  $(OBJPATH)ssh2_msg.o $(OBJPATH)ssh2_rw.o $(OBJPATH)ssh2_svr.o \
			  $(OBJPATH)ssl.o $(OBJPATH)ssl_cli.o $(OBJPATH)ssl_cry.o \
			  $(OBJPATH)ssl_kmgmt.o $(OBJPATH)ssl_rw.o $(OBJPATH)ssl_svr.o \
			  $(OBJPATH)tsp.o

ZLIBOBJS	= $(OBJPATH)adler32.o $(OBJPATH)deflate.o $(OBJPATH)inffast.o \
			  $(OBJPATH)inflate.o $(OBJPATH)inftrees.o $(OBJPATH)trees.o \
			  $(OBJPATH)zutil.o

OBJS		= $(BNOBJS) $(CERTOBJS) $(CRYPTOBJS) $(CTXOBJS) $(DEVOBJS) \
			  $(ENVOBJS) $(HASHOBJS) $(IOOBJS) $(KEYSETOBJS) $(KRNLOBJS) \
			  $(LIBOBJS) $(MECHOBJS) $(MISCOBJS) $(SESSOBJS) $(ZLIBOBJS) \
			  $(OSOBJS)

# Object files for the self-test code

TESTOBJS	= certimp.o certproc.o certs.o devices.o envelope.o highlvl.o \
			  keydbx.o keyfile.o loadkey.o lowlvl.o s_cmp.o s_scep.o \
			  sreqresp.o ssh.o ssl.o stress.o testlib.o utils.o

# Various functions all make use of certain headers so we define the
# dependencies once here

IO_DEP = io/stream.h misc/misc_rw.h misc/pgp_rw.h

ASN1_DEP = $(IO_DEP) misc/asn1.h misc/asn1_ext.h

CRYPT_DEP	= cryptlib.h crypt.h cryptkrn.h misc/config.h misc/consts.h \
			  misc/int_api.h misc/os_spec.h

KERNEL_DEP	= kernel/acl.h kernel/kernel.h kernel/thread.h

ZLIB_DEP = zlib/zconf.h zlib/zlib.h zlib/zutil.h

#****************************************************************************
#*																			*
#*							Default and High-level Targets					*
#*																			*
#****************************************************************************

# Find the system type and use a conditional make depending on that.
#
# Slowaris doesn't ship with a compiler by default, so Sun had to provide
# something that pretends to be one for things that look for a cc.  This
# makes it really hard to figure out what's really going on.  The default cc,
# /usr/ucb/cc, is a script that looks for a real compiler elsewhere.  If the
# Sun compiler is installed, this will be via a link /usr/ccs/bin/ucbcc,
# which in turn points to /opt/SUNWspro.  If it's not installed, or installed
# incorrectly, it will bail out with a "package not installed" error.  We
# check for this bogus compiler and if we get the error message fall back to
# gcc, which is how most people just fix this mess.
#
# The MVS USS c89 compiler has a strict ordering of options.  That ordering
# can be relaxed with the _C89_CCMODE environment variable to accept options
# and file names in any order, so we check to make sure that this is set.
#
# The Cray uname reports the machine serial number instead of the machine
# type by default, so we have to explicitly check for Cray systems and
# modify the machine-detection mechanism to handle this.
#
# The '-' to disable error-checking in several cases below is necessary for
# the braindamaged QNX make, which bails out as soon as one of the tests
# fails, whether this would affect the make or not.
#
# We have to special-case the situation where the OS name is an alias for
# uname rather than being predefined (this occurs when cross-compiling),
# because the resulting expansion would contain two levels of `` escapes.  To
# handle this, we leave a predefined OS name in place, but replace a call to
# uname with instructions to the osversion.sh script to figure it out for
# itself.  In addition since $(CROSSCOMPILE) is usually a null value, we add
# an extra character to the comparison string to avoid syntax errors.

default:

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -