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

📄 makefile

📁 提供了很多种加密算法和CA认证及相关服务如CMP、OCSP等的开发
💻
📖 第 1 页 / 共 4 页
字号:
#****************************************************************************
#*																			*
#*							Makefile for cryptlib 3.0						*
#*						Copyright Peter Gutmann 1995-2002					*
#*																			*
#****************************************************************************

# This file is shared between the Unix and BeOS versions.  To use it to build
# the BeOS version, uncomment the defines marked with the "BeOS:" comment
# below.
#
# "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 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.  The patch level is always zero because patches imply bugs and my
# code is perfect.

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

# Extra compiler options for debugging.  Add this to the CFLAGS to provide an
# extra level of warnings about potential problems when using gcc.  Note that
# some of these require at least -O2 to be detected because they require the
# use of various levels of data flow analysis by the compiler.

DEBUG_FLAGS	= -Wall -Wpointer-arith -Wstrict-prototypes -Wshadow -Wcast-align -Wconversion -Wredundant-decls -Winline

# Compiler options.  The IRIX cc doesn't recognise -fpic, but generates PIC
# by default anyway, so to make this work under IRIX just remove the -fpic.
# The PHUX compiler requires +z for PIC.
#
# 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.
#
# If the OS supports it, the multithreaded version of cryptlib will be built.
# To specifically disable this, add -DNO_THREADS.

CFLAGS	= -c -D__UNIX__ -DNDEBUG -I.
SCFLAGS = -fpic -c -D__UNIX__ -I.

# BeOS: Use the following defines instead of the current ones

# CFLAGS	= -c -O2 -D__BEOS__ -I.
# SCFLAGS	= -c -O2 -D__BEOS__ -I.
# LIBS	= -ldll -lbe				# Extra libs needed for the shared lib.

# 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	= -lmysql

# 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) which break if the path ends in a
# '/', it's easier to have separate defines than to drop a '/' into every
# path.
#
# The options for the shared library link should work on most systems which
# handle shared libraries, but may need to be tuned for some systems since
# there's no standard for shared libraries, and different versions of gcc
# also changed the way this was handled.  If the current line doesn't work,
# try one of the following ones:
#
# AIX:			Don't even try, it requires some weird voodoo which is
#				unlike any other system's way of doing it (man ld for a
#				starter).
# *BSD's:		$(LD) -Bshareable -o lib$(PROJ).so.$(MAJ)
# HPUX:			$(LD) -shared -Wl,-soname,lib$(PROJ).so.$(MAJ)
# IRIX, OSF/1:	$(LD) -shared -o lib$(PROJ).so.$(MAJ)
# Linux:		$(LD) -Bshareable -ldl -o lib$(PROJ).so.$(MAJ)
# Solaris:		$(LD) -G -ldl -o lib$(PROJ).so.$(MAJ)

STATIC_OBJ_PATH = ./static-obj/
STATIC_OBJ_DIR = ./static-obj
SHARED_OBJ_PATH = ./shared-obj/
SHARED_OBJ_DIR = ./shared-obj
LIBPATH	= ./
CPP		= $(CC) -E
LD		= $(CC)						# Static link
SLD		= $(LD) -shared				# Shared link
SHELL	= /bin/sh

# 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	= $(LIBPATH)$(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
# which we want to pass to recursive calls to make.

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

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

# The object files which make up the library

BNOBJS		= $(OBJPATH)bn_add.o $(OBJPATH)bn_blind.o $(OBJPATH)bn_div.o \
			  $(OBJPATH)bn_exp.o $(OBJPATH)bn_gcd.o $(OBJPATH)bn_lib.o \
			  $(OBJPATH)bn_mod.o $(OBJPATH)bn_mont.o $(OBJPATH)bn_mul.o \
			  $(OBJPATH)bn_mulw.o $(OBJPATH)bn_recp.o $(OBJPATH)bn_shift.o \
			  $(OBJPATH)bn_sqr.o $(OBJPATH)bn_sub.o $(OBJPATH)bn_word.o

CRYPTOBJS	= $(OBJPATH)aescrypt.o $(OBJPATH)aeskey.o $(OBJPATH)aestab.o \
			  $(OBJPATH)bf_ecb.o $(OBJPATH)bf_enc.o $(OBJPATH)bf_skey.o \
			  $(OBJPATH)c_ecb.o $(OBJPATH)c_enc.o $(OBJPATH)c_skey.o \
			  $(OBJPATH)des_enc.o $(OBJPATH)ecb3_enc.o $(OBJPATH)ecb_enc.o \
			  $(OBJPATH)idea.o $(OBJPATH)rc2.o $(OBJPATH)rc4_enc.o \
			  $(OBJPATH)rc4_skey.o $(OBJPATH)rc5.o $(OBJPATH)set_key.o \
			  $(OBJPATH)skipjack.o

ENVOBJS		= $(OBJPATH)deenvel.o $(OBJPATH)envelope.o $(OBJPATH)octetstr.o \
			  $(OBJPATH)pgp_deen.o $(OBJPATH)pgp_env.o $(OBJPATH)pgp_misc.o \
			  $(OBJPATH)resource.o

HASHOBJS	= $(OBJPATH)md2.o $(OBJPATH)md4.o $(OBJPATH)md5_dgst.o \
			  $(OBJPATH)ripemd.o $(OBJPATH)ripecore.o $(OBJPATH)sha1dgst.o

KEYOBJS		= $(OBJPATH)asn1.o $(OBJPATH)asn1keys.o $(OBJPATH)asn1objs.o \
			  $(OBJPATH)asn1oid.o $(OBJPATH)certchk.o $(OBJPATH)certchn.o \
			  $(OBJPATH)certcomp.o $(OBJPATH)certechk.o $(OBJPATH)certedef.o \
			  $(OBJPATH)certexrw.o $(OBJPATH)certext.o $(OBJPATH)certio.o \
			  $(OBJPATH)certraw.o $(OBJPATH)certrd.o $(OBJPATH)certsig.o \
			  $(OBJPATH)certstr.o $(OBJPATH)certrust.o $(OBJPATH)certwr.o \
			  $(OBJPATH)stream.o

LIBOBJS		= $(OBJPATH)crypt.o $(OBJPATH)cryptapi.o $(OBJPATH)cryptcfg.o \
			  $(OBJPATH)cryptcrt.o $(OBJPATH)cryptdbx.o \
			  $(OBJPATH)cryptdev.o $(OBJPATH)cryptenv.o \
			  $(OBJPATH)cryptkey.o $(OBJPATH)cryptkrn.o \
			  $(OBJPATH)cryptlib.o $(OBJPATH)cryptmch.o \
			  $(OBJPATH)cryptmis.o $(OBJPATH)cryptses.o $(OBJPATH)cryptusr.o \
			  $(OBJPATH)lib_3des.o $(OBJPATH)lib_aes.o $(OBJPATH)lib_bf.o \
			  $(OBJPATH)lib_cast.o $(OBJPATH)lib_dbms.o $(OBJPATH)lib_des.o \
			  $(OBJPATH)lib_dh.o $(OBJPATH)lib_dsa.o $(OBJPATH)lib_elg.o \
			  $(OBJPATH)lib_hmd5.o $(OBJPATH)lib_hrmd.o $(OBJPATH)lib_hsha.o \
			  $(OBJPATH)lib_idea.o $(OBJPATH)lib_kg.o $(OBJPATH)lib_keyx.o \
			  $(OBJPATH)lib_md2.o $(OBJPATH)lib_md4.o $(OBJPATH)lib_md5.o \
			  $(OBJPATH)lib_rc2.o $(OBJPATH)lib_rc4.o $(OBJPATH)lib_rc5.o \
			  $(OBJPATH)lib_ripe.o $(OBJPATH)lib_rsa.o $(OBJPATH)lib_sha.o \
			  $(OBJPATH)lib_sign.o $(OBJPATH)lib_skip.o

MISCOBJS	= $(OBJPATH)dbxhttp.o $(OBJPATH)dbxldap.o $(OBJPATH)dbxmysql.o \
			  $(OBJPATH)dbxoracl.o $(OBJPATH)dbxpgp.o $(OBJPATH)dbxpk12.o \
			  $(OBJPATH)dbxpk15.o $(OBJPATH)dbxpostg.o $(OBJPATH)dev_fort.o \
			  $(OBJPATH)dev_pk11.o $(OBJPATH)dev_sys.o $(OBJPATH)net_tcp.o \
			  $(OBJPATH)rndunix.o

SESSOBJS	= $(OBJPATH)cmp.o $(OBJPATH)ocsp.o $(OBJPATH)ssh.o \
			  $(OBJPATH)ssl.o $(OBJPATH)tsp.o

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

OBJS		= $(ASMOBJS) $(BNOBJS) $(CRYPTOBJS) $(ENVOBJS) $(HASHOBJS) \
			  $(KEYOBJS) $(LIBOBJS) $(MISCOBJS) $(SESSOBJS) $(ZLIBOBJS)

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

ASN1_DEP = keymgmt/asn1.h keymgmt/asn1objs.h keymgmt/asn1oid.h \
		   keymgmt/ber.h keymgmt/stream.h

CRYPT_DEP	= cryptlib.h crypt.h cryptos.h

ECC_DEP = crypt/ec_crypt.h crypt/ec_curve.h crypt/ec_field.h \
		  crypt/ec_param.h crypt/ec_vlong.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 and the
# endianness, which is piped in from the endianness-detection program (who
# needs autoconf in order to be ugly).
#
# A few SVR4 unames don't report the OS name properly (eg SCO, Olivetti Unix)
# so it's necessary to specify the SVR4 target on the command line.
#
# The unnecessary deletion of the '.' by the tr command is to work around a
# problem in the SunOS uname -r which returns a number with no OS name so
# that tr can't find any alphabetics to delete.

default:
		@if [ ! -d $(STATIC_OBJ_PATH) ] ; then mkdir $(STATIC_OBJ_DIR) ; fi
		@make endian > /dev/null
		@make CFLAGS="$(CFLAGS) `./endian` \
		-DOSVERSION=`uname -r | tr -d '[A-Z].' | cut -c 1`" \
		LIBS="$(LIBS)" `uname`

# Build the shared library

shared:
		@if [ ! -d $(SHARED_OBJ_PATH) ] ; then mkdir $(SHARED_OBJ_DIR) ; fi
		@make endian > /dev/null
		@make TARGET=$(LIBPATH)$(SLIBNAME) OBJPATH=$(SHARED_OBJ_PATH) \
		CFLAGS="$(SCFLAGS) `./endian` \
		-DOSVERSION=`uname -r | tr -d '[A-Z].' | cut -c 1`" \
		LIBS="$(LIBS)" `uname`

# Build the endianness-test program.  The output of this is a preprocessor
# define which is piped back into make to control the cryptlib endianness.

endian:					endian.c
						@$(CC) endian.c -o endian

# Frohe Ostern.

babies:
		@echo "Good grief, what do you think I am?  The Unix environment is capable, but"
		@echo "not that capable."

cookies:
		@echo "Mix 250g flour, 150g sugar, 125g butter, an egg, a few drops of vanilla"
		@echo "essence, and 1 tsp baking powder into a dough, cut cookies from rolls of"
		@echo "dough, bake for about 15 minutes at 180C until they turn very light brown"
		@echo "at the edges."

love:
		@echo "Nicht wahr?"
		@echo

#****************************************************************************
#*																			*
#*							Rules to build the cryptlib						*
#*																			*
#****************************************************************************

# Main directory

$(OBJPATH)crypt.o:		$(CRYPT_DEP) cryptctx.h crypt.c
						$(CC) $(CFLAGS) crypt.c -o $(OBJPATH)crypt.o

$(OBJPATH)cryptapi.o:	$(CRYPT_DEP) hash/md2.h hash/md4.h hash/md5.h \
						hash/sha.h cryptapi.c
						$(CC) $(CFLAGS) cryptapi.c -o $(OBJPATH)cryptapi.o

$(OBJPATH)cryptcfg.o:	$(CRYPT_DEP) cryptcfg.c
						$(CC) $(CFLAGS) cryptcfg.c -o $(OBJPATH)cryptcfg.o

$(OBJPATH)cryptcrt.o:	$(CRYPT_DEP) keymgmt/cert.h cryptcrt.c
						$(CC) $(CFLAGS) cryptcrt.c -o $(OBJPATH)cryptcrt.o

$(OBJPATH)cryptdbx.o:	$(CRYPT_DEP) misc/keyset.h keymgmt/asn1objs.h \
						cryptdbx.c
						$(CC) $(CFLAGS) cryptdbx.c -o $(OBJPATH)cryptdbx.o

$(OBJPATH)cryptdev.o:	$(CRYPT_DEP) misc/device.h cryptdev.c
						$(CC) $(CFLAGS) cryptdev.c -o $(OBJPATH)cryptdev.o

$(OBJPATH)cryptenv.o:	$(CRYPT_DEP) envelope/envelope.h $(ASN1_DEP) \
						cryptenv.c
						$(CC) $(CFLAGS) cryptenv.c -o $(OBJPATH)cryptenv.o

$(OBJPATH)cryptkey.o:	$(CRYPT_DEP) cryptctx.h cryptkey.c
						$(CC) $(CFLAGS) cryptkey.c -o $(OBJPATH)cryptkey.o

$(OBJPATH)cryptkrn.o:	$(CRYPT_DEP) cryptkrn.c
						$(CC) $(CFLAGS) cryptkrn.c -o $(OBJPATH)cryptkrn.o

$(OBJPATH)cryptlib.o:	$(CRYPT_DEP) cryptlib.c
						$(CC) $(CFLAGS) cryptlib.c -o $(OBJPATH)cryptlib.o

$(OBJPATH)cryptmch.o:	$(CRYPT_DEP) cryptmch.c
						$(CC) $(CFLAGS) cryptmch.c -o $(OBJPATH)cryptmch.o

$(OBJPATH)cryptmis.o:	$(CRYPT_DEP) cryptmis.c
						$(CC) $(CFLAGS) cryptmis.c -o $(OBJPATH)cryptmis.o

$(OBJPATH)cryptses.o:	$(CRYPT_DEP) cryptses.c
						$(CC) $(CFLAGS) cryptses.c -o $(OBJPATH)cryptses.o

$(OBJPATH)cryptusr.o:	$(CRYPT_DEP) cryptusr.c
						$(CC) $(CFLAGS) cryptusr.c -o $(OBJPATH)cryptusr.o

$(OBJPATH)lib_3des.o:	$(CRYPT_DEP) cryptctx.h crypt/des.h lib_3des.c
						$(CC) $(CFLAGS) lib_3des.c -o $(OBJPATH)lib_3des.o

$(OBJPATH)lib_aes.o:	$(CRYPT_DEP) cryptctx.h crypt/aes.h crypt/aesopt.h \
						lib_aes.c
						$(CC) $(CFLAGS) lib_aes.c -o $(OBJPATH)lib_aes.o

$(OBJPATH)lib_bf.o:		$(CRYPT_DEP) cryptctx.h crypt/blowfish.h lib_bf.c
						$(CC) $(CFLAGS) lib_bf.c -o $(OBJPATH)lib_bf.o

$(OBJPATH)lib_cast.o:	$(CRYPT_DEP) cryptctx.h crypt/cast.h lib_cast.c
						$(CC) $(CFLAGS) lib_cast.c -o $(OBJPATH)lib_cast.o

$(OBJPATH)lib_dbms.o:	$(CRYPT_DEP) misc/keyset.h lib_dbms.c
						$(CC) $(CFLAGS) lib_dbms.c -o $(OBJPATH)lib_dbms.o

$(OBJPATH)lib_des.o:	$(CRYPT_DEP) cryptctx.h crypt/testdes.h crypt/des.h \
						lib_des.c
						$(CC) $(CFLAGS) lib_des.c -o $(OBJPATH)lib_des.o

$(OBJPATH)lib_dh.o:		$(CRYPT_DEP) cryptctx.h bn/bn.h lib_dh.c
						$(CC) $(CFLAGS) lib_dh.c -o $(OBJPATH)lib_dh.o

$(OBJPATH)lib_dsa.o:	$(CRYPT_DEP) cryptctx.h bn/bn.h lib_dsa.c
						$(CC) $(CFLAGS) lib_dsa.c -o $(OBJPATH)lib_dsa.o

$(OBJPATH)lib_elg.o:	$(CRYPT_DEP) cryptctx.h bn/bn.h lib_elg.c
						$(CC) $(CFLAGS) lib_elg.c -o $(OBJPATH)lib_elg.o

$(OBJPATH)lib_hmd5.o:	$(CRYPT_DEP) cryptctx.h hash/md5.h lib_hmd5.c
						$(CC) $(CFLAGS) lib_hmd5.c -o $(OBJPATH)lib_hmd5.o

$(OBJPATH)lib_hrmd.o:	$(CRYPT_DEP) cryptctx.h hash/ripemd.h lib_hrmd.c
						$(CC) $(CFLAGS) lib_hrmd.c -o $(OBJPATH)lib_hrmd.o

⌨️ 快捷键说明

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