📄 makefile
字号:
$(OBJPATH)ssl_cli.o: $(CRYPT_DEP) misc/stream.h session/session.h \
session/ssl.h session/ssl_cli.c
$(CC) $(CFLAGS) session/ssl_cli.c -o $(OBJPATH)ssl_cli.o
$(OBJPATH)ssl_svr.o: $(CRYPT_DEP) misc/stream.h session/session.h \
session/ssl.h session/ssl_svr.c
$(CC) $(CFLAGS) session/ssl_svr.c -o $(OBJPATH)ssl_svr.o
$(OBJPATH)tsp.o: $(CRYPT_DEP) $(ASN1_DEP) session/session.h session/tsp.c
$(CC) $(CFLAGS) session/tsp.c -o $(OBJPATH)tsp.o
# zlib subdirectory
$(OBJPATH)adler32.o: $(ZLIB_DEP) zlib/adler32.c
$(CC) $(CFLAGS) zlib/adler32.c -o $(OBJPATH)adler32.o
$(OBJPATH)deflate.o: $(ZLIB_DEP) zlib/deflate.c
$(CC) $(CFLAGS) zlib/deflate.c -o $(OBJPATH)deflate.o
$(OBJPATH)infblock.o: $(ZLIB_DEP) zlib/infblock.h zlib/inftrees.h \
zlib/infcodes.h zlib/infutil.h zlib/infblock.c
$(CC) $(CFLAGS) zlib/infblock.c -o $(OBJPATH)infblock.o
$(OBJPATH)infcodes.o: $(ZLIB_DEP) zlib/infblock.h zlib/inffast.h \
zlib/inftrees.h zlib/infcodes.h zlib/infutil.h \
zlib/infcodes.c
$(CC) $(CFLAGS) zlib/infcodes.c -o $(OBJPATH)infcodes.o
$(OBJPATH)inffast.o: $(ZLIB_DEP) zlib/infblock.h zlib/inffast.h \
zlib/inftrees.h zlib/infcodes.h zlib/infutil.h \
zlib/inffast.c
$(CC) $(CFLAGS) zlib/inffast.c -o $(OBJPATH)inffast.o
$(OBJPATH)inflate.o: $(ZLIB_DEP) zlib/infblock.h zlib/inflate.c
$(CC) $(CFLAGS) zlib/inflate.c -o $(OBJPATH)inflate.o
$(OBJPATH)inftrees.o: $(ZLIB_DEP) zlib/inftrees.h zlib/inftrees.c
$(CC) $(CFLAGS) zlib/inftrees.c -o $(OBJPATH)inftrees.o
$(OBJPATH)infutil.o: $(ZLIB_DEP) zlib/infblock.h zlib/inffast.h \
zlib/inftrees.h zlib/infcodes.h zlib/infutil.c
$(CC) $(CFLAGS) zlib/infutil.c -o $(OBJPATH)infutil.o
$(OBJPATH)trees.o: $(ZLIB_DEP) zlib/trees.c
$(CC) $(CFLAGS) zlib/trees.c -o $(OBJPATH)trees.o
$(OBJPATH)zutil.o: $(ZLIB_DEP) zlib/zutil.c
$(CC) $(CFLAGS) zlib/zutil.c -o $(OBJPATH)zutil.o
# Build the asm equivalents of various C modules. These are built before any
# other files and override the .o's that are produced by compiling the C
# equivalents of the asm files, so that (provided the build succeeds) the .o
# files that would be created from the C code will never be created because
# the asm-derived .o's already exist.
#
# Since these targets aren't files, we can't use make to build them as
# required (actually some makes will allow two sets of dependencies for a
# target, but this doesn't give us any control over whether we want the .o
# built from the .s or the .c). A workaround for this is to use a quick
# shell hack to only build the files if they don't already exist - this is
# OK since they'll only be built once.
#
# The exception to this is the hash asm files, which use an incredible amount
# of preprocessor kludging that requires that both the .c and .s files are
# built. To handle this we use EXTRAOBJS to include the extra asm-derived
# objs into the build.
asm_bn: bn/bn-$(INFILE).s
@if [ ! -f $(OBJPATH)bn_asm.o ] ; then \
$(AS) bn/bn-$(INFILE).s -o $(OBJPATH)bn_asm.o; \
fi
asm_bf: crypt/b-$(INFILE).s
@if [ ! -f $(OBJPATH)bfenc.o ] ; then \
$(AS) crypt/b-$(INFILE).s -o $(OBJPATH)bfenc.o; \
fi
asm_cast: crypt/c-$(INFILE).s
@if [ ! -f $(OBJPATH)castenc.o ] ; then \
$(AS) crypt/c-$(INFILE).s -o $(OBJPATH)castenc.o; \
fi
asm_des: crypt/d-$(INFILE).s
@if [ ! -f $(OBJPATH)desenc.o ] ; then \
$(AS) crypt/d-$(INFILE).s -o $(OBJPATH)desenc.o; \
fi
asm_rc4: crypt/r4-$(INFILE).s
@if [ ! -f $(OBJPATH)rc4enc.o ] ; then \
$(AS) crypt/r4-$(INFILE).s -o $(OBJPATH)rc4enc.o;\
fi
asm_rc5: crypt/r5-$(INFILE).s
@if [ ! -f $(OBJPATH)rc5enc.o ] ; then \
$(AS) crypt/r5-$(INFILE).s -o $(OBJPATH)rc5enc.o; \
fi
asm_md5: crypt/m5-$(INFILE).s
@if [ ! -f $(OBJPATH)md5asm.o ] ; then \
$(AS) crypt/m5-$(INFILE).s -o $(OBJPATH)md5asm.o; \
fi
asm_ripemd: crypt/rm-$(INFILE).s
@if [ ! -f $(OBJPATH)rmdasm.o ] ; then \
$(AS) crypt/rm-$(INFILE).s -o $(OBJPATH)rmdasm.o; \
fi
asm_sha1: crypt/s1-$(INFILE).s
@if [ ! -f $(OBJPATH)sha1asm.o ] ; then \
$(AS) crypt/s1-$(INFILE).s -o $(OBJPATH)sha1asm.o; \
fi
asm_targets:
@make asm_bn INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_bf INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_cast INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_des INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_rc4 INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_rc5 INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_md5 INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_ripemd INFILE=$(INFILE) OBJPATH=$(OBJPATH)
@make asm_sha1 INFILE=$(INFILE) OBJPATH=$(OBJPATH)
asm_elf:
@make asm_targets INFILE=elf OBJPATH=$(OBJPATH)
asm_out:
@make asm_targets INFILE=out OBJPATH=$(OBJPATH)
asm_sol:
@make asm_targets INFILE=sol OBJPATH=$(OBJPATH)
# The pseudo-dependencies to build the asm modules for other processors.
# Only the bignum code is done in asm for these. See the SunOS dependency
# for the explanation of the leading '-' in the asm_sparc rule. For gas on
# OSF/1, it may be necessary to use -m<cpu_type> (where <cpu_type> is
# anything, e.g.21064, 21164, etc) if gas dies with an illegal operand error
# (this is a bug in some versions of gas). For Sparc there are two lots of
# asm code, sparcv8 for SuperSparc (Sparc v8) and sparcv8plus for UltraSparc
# (Sparc v9 with hacks for when the kernel doesn't preserve the upper 32
# bits of some 64-bit registers).
asm_alpha: bn/alpha.s
$(AS) bn/alpha.s -o $(OBJPATH)bn_asm.o
asm_mips: bn/mips3.s
$(AS) bn/mips3.s -o $(OBJPATH)bn_asm.o
asm_mvs: misc/mvsent.s
$(CC) -c misc/mvsent.s -o $(OBJPATH)mvsent.o
asm_phux: bn/pa-risc2.s
$(AS) bn/pa-risc2.s -o $(OBJPATH)bn_asm.o
asm_sparc: bn/sparcv8plus.S
- if [ `which $(CC) | grep -c "no gcc"` = '1' ] ; then \
$(AS) -V -Qy -s -xarch=v8plusa bn/sparcv8plus.S -o $(OBJPATH)bn_asm.o ; \
else \
if [ `uname -a | grep -c sun4m` = '1' ] ; then \
gcc -mcpu=supersparc -c bn/sparcv8.S -o $(OBJPATH)bn_asm.o ; \
else
gcc -mcpu=ultrasparc -c bn/sparcv8plus.S -o $(OBJPATH)bn_asm.o ; \
fi ; \
fi
# The test code
certinst.o: cryptlib.h crypt.h test/test.h test/certinst.c
$(CC) $(CFLAGS) test/certinst.c
certutil.o: cryptlib.h crypt.h test/test.h test/certutil.c
$(CC) $(CFLAGS) test/certutil.c
testcert.o: cryptlib.h crypt.h test/test.h test/testcert.c
$(CC) $(CFLAGS) test/testcert.c
testdev.o: cryptlib.h crypt.h test/test.h test/testdev.c
$(CC) $(CFLAGS) test/testdev.c
testenv.o: cryptlib.h crypt.h test/test.h test/testenv.c
$(CC) $(CFLAGS) test/testenv.c
testhl.o: cryptlib.h crypt.h test/test.h test/testhl.c
$(CC) $(CFLAGS) test/testhl.c
testkeyd.o: cryptlib.h crypt.h test/test.h test/testkeyd.c
$(CC) $(CFLAGS) test/testkeyd.c
testkeyf.o: cryptlib.h crypt.h test/test.h test/testkeyf.c
$(CC) $(CFLAGS) test/testkeyf.c
testll.o: cryptlib.h crypt.h test/test.h test/testll.c
$(CC) $(CFLAGS) test/testll.c
testscrt.o: cryptlib.h crypt.h test/test.h test/testscrt.c
$(CC) $(CFLAGS) test/testscrt.c
testsess.o: cryptlib.h crypt.h test/test.h test/testsess.c
$(CC) $(CFLAGS) test/testsess.c
testsreq.o: cryptlib.h crypt.h test/test.h test/testsreq.c
$(CC) $(CFLAGS) test/testsreq.c
testlib.o: cryptlib.h crypt.h test/test.h test/testlib.c
$(CC) $(CFLAGS) test/testlib.c
# Create the library, either as a static or shared library. The main test
# program is also listed as a dependency since we need to use OS-specific
# compiler options for it that a simple 'make testlib' won't give us (the
# test program checks whether the compiler options were set correctly when
# building the library, so it needs to include a few library-specific files
# that wouldn't be used in an normal program).
#
# The use of ar and ranlib is rather system-dependant. Some ar's (e.g.OSF1)
# create the .SYMDEF file by default, some require the 's' option, and some
# require the use of ranlib altogether because ar doesn't recognise the 's'
# option. If we know what's required we use the appropriate form, otherwise
# we first try 'ar rcs' (which works on most systems) and if that fails fall
# back to 'ar rc' followed by ranlib.
#
# Because the macros expand to rather large lists of files, we use an extra
# level of indirection for the ar commands (at least one system, MP-RAS, will
# dump core trying to process the command if it's expanded inline).
#
# Building the shared library is even more system-dependant, we check for
# various OS's that we know about and adjust the link as appropriate.
ar_rcs:
@ar rcs $(LIBNAME) $(OBJS) $(EXTRAOBJS)
ranlib:
@ar rc $(LIBNAME) $(OBJS) $(EXTRAOBJS)
@ranlib $(LIBNAME) ; \
ar_guess:
@ar rcs $(LIBNAME) $(OBJS) $(EXTRAOBJS) || \
( ar rc $(LIBNAME) $(OBJS) $(EXTRAOBJS) && \
ranlib $(LIBNAME) )
$(LIBNAME): $(OBJS) $(EXTRAOBJS) $(TESTOBJS)
@case $(OSNAME) in \
'AIX'|'HP-UX'|'Linux'|'OSF1'|'SunOS'|'UNIX_SV') \
make ar_rcs ;; \
'Atmel') \
echo "Need to set up Atmel link command" ;; \
'BSD/OS'|'FreeBSD'|'iBSD'|'OpenBSD') \
make ranlib ;; \
*) \
make ar_guess ;; \
esac
$(SLIBNAME): $(OBJS) $(EXTRAOBJS) $(TESTOBJS)
@case $(OSNAME) in \
'AIX') \
cc -o shrlibcl.o -bE:cryptlib.exp \
-bM:SRE -bnoentry -lpthread $(OBJS) ; \
ar -q $(SLIBNAME).a shrlibcl.o; \
rm -f shrlibcl.o; \
chmod 750 $(SLIBNAME).a ;; \
'BeOS' ) \
$(LD) -nostart -o $(SLIBNAME) $(OBJS) $(EXTRAOBJS) ; \
strip $(SLIBNAME) ;; \
'HP-UX') \
ld -b -o lib$(PROJ).sl $(OBJS) $(EXTRAOBJS) ; \
strip lib$(PROJ).sl ;; \
*) \
$(SLD) -o $(SLIBNAME) $(OBJS) $(EXTRAOBJS) ; \
strip $(SLIBNAME) ;; \
esac
$(DYLIBNAME): $(OBJS) $(EXTRAOBJS) $(TESTOBJS)
@$(LD) -dynamiclib -compatibility_version $(MAJ).$(MIN) \
-current_version $(MAJ).$(MIN).$(PLV) \
-o $(DYLIBNAME) $(OBJS) $(EXTRAOBJS)
# Link everything into the test programs. Some OS's require the linking of
# various special libraries, unfortunately we can't do this via the OS-
# specific makefile rules since they're not invoked to build the test
# programs so we have to specify everything explicitly here. Note that we
# don't include $(LIBNAME) as a dependency because building it this way
# bypasses the use of system-specific options. The user has to explicitly
# build this separately.
#
# The OS's and the required libraries are:
#
# AIX: -lc_r -lpthreads
# BeOS: None
# BSDI: -lgcc
# Cygwin: None
# FreeBSD: -lc_r
# Irix: -lw
# Linux/OSF1/DEC Unix: -lpthread -lresolv
# NCR MP-RAS (threads): -Xdce -lnsl -lsocket -lc89 -lpthread -lresolv
# NCR MP-RAS (no.threads): -lnsl -lsocket -lc89
# PHUX 11.x: -lpthread
# PHUX 10.x, 9.x: None
# Solaris 7+ (SunOS 5.7+): -lw -lkstat -lthread -ldl -lnsl -lrt
# SunOS 5.5 and 5.6: -lw -lkstat -lthread -ldl -lnsl -lposix4
# SunOS 4.x: -ldl -lnsl -lposix4
# UnixWare (SCO): -lsocket -Kthread
#
# Comments:
#
# -lc_r = libc extended with re-entrant functions needed for threading.
# This is required by FreeBSD 5.1-RELEASE but not FreeBSD 5.1-
# CURRENT, which has the standard libc re-entrant. Because there's
# no easy way to tell what we're running under (they both have the
# same version numbers) we use it for both.
# -ldl = dload support for dynamically loaded PKCS #11 drivers.
# -lgcc = Extra gcc support lib needed for BSDI, which ships with gcc but
# not the proper libs for it.
# -lkstat = kstat functions for Solaris randomness gathering.
# -lsocket = Resolver functions.
# -lnsl = Socket support for Slowaris, which doesn't have it in libc.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -