📄 makefile
字号:
else \
gcc -mcpu=ultrasparc -c bn/sparcv8plus.S -o $(OBJPATH)bn_asm.o ; \
fi ; \
fi
#****************************************************************************
#* *
#* Test Code Targets *
#* *
#****************************************************************************
# The test code
utils.o: cryptlib.h crypt.h test/test.h test/utils.c
$(CC) $(CFLAGS) test/utils.c
certs.o: cryptlib.h crypt.h test/test.h test/certs.c
$(CC) $(CFLAGS) test/certs.c
devices.o: cryptlib.h crypt.h test/test.h test/devices.c
$(CC) $(CFLAGS) test/devices.c
envelope.o: cryptlib.h crypt.h test/test.h test/envelope.c
$(CC) $(CFLAGS) test/envelope.c
highlvl.o: cryptlib.h crypt.h test/test.h test/highlvl.c
$(CC) $(CFLAGS) test/highlvl.c
keydbx.o: cryptlib.h crypt.h test/test.h test/keydbx.c
$(CC) $(CFLAGS) test/keydbx.c
keyfile.o: cryptlib.h crypt.h test/test.h test/keyfile.c
$(CC) $(CFLAGS) test/keyfile.c
keyload.o: cryptlib.h crypt.h test/test.h test/keyload.c
$(CC) $(CFLAGS) test/keyload.c
lowlvl.o: cryptlib.h crypt.h test/test.h test/lowlvl.c
$(CC) $(CFLAGS) test/lowlvl.c
scert.o: cryptlib.h crypt.h test/test.h test/scert.c
$(CC) $(CFLAGS) test/scert.c
sreqresp.o: cryptlib.h crypt.h test/test.h test/sreqresp.c
$(CC) $(CFLAGS) test/sreqresp.c
ssh.o: cryptlib.h crypt.h test/test.h test/ssh.c
$(CC) $(CFLAGS) test/ssh.c
ssl.o: cryptlib.h crypt.h test/test.h test/ssl.c
$(CC) $(CFLAGS) test/ssl.c
stress.o: cryptlib.h crypt.h test/test.h test/stress.c
$(CC) $(CFLAGS) test/stress.c
testlib.o: cryptlib.h crypt.h test/test.h test/testlib.c
$(CC) $(CFLAGS) test/testlib.c
#****************************************************************************
#* *
#* Link Targets *
#* *
#****************************************************************************
# Some OS's require the linking of additional special libraries, either
# into the executable for the static-lib version or into the library itself
# for the shared-lib version. The OS's and their libraries are:
#
# AIX: -lc_r -lpthreads
# BeOS: None
# BeOS with BONE: -lbind -lsocket
# BSDI: -lgcc
# Cray Unicos: -lpthread
# Cygwin: None
# FreeBSD 4.x: -lc_r + -pthread passed to gcc
# FreeBSD 5.x: -lc_r
# Irix: -lw
# Linux/OSF1/DEC Unix: -lpthread -lresolv
# NetBSD: -lpthread
# MVS: None
# NCR MP-RAS (threads): -Xdce -lnsl -lsocket -lc89 -lpthread -lresolv
# NCR MP-RAS (no.threads): -lnsl -lsocket -lc89
# PHUX 9.x, 10.x: None
# PHUX 11.x: -lpthread
# SunOS 4.x: -ldl -lnsl -lposix4
# SunOS 5.5 and 5.6: -lw -lsocket -lkstat -lnsl -lposix4 -lthread
# Solaris 7+ (SunOS 5.7+): -lw -lresolv -lsocket -lkstat -lrt -lnsl -lthread
# Tandem OSS/NSK: None
# UnixWare (SCO): -lsocket
#
# 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.
# -lposix4 = Solaris 2.5 and 2.6 library for sched_yield.
# -lresolv = Resolver functions.
# -lrt = Solaris 2.7 and above realtime library for sched_yield().
# -lthread/lpthread/lpthreads = pthreads support. Note that this generally
# has to be linked as late as possible (and in particular after the
# implied -lc) because libpthread overrides non-thread-safe and stub
# functions in libraries linked earlier on with thread-safe
# alternatives.
# -lw = Widechar support.
OSLIBS_AIX = -lc_r -lpthreads
OSLIBS_BEOS =
OSLIBS_BEOS_BONE = -lbind -lsocket
OSLIBS_BSDI = -lgcc
OSLIBS_CRAY = -lpthread
OSLIBS_CYGWIN =
OSLIBS_FREEBSD = -lc_r
OSLIBS_HPUX10 =
OSLIBS_HPUX11 = -lpthread
OSLIBS_IRIX = -lw
OSLIBS_LINUX = -lresolv -lpthread
OSLIBS_MPRAS = -K xpg42 -lnsl -lsocket -lc89
OSLIBS_NETBSD = -lpthread
OSLIBS_SCO = -lsocket
OSLIBS_SUNOS = -ldl -lnsl -lposix4
OSLIBS_SOLARIS5 = -lw -lsocket -lkstat -lnsl -lposix4 -lthread
OSLIBS_SOLARIS7 = -lw -lresolv -lsocket -lkstat -lrt -lnsl -lthread
get_libs:
@case $(OSNAME) in \
'AIX') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_AIX)" ;; \
'BeOS') \
if [ -f /system/lib/libbind.so ] ; then \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_BEOS_BONE)" ; \
else \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_BEOS)" ; \
fi ;; \
'BSD/OS') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_BSDI)" ;; \
'CYGWIN_NT-5.0'|'CYGWIN_NT-5.1') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_CYGWIN)" ;; \
'FreeBSD') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_FREEBSD)" ;; \
'HP-UX') \
case `uname -r | sed 's/^[A-Z].//' | cut -f 1 -d '.'` in \
9|10) \
if gcc -v > /dev/null 2>&1; then \
make $(LINK_TARGET) LD=gcc \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_HPUX10)" ; \
else \
make $(LINK_TARGET) \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_HPUX10)" ; \
fi ;; \
11) \
if gcc -v > /dev/null 2>&1; then \
make $(LINK_TARGET) LD=gcc \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_HPUX11)" ; \
else \
make $(LINK_TARGET) \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_HPUX11)" ; \
fi ;; \
esac ;; \
'IRIX'|'IRIX64') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_IRIX)" ;; \
'Linux'|'OSF1') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_LINUX)" ;; \
'NetBSD') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_NETBSD)" ;; \
'SunOS') \
case `uname -r | cut -f 1 -d '.'` in \
4) \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_SUNOS)" ;; \
5|6) \
if [ `/usr/ucb/cc | grep -c installed` = '1' ] ; then \
make $(LINK_TARGET) LD=gcc \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_SOLARIS5)" ; \
else \
make $(LINK_TARGET) \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_SOLARIS5)" ; \
fi ;; \
7|8|9) \
if [ `/usr/ucb/cc | grep -c installed` = '1' ] ; then \
make $(LINK_TARGET) LD=gcc \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_SOLARIS7)" ; \
else \
make $(LINK_TARGET) \
LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_SOLARIS7)" ; \
fi ;; \
esac ;; \
'UNIX_SV') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_MPRAS)" ;; \
'UnixWare') \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_SCO)" ;; \
*) \
if [ `uname -m | cut -c 1-4` = 'CRAY' ] ; then \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) \
OS_LIBS="$(OSLIBS_CRAY)" ; \
else \
make $(LINK_TARGET) LIB=$(LIB) OUT=$(OUT) ; \
fi ;; \
esac
# Create the static 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 a 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. QNX doesn't have either ranlib or the
# 's' option to ar, so the best we can do is use 'ar rc'. Finally, Unicos
# has a weird ar that takes args in a nonstandard form.
#
# The OS-specific linking is handled through multiple levels of indirection.
# At the top level we specify the target and library to link with (static or
# shared). We pass this down to get_libs, which sorts out the OS-specific
# library options, and then finally passes the whole lot down to link, which
# performs the actual link.
#
# When cross-compiling, we have to use the hosted tools and libraries rather
# than the system tools and libraries for the build, so we special-case this
# step based on the $(OSNAME) setting.
#
# 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).
ar_rc:
@$(AR) rc $(LIBNAME) $(OBJS) $(EXTRAOBJS)
ar_rcs:
@$(AR) rcs $(LIBNAME) $(OBJS) $(EXTRAOBJS)
ar_cray:
@$(AR) -rc $(LIBNAME) $(OBJS) $(EXTRAOBJS)
ar_guess:
@ar rcs $(LIBNAME) $(OBJS) $(EXTRAOBJS) || \
( ar rc $(LIBNAME) $(OBJS) $(EXTRAOBJS) && \
ranlib $(LIBNAME) )
ranlib:
@$(AR) rc $(LIBNAME) $(OBJS) $(EXTRAOBJS)
@ranlib $(LIBNAME)
palmlib:
@palib -add $(LIBNAME) $(OBJS) $(EXTRAOBJS)
palink -nodebug -o palmcl.dll $(LIBNAME) $(OBJPATH)cryptsld.o \
-libpath $(PALMSDK_PATH)/libraries/ARM_4T/Release/Default
palmlib-prc:
@arm-palmos-ar rc $(LIBNAME) $(OBJS) $(EXTRAOBJS)
@arm-palmos-ranlib $(LIBNAME)
$(LIBNAME): $(OBJS) $(EXTRAOBJS) $(TESTOBJS)
@case $(OSNAME) in \
'AIX'|'HP-UX'|'Linux'|'OSF1'|'UNIX_SV') \
make ar_rcs ;; \
'Atmel') \
echo "Need to set up Atmel link command" ;; \
'BSD/OS'|'FreeBSD'|'iBSD'|'NetBSD'|'OpenBSD') \
make ranlib ;; \
'CRAY') \
make ar_cray ;; \
'PalmOS') \
make palmlib ;; \
'PalmOS-PRC') \
make palmlib-prc ;; \
'QNX') \
make ar_rc ;; \
'SunOS') \
if [ `which ar | grep -c "no ar"` = '1' ] ; then \
make AR=/usr/ccs/bin/ar ar_rcs ; \
else \
make ar_rcs ; \
fi ;; \
'ucLinux') \
echo "Need to set up ucLinux link command" ;; \
*) \
make ar_guess ;; \
esac
# Create the shared library. The options need to be
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -