Makefile.fips 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638
  1. ##
  2. ## Makefile for OpenSSL: fipscanister.o only
  3. ##
  4. VERSION=fips-2.0-test
  5. MAJOR=
  6. MINOR=
  7. SHLIB_VERSION_NUMBER=
  8. SHLIB_VERSION_HISTORY=
  9. SHLIB_MAJOR=
  10. SHLIB_MINOR=
  11. SHLIB_EXT=
  12. PLATFORM=dist
  13. OPTIONS=
  14. CONFIGURE_ARGS=
  15. SHLIB_TARGET=
  16. # HERE indicates where this Makefile lives. This can be used to indicate
  17. # where sub-Makefiles are expected to be. Currently has very limited usage,
  18. # and should probably not be bothered with at all.
  19. HERE=.
  20. # INSTALL_PREFIX is for package builders so that they can configure
  21. # for, say, /usr/ and yet have everything installed to /tmp/somedir/usr/.
  22. # Normally it is left empty.
  23. INSTALL_PREFIX=
  24. INSTALLTOP=/usr/local/ssl
  25. # Do not edit this manually. Use Configure --openssldir=DIR do change this!
  26. OPENSSLDIR=/usr/local/ssl
  27. # NO_IDEA - Define to build without the IDEA algorithm
  28. # NO_RC4 - Define to build without the RC4 algorithm
  29. # NO_RC2 - Define to build without the RC2 algorithm
  30. # THREADS - Define when building with threads, you will probably also need any
  31. # system defines as well, i.e. _REENTERANT for Solaris 2.[34]
  32. # TERMIO - Define the termio terminal subsystem, needed if sgtty is missing.
  33. # TERMIOS - Define the termios terminal subsystem, Silicon Graphics.
  34. # LONGCRYPT - Define to use HPUX 10.x's long password modification to crypt(3).
  35. # DEVRANDOM - Give this the value of the 'random device' if your OS supports
  36. # one. 32 bytes will be read from this when the random
  37. # number generator is initalised.
  38. # SSL_FORBID_ENULL - define if you want the server to be not able to use the
  39. # NULL encryption ciphers.
  40. #
  41. # LOCK_DEBUG - turns on lots of lock debug output :-)
  42. # REF_CHECK - turn on some xyz_free() assertions.
  43. # REF_PRINT - prints some stuff on structure free.
  44. # CRYPTO_MDEBUG - turns on my 'memory leak' detecting stuff
  45. # MFUNC - Make all Malloc/Free/Realloc calls call
  46. # CRYPTO_malloc/CRYPTO_free/CRYPTO_realloc which can be setup to
  47. # call application defined callbacks via CRYPTO_set_mem_functions()
  48. # MD5_ASM needs to be defined to use the x86 assembler for MD5
  49. # SHA1_ASM needs to be defined to use the x86 assembler for SHA1
  50. # RMD160_ASM needs to be defined to use the x86 assembler for RIPEMD160
  51. # Do not define B_ENDIAN or L_ENDIAN if 'unsigned long' == 8. It must
  52. # equal 4.
  53. # PKCS1_CHECK - pkcs1 tests.
  54. CC= cc
  55. CFLAG= -O
  56. DEPFLAG=
  57. PEX_LIBS=
  58. EX_LIBS=
  59. EXE_EXT=
  60. ARFLAGS=
  61. AR=ar $(ARFLAGS) r
  62. RANLIB= ranlib
  63. NM= nm
  64. PERL= perl
  65. TAR= tar
  66. TARFLAGS= --no-recursion
  67. MAKEDEPPROG=makedepend
  68. LIBDIR=lib
  69. # We let the C compiler driver to take care of .s files. This is done in
  70. # order to be excused from maintaining a separate set of architecture
  71. # dependent assembler flags. E.g. if you throw -mcpu=ultrasparc at SPARC
  72. # gcc, then the driver will automatically translate it to -xarch=v8plus
  73. # and pass it down to assembler.
  74. #AS=$(CC) -c
  75. ASFLAG=$(CFLAG)
  76. # For x86 assembler: Set PROCESSOR to 386 if you want to support
  77. # the 80386.
  78. PROCESSOR=
  79. # CPUID module collects small commonly used assembler snippets
  80. CPUID_OBJ=
  81. BN_ASM= bn_asm.o
  82. DES_ENC= des_enc.o fcrypt_b.o
  83. AES_ENC= aes_core.o aes_cbc.o
  84. BF_ENC= bf_enc.o
  85. CAST_ENC= c_enc.o
  86. RC4_ENC= rc4_enc.o
  87. RC5_ENC= rc5_enc.o
  88. MD5_ASM_OBJ=
  89. SHA1_ASM_OBJ=
  90. RMD160_ASM_OBJ=
  91. WP_ASM_OBJ=
  92. CMLL_ENC=
  93. MODES_ASM_OBJ=
  94. PERLASM_SCHEME=
  95. # KRB5 stuff
  96. KRB5_INCLUDES=
  97. LIBKRB5=
  98. # Zlib stuff
  99. ZLIB_INCLUDE=
  100. LIBZLIB=
  101. # This is the location of fipscanister.o and friends.
  102. # The FIPS module build will place it $(INSTALLTOP)/lib
  103. # but since $(INSTALLTOP) can only take the default value
  104. # when the module is built it will be in /usr/local/ssl/lib
  105. # $(INSTALLTOP) for this build may be different so hard
  106. # code the path.
  107. FIPSLIBDIR=/usr/local/ssl/$(LIBDIR)/
  108. # This is set to "y" if fipscanister.o is compiled internally as
  109. # opposed to coming from an external validated location.
  110. FIPSCANISTERINTERNAL=n
  111. # This is set if we only build fipscanister.o
  112. FIPSCANISTERONLY=y
  113. # The location of the library which contains fipscanister.o
  114. # normally it will be libcrypto unless fipsdso is set in which
  115. # case it will be libfips. If not compiling in FIPS mode at all
  116. # this is empty making it a useful test for a FIPS compile.
  117. FIPSCANLIB=
  118. # Shared library base address. Currently only used on Windows.
  119. #
  120. BASEADDR=
  121. DIRS= crypto fips test
  122. ENGDIRS= ccgost
  123. SHLIBDIRS= crypto
  124. # dirs in crypto to build
  125. SDIRS= \
  126. sha hmac des aes modes \
  127. bn ec rsa dsa ecdsa dh \
  128. buffer evp ecdh cmac
  129. # keep in mind that the above list is adjusted by ./Configure
  130. # according to no-xxx arguments...
  131. LINKDIRS= \
  132. objects sha hmac des aes modes \
  133. bn ec rsa dsa ecdh cmac ecdsa dh engine \
  134. buffer bio stack lhash rand err \
  135. evp asn1 ui
  136. # tests to perform. "alltests" is a special word indicating that all tests
  137. # should be performed.
  138. TESTS = alltests
  139. MAKEFILE= Makefile
  140. MANDIR=$(OPENSSLDIR)/man
  141. MAN1=1
  142. MAN3=3
  143. MANSUFFIX=
  144. HTMLSUFFIX=html
  145. HTMLDIR=$(OPENSSLDIR)/html
  146. SHELL=/bin/sh
  147. TOP= .
  148. ONEDIRS=out tmp
  149. EDIRS= times doc bugs util include certs ms shlib mt demos perl sf dep VMS
  150. WDIRS= windows
  151. LIBS=
  152. SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
  153. SHARED_SSL=libssl$(SHLIB_EXT)
  154. SHARED_LIBS=
  155. SHARED_LIBS_LINK_EXTS=
  156. SHARED_LDFLAGS=
  157. GENERAL= Makefile
  158. BASENAME= openssl
  159. NAME= $(BASENAME)-$(VERSION)
  160. TARFILE= openssl-fips-2.0.tar
  161. WTARFILE= $(NAME)-win.tar
  162. EXHEADER= e_os2.h
  163. HEADER= e_os.h
  164. all: Makefile build_all openssl.pc libssl.pc libcrypto.pc
  165. # as we stick to -e, CLEARENV ensures that local variables in lower
  166. # Makefiles remain local and variable. $${VAR+VAR} is tribute to Korn
  167. # shell, which [annoyingly enough] terminates unset with error if VAR
  168. # is not present:-( TOP= && unset TOP is tribute to HP-UX /bin/sh,
  169. # which terminates unset with error if no variable was present:-(
  170. CLEARENV= TOP= && unset TOP $${LIB+LIB} $${LIBS+LIBS} \
  171. $${INCLUDE+INCLUDE} $${INCLUDES+INCLUDES} \
  172. $${DIR+DIR} $${DIRS+DIRS} $${SRC+SRC} \
  173. $${LIBSRC+LIBSRC} $${LIBOBJ+LIBOBJ} $${ALL+ALL} \
  174. $${EXHEADER+EXHEADER} $${HEADER+HEADER} \
  175. $${GENERAL+GENERAL} $${CFLAGS+CFLAGS} \
  176. $${ASFLAGS+ASFLAGS} $${AFLAGS+AFLAGS} \
  177. $${LDCMD+LDCMD} $${LDFLAGS+LDFLAGS} \
  178. $${SHAREDCMD+SHAREDCMD} $${SHAREDFLAGS+SHAREDFLAGS} \
  179. $${SHARED_LIB+SHARED_LIB} $${LIBEXTRAS+LIBEXTRAS}
  180. BUILDENV= PLATFORM='$(PLATFORM)' PROCESSOR='$(PROCESSOR)' \
  181. CC='$(CC)' CFLAG='$(CFLAG)' \
  182. ASFLAG='$(CFLAG) -c' \
  183. AR='$(AR)' NM='$(NM)' RANLIB='$(RANLIB)' \
  184. CROSS_COMPILE='$(CROSS_COMPILE)' \
  185. PERL='$(PERL)' ENGDIRS='$(ENGDIRS)' \
  186. SDIRS='$(SDIRS)' LIBRPATH='$(INSTALLTOP)/$(LIBDIR)' \
  187. INSTALL_PREFIX='$(INSTALL_PREFIX)' \
  188. INSTALLTOP='$(INSTALLTOP)' OPENSSLDIR='$(OPENSSLDIR)' \
  189. LIBDIR='$(LIBDIR)' \
  190. MAKEDEPEND='$$$${TOP}/util/domd $$$${TOP} -MD $(MAKEDEPPROG)' \
  191. DEPFLAG='-DOPENSSL_NO_DEPRECATED $(DEPFLAG)' \
  192. MAKEDEPPROG='$(MAKEDEPPROG)' \
  193. SHARED_LDFLAGS='$(SHARED_LDFLAGS)' \
  194. KRB5_INCLUDES='$(KRB5_INCLUDES)' LIBKRB5='$(LIBKRB5)' \
  195. ZLIB_INCLUDE='$(ZLIB_INCLUDE)' LIBZLIB='$(LIBZLIB)' \
  196. EXE_EXT='$(EXE_EXT)' SHARED_LIBS='$(SHARED_LIBS)' \
  197. SHLIB_EXT='$(SHLIB_EXT)' SHLIB_TARGET='$(SHLIB_TARGET)' \
  198. PEX_LIBS='$(PEX_LIBS)' EX_LIBS='$(EX_LIBS)' \
  199. CPUID_OBJ='$(CPUID_OBJ)' \
  200. BN_ASM='$(BN_ASM)' DES_ENC='$(DES_ENC)' \
  201. AES_ENC='$(AES_ENC)' CMLL_ENC='$(CMLL_ENC)' \
  202. BF_ENC='$(BF_ENC)' CAST_ENC='$(CAST_ENC)' \
  203. RC4_ENC='$(RC4_ENC)' RC5_ENC='$(RC5_ENC)' \
  204. SHA1_ASM_OBJ='$(SHA1_ASM_OBJ)' \
  205. MD5_ASM_OBJ='$(MD5_ASM_OBJ)' \
  206. RMD160_ASM_OBJ='$(RMD160_ASM_OBJ)' \
  207. WP_ASM_OBJ='$(WP_ASM_OBJ)' \
  208. MODES_ASM_OBJ='$(MODES_ASM_OBJ)' \
  209. PERLASM_SCHEME='$(PERLASM_SCHEME)' \
  210. FIPSLIBDIR='${FIPSLIBDIR}' \
  211. FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}" \
  212. FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}' \
  213. FIPSCANISTERONLY='${FIPSCANISTERONLY}' \
  214. FIPS_EX_OBJ='${FIPS_EX_OBJ}' \
  215. THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
  216. # MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
  217. # which in turn eliminates ambiguities in variable treatment with -e.
  218. # BUILD_CMD is a generic macro to build a given target in a given
  219. # subdirectory. The target must be given through the shell variable
  220. # `target' and the subdirectory to build in must be given through `dir'.
  221. # This macro shouldn't be used directly, use RECURSIVE_BUILD_CMD or
  222. # BUILD_ONE_CMD instead.
  223. #
  224. # BUILD_ONE_CMD is a macro to build a given target in a given
  225. # subdirectory if that subdirectory is part of $(DIRS). It requires
  226. # exactly the same shell variables as BUILD_CMD.
  227. #
  228. # RECURSIVE_BUILD_CMD is a macro to build a given target in all
  229. # subdirectories defined in $(DIRS). It requires that the target
  230. # is given through the shell variable `target'.
  231. BUILD_CMD= if [ -d "$$dir" ]; then \
  232. ( cd $$dir && echo "making $$target in $$dir..." && \
  233. $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
  234. ) || exit 1; \
  235. fi
  236. RECURSIVE_BUILD_CMD=for dir in $(DIRS); do $(BUILD_CMD); done
  237. BUILD_ONE_CMD=\
  238. if expr " $(DIRS) " : ".* $$dir " >/dev/null 2>&1; then \
  239. $(BUILD_CMD); \
  240. fi
  241. reflect:
  242. @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
  243. FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
  244. ../crypto/aes/aes_ecb.o \
  245. ../crypto/aes/aes_ofb.o \
  246. ../crypto/bn/bn_add.o \
  247. ../crypto/bn/bn_blind.o \
  248. ../crypto/bn/bn_ctx.o \
  249. ../crypto/bn/bn_div.o \
  250. ../crypto/bn/bn_exp2.o \
  251. ../crypto/bn/bn_exp.o \
  252. ../crypto/bn/bn_gcd.o \
  253. ../crypto/bn/bn_gf2m.o \
  254. ../crypto/bn/bn_lib.o \
  255. ../crypto/bn/bn_mod.o \
  256. ../crypto/bn/bn_mont.o \
  257. ../crypto/bn/bn_mul.o \
  258. ../crypto/bn/bn_nist.o \
  259. ../crypto/bn/bn_prime.o \
  260. ../crypto/bn/bn_rand.o \
  261. ../crypto/bn/bn_recp.o \
  262. ../crypto/bn/bn_shift.o \
  263. ../crypto/bn/bn_sqr.o \
  264. ../crypto/bn/bn_word.o \
  265. ../crypto/bn/bn_x931p.o \
  266. ../crypto/buffer/buf_str.o \
  267. ../crypto/cmac/cmac.o \
  268. ../crypto/cryptlib.o \
  269. ../crypto/des/cfb64ede.o \
  270. ../crypto/des/cfb64enc.o \
  271. ../crypto/des/cfb_enc.o \
  272. ../crypto/des/ecb3_enc.o \
  273. ../crypto/des/ofb64ede.o \
  274. ../crypto/des/fcrypt.o \
  275. ../crypto/des/set_key.o \
  276. ../crypto/dh/dh_check.o \
  277. ../crypto/dh/dh_gen.o \
  278. ../crypto/dh/dh_key.o \
  279. ../crypto/dsa/dsa_gen.o \
  280. ../crypto/dsa/dsa_key.o \
  281. ../crypto/dsa/dsa_ossl.o \
  282. ../crypto/ec/ec_curve.o \
  283. ../crypto/ec/ec_cvt.o \
  284. ../crypto/ec/ec_key.o \
  285. ../crypto/ec/ec_lib.o \
  286. ../crypto/ec/ecp_mont.o \
  287. ../crypto/ec/ec_mult.o \
  288. ../crypto/ec/ecp_nist.o \
  289. ../crypto/ec/ecp_smpl.o \
  290. ../crypto/ec/ec2_mult.o \
  291. ../crypto/ec/ec2_smpl.o \
  292. ../crypto/ecdh/ech_key.o \
  293. ../crypto/ecdh/ech_ossl.o \
  294. ../crypto/ecdsa/ecs_ossl.o \
  295. ../crypto/evp/e_aes.o \
  296. ../crypto/evp/e_des3.o \
  297. ../crypto/evp/e_null.o \
  298. ../crypto/evp/m_sha1.o \
  299. ../crypto/evp/m_dss1.o \
  300. ../crypto/evp/m_dss.o \
  301. ../crypto/evp/m_ecdsa.o \
  302. ../crypto/hmac/hmac.o \
  303. ../crypto/modes/cbc128.o \
  304. ../crypto/modes/ccm128.o \
  305. ../crypto/modes/cfb128.o \
  306. ../crypto/modes/ctr128.o \
  307. ../crypto/modes/gcm128.o \
  308. ../crypto/modes/ofb128.o \
  309. ../crypto/modes/xts128.o \
  310. ../crypto/rsa/rsa_eay.o \
  311. ../crypto/rsa/rsa_gen.o \
  312. ../crypto/rsa/rsa_crpt.o \
  313. ../crypto/rsa/rsa_none.o \
  314. ../crypto/rsa/rsa_oaep.o \
  315. ../crypto/rsa/rsa_pk1.o \
  316. ../crypto/rsa/rsa_pss.o \
  317. ../crypto/rsa/rsa_ssl.o \
  318. ../crypto/rsa/rsa_x931.o \
  319. ../crypto/rsa/rsa_x931g.o \
  320. ../crypto/sha/sha1dgst.o \
  321. ../crypto/sha/sha256.o \
  322. ../crypto/sha/sha512.o \
  323. ../crypto/thr_id.o \
  324. ../crypto/uid.o
  325. sub_all: build_all
  326. build_all: build_libs
  327. build_libs: build_crypto build_fips
  328. build_fips:
  329. @dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
  330. build_crypto:
  331. if [ -n "$(FIPSCANLIB)" ]; then \
  332. EXCL_OBJ='$(AES_ENC) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA1_ASM_OBJ) $(MODES_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
  333. ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
  334. else \
  335. ARX='${AR}' ; \
  336. fi ; export ARX ; \
  337. if [ $(FIPSCANISTERINTERNAL) = "y" ]; then \
  338. AS='$(PERL) $${TOP}/util/fipsas.pl $${TOP} $${<} $(CC)' ; \
  339. else \
  340. AS='$(CC) -c' ; \
  341. fi ; export AS ; \
  342. dir=crypto; target=fips; $(BUILD_ONE_CMD)
  343. build_ssl:
  344. @dir=ssl; target=all; $(BUILD_ONE_CMD)
  345. build_engines:
  346. @dir=engines; target=all; $(BUILD_ONE_CMD)
  347. build_apps:
  348. @dir=apps; target=all; $(BUILD_ONE_CMD)
  349. build_tests:
  350. @dir=test; target=fipsexe; $(BUILD_ONE_CMD)
  351. build_algvs:
  352. @dir=test; target=fipsalgvs; $(BUILD_ONE_CMD)
  353. build_tools:
  354. @dir=tools; target=all; $(BUILD_ONE_CMD)
  355. all_testapps: build_libs build_testapps
  356. build_testapps:
  357. @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
  358. libcrypto$(SHLIB_EXT): libcrypto.a build_fips
  359. @if [ "$(SHLIB_TARGET)" != "" ]; then \
  360. if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
  361. FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
  362. export CC FIPSLD_CC; \
  363. fi; \
  364. $(MAKE) SHLIBDIRS=crypto build-shared; \
  365. else \
  366. echo "There's no support for shared libraries on this platform" >&2; \
  367. exit 1; \
  368. fi
  369. libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
  370. @if [ "$(SHLIB_TARGET)" != "" ]; then \
  371. $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
  372. else \
  373. echo "There's no support for shared libraries on this platform" >&2; \
  374. exit 1; \
  375. fi
  376. clean-shared:
  377. @set -e; for i in $(SHLIBDIRS); do \
  378. if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
  379. tmp="$(SHARED_LIBS_LINK_EXTS)"; \
  380. for j in $${tmp:-x}; do \
  381. ( set -x; rm -f lib$$i$$j ); \
  382. done; \
  383. fi; \
  384. ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
  385. if [ "$(PLATFORM)" = "Cygwin" ]; then \
  386. ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
  387. fi; \
  388. done
  389. link-shared:
  390. @ set -e; for i in $(SHLIBDIRS); do \
  391. $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
  392. LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
  393. LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
  394. symlink.$(SHLIB_TARGET); \
  395. libs="$$libs -l$$i"; \
  396. done
  397. build-shared: do_$(SHLIB_TARGET) link-shared
  398. do_$(SHLIB_TARGET):
  399. @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
  400. if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \
  401. libs="$(LIBKRB5) $$libs"; \
  402. fi; \
  403. $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
  404. LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
  405. LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
  406. LIBDEPS="$$libs $(EX_LIBS)" \
  407. link_a.$(SHLIB_TARGET); \
  408. libs="-l$$i $$libs"; \
  409. done
  410. libcrypto.pc: Makefile
  411. @ ( echo 'prefix=$(INSTALLTOP)'; \
  412. echo 'exec_prefix=$${prefix}'; \
  413. echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
  414. echo 'includedir=$${prefix}/include'; \
  415. echo ''; \
  416. echo 'Name: OpenSSL-libcrypto'; \
  417. echo 'Description: OpenSSL cryptography library'; \
  418. echo 'Version: '$(VERSION); \
  419. echo 'Requires: '; \
  420. echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
  421. echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
  422. libssl.pc: Makefile
  423. @ ( echo 'prefix=$(INSTALLTOP)'; \
  424. echo 'exec_prefix=$${prefix}'; \
  425. echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
  426. echo 'includedir=$${prefix}/include'; \
  427. echo ''; \
  428. echo 'Name: OpenSSL'; \
  429. echo 'Description: Secure Sockets Layer and cryptography libraries'; \
  430. echo 'Version: '$(VERSION); \
  431. echo 'Requires: '; \
  432. echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
  433. echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
  434. openssl.pc: Makefile
  435. @ ( echo 'prefix=$(INSTALLTOP)'; \
  436. echo 'exec_prefix=$${prefix}'; \
  437. echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
  438. echo 'includedir=$${prefix}/include'; \
  439. echo ''; \
  440. echo 'Name: OpenSSL'; \
  441. echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
  442. echo 'Version: '$(VERSION); \
  443. echo 'Requires: '; \
  444. echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
  445. echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
  446. Makefile: Makefile.fips Configure config
  447. @echo "Makefile is older than Makefile.org, Configure or config."
  448. @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
  449. @false
  450. libclean:
  451. rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
  452. clean: libclean
  453. rm -f shlib/*.o *.o core a.out fluff testlog make.log cctest cctest.c
  454. @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
  455. rm -f $(LIBS)
  456. rm -f openssl.pc libssl.pc libcrypto.pc
  457. rm -f speed.* .pure
  458. rm -f $(TARFILE)
  459. @set -e; for i in $(ONEDIRS) ;\
  460. do \
  461. rm -fr $$i/*; \
  462. done
  463. makefile.one: files
  464. $(PERL) util/mk1mf.pl >makefile.one; \
  465. sh util/do_ms.sh
  466. files:
  467. $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
  468. @set -e; target=files; $(RECURSIVE_BUILD_CMD)
  469. links:
  470. @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
  471. @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
  472. @set -e; dir=fips target=links; $(BUILD_ONE_CMD)
  473. @(cd crypto ; TEST='' SDIRS='$(LINKDIRS)' $(MAKE) -e links)
  474. gentests:
  475. @(cd test && echo "generating dummy tests (if needed)..." && \
  476. $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
  477. dclean:
  478. rm -rf *.bak include/openssl certs/.0
  479. @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
  480. test: tests
  481. tests:
  482. @echo "Not implemented in FIPS build" ; false
  483. report:
  484. @$(PERL) util/selftest.pl
  485. depend:
  486. @echo make depend not supported ; false
  487. lint:
  488. @set -e; target=lint; $(RECURSIVE_BUILD_CMD)
  489. tags:
  490. rm -f TAGS
  491. find . -name '[^.]*.[ch]' | xargs etags -a
  492. errors:
  493. $(PERL) util/mkerr.pl -recurse -write
  494. (cd engines; $(MAKE) PERL=$(PERL) errors)
  495. $(PERL) util/ck_errf.pl -strict */*.c */*/*.c
  496. stacks:
  497. $(PERL) util/mkstack.pl -write
  498. util/libeay.num::
  499. $(PERL) util/mkdef.pl crypto update
  500. util/ssleay.num::
  501. $(PERL) util/mkdef.pl ssl update
  502. crypto/objects/obj_dat.h: crypto/objects/obj_dat.pl crypto/objects/obj_mac.h
  503. $(PERL) crypto/objects/obj_dat.pl crypto/objects/obj_mac.h crypto/objects/obj_dat.h
  504. crypto/objects/obj_mac.h: crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num
  505. $(PERL) crypto/objects/objects.pl crypto/objects/objects.txt crypto/objects/obj_mac.num crypto/objects/obj_mac.h
  506. crypto/objects/obj_xref.h: crypto/objects/objxref.pl crypto/objects/obj_xref.txt crypto/objects/obj_mac.num
  507. $(PERL) crypto/objects/objxref.pl crypto/objects/obj_mac.num crypto/objects/obj_xref.txt >crypto/objects/obj_xref.h
  508. apps/openssl-vms.cnf: apps/openssl.cnf
  509. $(PERL) VMS/VMSify-conf.pl < apps/openssl.cnf > apps/openssl-vms.cnf
  510. crypto/bn/bn_prime.h: crypto/bn/bn_prime.pl
  511. $(PERL) crypto/bn/bn_prime.pl >crypto/bn/bn_prime.h
  512. TABLE: Configure
  513. (echo 'Output of `Configure TABLE'"':"; \
  514. $(PERL) Configure TABLE) > TABLE
  515. update: errors stacks util/libeay.num util/ssleay.num crypto/objects/obj_dat.h crypto/objects/obj_xref.h apps/openssl-vms.cnf crypto/bn/bn_prime.h TABLE depend
  516. # Build distribution tar-file. As the list of files returned by "find" is
  517. # pretty long, on several platforms a "too many arguments" error or similar
  518. # would occur. Therefore the list of files is temporarily stored into a file
  519. # and read directly, requiring GNU-Tar. Call "make TAR=gtar dist" if the normal
  520. # tar does not support the --files-from option.
  521. tar:
  522. find . -type d -print | xargs chmod 755
  523. find . -type f -print | xargs chmod a+r
  524. find . -type f -perm -0100 -print | xargs chmod a+x
  525. find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE | $(BUILDENV) LINKDIRS='$(LINKDIRS)' $(PERL) util/fipsdist.pl | sort > ../$(TARFILE).list; \
  526. $(TAR) $(TARFLAGS) --files-from ../$(TARFILE).list -cvf - | \
  527. tardy --user_number=0 --user_name=openssl \
  528. --group_number=0 --group_name=openssl \
  529. --prefix=openssl-$(VERSION) - |\
  530. gzip --best >../$(TARFILE).gz; \
  531. rm -f ../$(TARFILE).list; \
  532. ls -l ../$(TARFILE).gz
  533. tar-snap:
  534. @$(TAR) $(TARFLAGS) -cvf - \
  535. `find * \! -path CVS/\* \! -path \*/CVS/\* \! -name CVS \! -name .cvsignore \! -name STATUS \! -name TABLE \! -name '*.o' \! -name '*.a' \! -name '*.so' \! -name '*.so.*' \! -name 'openssl' \! -name '*test' \! -name '.#*' \! -name '*~' | sort` |\
  536. tardy --user_number=0 --user_name=openssl \
  537. --group_number=0 --group_name=openssl \
  538. --prefix=openssl-$(VERSION) - > ../$(TARFILE);\
  539. ls -l ../$(TARFILE)
  540. dist:
  541. $(PERL) Configure dist fipscanisteronly
  542. @$(MAKE) dist_pem_h
  543. @$(MAKE) SDIRS='$(SDIRS)' clean
  544. @$(MAKE) -f Makefile.fips TAR='$(TAR)' TARFLAGS='$(TARFLAGS)' tar
  545. dist_pem_h:
  546. (cd crypto/pem; $(MAKE) -e $(BUILDENV) pem.h; $(MAKE) clean)
  547. install: all install_sw
  548. install_sw:
  549. @$(PERL) $(TOP)/util/mkdir-p.pl $(INSTALL_PREFIX)$(INSTALLTOP)/bin \
  550. $(INSTALL_PREFIX)$(INSTALLTOP)/$(LIBDIR) \
  551. $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl
  552. @set -e; headerlist="$(EXHEADER)"; for i in $$headerlist;\
  553. do \
  554. (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
  555. chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
  556. done;
  557. @set -e; target=install; $(RECURSIVE_BUILD_CMD)
  558. # DO NOT DELETE THIS LINE -- make depend depends on it.