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-test.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 build_tests
  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_tools:
  352. @dir=tools; target=all; $(BUILD_ONE_CMD)
  353. all_testapps: build_libs build_testapps
  354. build_testapps:
  355. @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
  356. libcrypto$(SHLIB_EXT): libcrypto.a build_fips
  357. @if [ "$(SHLIB_TARGET)" != "" ]; then \
  358. if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
  359. FIPSLD_CC="$(CC)"; CC=fips/fipsld; \
  360. export CC FIPSLD_CC; \
  361. fi; \
  362. $(MAKE) SHLIBDIRS=crypto build-shared; \
  363. else \
  364. echo "There's no support for shared libraries on this platform" >&2; \
  365. exit 1; \
  366. fi
  367. libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
  368. @if [ "$(SHLIB_TARGET)" != "" ]; then \
  369. $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
  370. else \
  371. echo "There's no support for shared libraries on this platform" >&2; \
  372. exit 1; \
  373. fi
  374. clean-shared:
  375. @set -e; for i in $(SHLIBDIRS); do \
  376. if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
  377. tmp="$(SHARED_LIBS_LINK_EXTS)"; \
  378. for j in $${tmp:-x}; do \
  379. ( set -x; rm -f lib$$i$$j ); \
  380. done; \
  381. fi; \
  382. ( set -x; rm -f lib$$i$(SHLIB_EXT) ); \
  383. if [ "$(PLATFORM)" = "Cygwin" ]; then \
  384. ( set -x; rm -f cyg$$i$(SHLIB_EXT) lib$$i$(SHLIB_EXT).a ); \
  385. fi; \
  386. done
  387. link-shared:
  388. @ set -e; for i in $(SHLIBDIRS); do \
  389. $(MAKE) -f $(HERE)/Makefile.shared -e $(BUILDENV) \
  390. LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
  391. LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
  392. symlink.$(SHLIB_TARGET); \
  393. libs="$$libs -l$$i"; \
  394. done
  395. build-shared: do_$(SHLIB_TARGET) link-shared
  396. do_$(SHLIB_TARGET):
  397. @ set -e; libs='-L. $(SHLIBDEPS)'; for i in $(SHLIBDIRS); do \
  398. if [ "$$i" = "ssl" -a -n "$(LIBKRB5)" ]; then \
  399. libs="$(LIBKRB5) $$libs"; \
  400. fi; \
  401. $(CLEARENV) && $(MAKE) -f Makefile.shared -e $(BUILDENV) \
  402. LIBNAME=$$i LIBVERSION=$(SHLIB_MAJOR).$(SHLIB_MINOR) \
  403. LIBCOMPATVERSIONS=";$(SHLIB_VERSION_HISTORY)" \
  404. LIBDEPS="$$libs $(EX_LIBS)" \
  405. link_a.$(SHLIB_TARGET); \
  406. libs="-l$$i $$libs"; \
  407. done
  408. libcrypto.pc: Makefile
  409. @ ( echo 'prefix=$(INSTALLTOP)'; \
  410. echo 'exec_prefix=$${prefix}'; \
  411. echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
  412. echo 'includedir=$${prefix}/include'; \
  413. echo ''; \
  414. echo 'Name: OpenSSL-libcrypto'; \
  415. echo 'Description: OpenSSL cryptography library'; \
  416. echo 'Version: '$(VERSION); \
  417. echo 'Requires: '; \
  418. echo 'Libs: -L$${libdir} -lcrypto $(EX_LIBS)'; \
  419. echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libcrypto.pc
  420. libssl.pc: Makefile
  421. @ ( echo 'prefix=$(INSTALLTOP)'; \
  422. echo 'exec_prefix=$${prefix}'; \
  423. echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
  424. echo 'includedir=$${prefix}/include'; \
  425. echo ''; \
  426. echo 'Name: OpenSSL'; \
  427. echo 'Description: Secure Sockets Layer and cryptography libraries'; \
  428. echo 'Version: '$(VERSION); \
  429. echo 'Requires: '; \
  430. echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
  431. echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > libssl.pc
  432. openssl.pc: Makefile
  433. @ ( echo 'prefix=$(INSTALLTOP)'; \
  434. echo 'exec_prefix=$${prefix}'; \
  435. echo 'libdir=$${exec_prefix}/$(LIBDIR)'; \
  436. echo 'includedir=$${prefix}/include'; \
  437. echo ''; \
  438. echo 'Name: OpenSSL'; \
  439. echo 'Description: Secure Sockets Layer and cryptography libraries and tools'; \
  440. echo 'Version: '$(VERSION); \
  441. echo 'Requires: '; \
  442. echo 'Libs: -L$${libdir} -lssl -lcrypto $(EX_LIBS)'; \
  443. echo 'Cflags: -I$${includedir} $(KRB5_INCLUDES)' ) > openssl.pc
  444. Makefile: Makefile.fips Configure config
  445. @echo "Makefile is older than Makefile.org, Configure or config."
  446. @echo "Reconfigure the source tree (via './config' or 'perl Configure'), please."
  447. @false
  448. libclean:
  449. rm -f *.map *.so *.so.* *.dll engines/*.so engines/*.dll *.a engines/*.a */lib */*/lib
  450. clean: libclean
  451. rm -f shlib/*.o *.o core a.out fluff testlog make.log cctest cctest.c
  452. @set -e; target=clean; $(RECURSIVE_BUILD_CMD)
  453. rm -f $(LIBS)
  454. rm -f openssl.pc libssl.pc libcrypto.pc
  455. rm -f speed.* .pure
  456. rm -f $(TARFILE)
  457. @set -e; for i in $(ONEDIRS) ;\
  458. do \
  459. rm -fr $$i/*; \
  460. done
  461. makefile.one: files
  462. $(PERL) util/mk1mf.pl >makefile.one; \
  463. sh util/do_ms.sh
  464. files:
  465. $(PERL) $(TOP)/util/files.pl Makefile > $(TOP)/MINFO
  466. @set -e; target=files; $(RECURSIVE_BUILD_CMD)
  467. links:
  468. @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
  469. @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
  470. @set -e; dir=fips target=links; $(RECURSIVE_BUILD_CMD)
  471. @(cd crypto ; SDIRS='$(LINKDIRS)' $(MAKE) -e links)
  472. gentests:
  473. @(cd test && echo "generating dummy tests (if needed)..." && \
  474. $(CLEARENV) && $(MAKE) -e $(BUILDENV) TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on generate );
  475. dclean:
  476. rm -rf *.bak include/openssl certs/.0
  477. @set -e; target=dclean; $(RECURSIVE_BUILD_CMD)
  478. test: tests
  479. tests:
  480. @(cd test && echo "testing..." && \
  481. $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. TESTS='$(TESTS)' OPENSSL_DEBUG_MEMORY=on OPENSSL_CONF=../apps/openssl.cnf tests );
  482. OPENSSL_CONF=apps/openssl.cnf util/opensslwrap.sh version -a
  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.