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

📄 makefile

📁 提供了很多种加密算法和CA认证及相关服务如CMP、OCSP等的开发
💻
📖 第 1 页 / 共 4 页
字号:

$(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 which are produced by compiling the C
# equivalents of the asm files, so that (provided the build succeeds) the .o
# files which 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 following pseudo-dependencies build the x86 asm modules, which cover
# every major encryption algorithm and the bignum code.

asm_bf:					crypt/bx86unix.cpp
						@if [ ! -f $(OBJPATH)bf_enc.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) crypt/bx86unix.cpp | $(AS) -o $(OBJPATH)bf_enc.o ; \
						fi

asm_bn:					bn/bn86unix.cpp
						@if [ ! -f $(OBJPATH)bn_mulw.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) bn/bn86unix.cpp | $(AS) -o $(OBJPATH)bn_mulw.o ; \
						fi

asm_cast:				crypt/cx86unix.cpp
						@if [ ! -f $(OBJPATH)castcore.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) crypt/cx86unix.cpp | $(AS) -o $(OBJPATH)c_enc.o ; \
						fi

asm_des:				crypt/dx86unix.cpp
						@if [ ! -f $(OBJPATH)des_enc.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) crypt/dx86unix.cpp | $(AS) -o $(OBJPATH)des_enc.o ; \
						fi

asm_rc4:				crypt/rx86unix.cpp
						@if [ ! -f $(OBJPATH)rc4_enc.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) crypt/rx86unix.cpp | $(AS) -o $(OBJPATH)rc4_enc.o ; \
						fi

asm_md5:				hash/mx86unix.cpp
						@if [ ! -f $(OBJPATH)md5core.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) hash/mx86unix.cpp | $(AS) -o $(OBJPATH)md5core.o ; \
						fi

asm_sha1:				hash/sx86unix.cpp
						@if [ ! -f $(OBJPATH)sha1core.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) hash/sx86unix.cpp | $(AS) -o $(OBJPATH)sha1core.o ; \
						fi

asm_ripemd:				hash/asm.h hash/rmd160cp.S
						@if [ ! -f $(OBJPATH)ripecore.o ] ; \
						then \
							$(CPP) -D$(ASMFLAGS) hash/rmd160cp.S | $(AS) -o $(OBJPATH)ripecore.o ; \
						fi

		# The kludge in the first line is necessary for &%#^$%^#& gcc
		# which refuses to preprocess a file even if explicitly told to
		# using -E if it doesn't like the extension on the file.  In
		# addition this comment has to be above the depedency, since some
		# versions of GNU make will echo it to the screen if it's below
		# it.

asm_targets:
		@if [ ! -f hash/rmd160cp.S ] ; \
			then mv hash/rmd160cp.s hash/rmd160cp.S ; \
		fi
		@make asm_bf ASMFLAGS=$(ASMFLAGS)
		@make asm_bn ASMFLAGS=$(ASMFLAGS)
		@make asm_cast ASMFLAGS=$(ASMFLAGS)
		@make asm_des ASMFLAGS=$(ASMFLAGS)
		@make asm_md5 ASMFLAGS=$(ASMFLAGS)
		@make asm_sha1 ASMFLAGS=$(ASMFLAGS)
		@make asm_rc4 ASMFLAGS=$(ASMFLAGS)
		@make asm_ripemd ASMFLAGS=$(ASMFLAGS)

# The pseudo-dependencies to build the asm modules for other processors.
# Only the bignum code is done in asm for these.

asm_alpha:				bn/alpha.s
						$(AS) bn/alpha.s -o $(OBJPATH)bn_mulw.o

asm_phux:				bn/pa-risc2.s
						$(AS) bn/pa-risc2.s -o $(OBJPATH)bn_mulw.o

asm_mips:				bn/r3000.s
						$(AS) bn/r3000.s -o $(OBJPATH)bn_mulw.o

asm_sparc:				bn/sparc.s
						$(AS) bn/sparc.s -o $(OBJPATH)bn_mulw.o

# 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

testkey.o:				cryptlib.h crypt.h test/test.h test/testkey.c
						$(CC) $(CFLAGS) test/testkey.c

testll.o:				cryptlib.h crypt.h test/test.h test/testll.c
						$(CC) $(CFLAGS) test/testll.c

testsess.o:				cryptlib.h crypt.h test/test.h test/testsess.c
						$(CC) $(CFLAGS) test/testsess.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 which 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
# which wouldn't be used in an normal program).
#
# The use of ar and ranlib is rather system-dependant.  Some ar's (eg 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.
#
# Building the shared library is even more system-dependant, we check for
# various OS's we know about and adjust the link as appropriate.

$(LIBPATH)$(LIBNAME):	$(OBJS) certutil.o testcert.o testdev.o testenv.o \
						testhl.o testkey.o testll.o testsess.o testlib.o
						@if [ `uname` = 'OSF1' ] || [ `uname` = 'Linux' ] || \
							[ `uname` = 'AIX' ] || [ `uname` = 'HP-UX' ] || \
							[ `uname` = 'SunOS' ] ; \
						then \
							ar rcs $(LIBPATH)$(LIBNAME) $(OBJS); \
						elif [ `uname` = 'BSD/OS' ] ; \
						then \
							ar rc $(LIBPATH)$(LIBNAME) $(OBJS); \
							ranlib $(LIBPATH)$(LIBNAME); \
						else \
							ar rcs $(LIBPATH)$(LIBNAME) $(OBJS) || \
							( ar rc $(LIBPATH)$(LIBNAME) $(OBJS) && \
							  ranlib $(LIBPATH)$(LIBNAME) ); \
						fi

$(LIBPATH)$(SLIBNAME):	$(OBJS) certutil.o testcert.o testdev.o testenv.o \
						testhl.o testkey.o testll.o testsess.o testlib.o
						@if [ `uname` = 'HP-UX' ] ; \
						then \
							ld -b -o lib$(PROJ).sl $(OBJS); \
							strip lib$(PROJ).sl; \
						else \
							$(SLD) -o $(LIBPATH)$(SLIBNAME) $(OBJS); \
							strip $(LIBPATH)$(SLIBNAME); \
						fi

# 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.
#
# The OS's and the required libraries are:
#
#	AIX:					-lc_r -lpthreads
#	BSDI:					-lgcc
#	Irix:					-lw
#	Linux/OSF1/DEC Unix:	-lpthread
#	PHUX 11.x:				-lpthread
#	SunOS 5+ (Slowaris):	-lw -lkstat -lthread -ldl
#	UnixWare (SCO):			-lsocket -Kthread
#
# Comments:
#
#	-lc_r = libc extended with reentrant functions needed for threading
#	-ldl = dload support for sockets which would normally need -lsl, also
#		   used 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
#	-lw = Widechar support
#
# After the shared stuff is built, you can test it with:
#
#	/sbin/ldconfig . >& /dev/null
#	LD_LIBRARY_PATH=.
#	ldd ./testlib

testlib:	$(LIBNAME) certutil.o testcert.o testdev.o testenv.o testhl.o \
			testkey.o testll.o testsess.o testlib.o
			@if [ `uname` = 'IRIX' ] || [ `uname` = 'IRIX64' ] ; \
			then \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) -lw $(TESTLIBS); \
			elif [ `uname` = 'SunOS' ] && [ `uname -r | tr -d '[A-Z].' | cut -c 1` = '5' ] ; \
			then \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) -lw -lkstat -lthread -ldl $(TESTLIBS) ; \
			elif [ `uname` = 'BSD/OS' ] ; \
			then \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) -lgcc $(TESTLIBS); \
			elif [ `uname` = 'Linux' ] || [ `uname` = 'OSF1' ] ; \
			then \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) -lpthread $(TESTLIBS); \
			elif [ `uname` = 'AIX' ] ; \
			then \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) -lc_r -lpthreads $(TESTLIBS); \
			elif [ `uname` = 'UnixWare' ] ; \
			then \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) -lsocket -Kthread $(TESTLIBS); \
			elif [ `uname` = 'HP-UX' ] && [ `uname -r | tr -d '[A-Z].' | cut -c 2` = '11' ] ; \
			then \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) -lpthread $(TESTLIBS) ; \
			else \
				$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
				testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
				-L. -l$(PROJ) $(TESTLIBS); \
			fi

certinst:	$(LIBNAME) certinst.o
			@if [ `uname` = 'IRIX' ] || [ `uname` = 'IRIX32' ] ; \
			then \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) -lw $(TESTLIBS); \
			elif [ `uname` = 'SunOS' ] && [ `uname -r | tr -d '[A-Z].' | cut -c 1` = '5' ] ; \
			then \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) -lw -lkstat -lthread -ldl $(TESTLIBS); \
			elif [ `uname` = 'BSD/OS' ] ; \
			then \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) -lgcc $(TESTLIBS); \
			elif [ `uname` = 'Linux' ] || [ `uname` = 'OSF1' ] ; \
			then \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) -lpthread $(TESTLIBS); \
			elif [ `uname` = 'AIX' ] ; \
			then \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) -lpthreads $(TESTLIBS); \
			elif [ `uname` = 'UnixWare' ] ; \
			then \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) -lsocket -Kthread $(TESTLIBS); \
			elif [ `uname` = 'HP-UX' ] && [ `uname -r | tr -d '[A-Z].' | cut -c 2` = '11' ] ; \
			then \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) -lpthreads $(TESTLIBS); \
			else \
				$(LD) -o certinst $(LDFLAGS) certinst.o certutil.o \
				-L. -l$(PROJ) $(TESTLIBS); \
			fi

stestlib:	certutil.o testcert.o testdev.o testenv.o testhl.o testkey.o \
			testll.o testsess.o testlib.o
			@$(LD) -o testlib $(LDFLAGS) certutil.o testcert.o testdev.o \
			testenv.o testhl.o testkey.o testll.o testsess.o testlib.o \
			$(SLIBNAME)

#****************************************************************************
#*																			*
#*						Defines for each variation of Unix					*
#*																			*
#****************************************************************************

# Aches: A vaguely Unix-compatible OS designed by IBM.  The maxmem option
#		 is to give the optimizer more headroom, it's not really needed
#		 but avoids millions of informational messages telling you to
#		 increase it from the default 2048.  The roconst puts const data
#		 into read-only memory (this may happen anyway on some versions of
#		 the compiler).

AIX:
		@make $(DEFINES) CFLAGS="$(CFLAGS) -O2 -qmaxmem=-1 -qroconst -D_REENTRANT"

⌨️ 快捷键说明

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