Makefile 9.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226
  1. #
  2. # OpenSSL/crypto/Makefile
  3. #
  4. DIR= crypto
  5. TOP= ..
  6. CC= cc
  7. INCLUDE= -I. -I$(TOP) -I../include
  8. # INCLUDES targets sudbirs!
  9. INCLUDES= -I.. -I../.. -I../../include
  10. CFLAG= -g
  11. MAKEDEPPROG= makedepend
  12. MAKEDEPEND= $(TOP)/util/domd $(TOP) -MD $(MAKEDEPPROG)
  13. MAKEFILE= Makefile
  14. RM= rm -f
  15. AR= ar r
  16. RECURSIVE_MAKE= [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
  17. (cd $$i && echo "making $$target in $(DIR)/$$i..." && \
  18. $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='${INCLUDES}' $$target ) || exit 1; \
  19. done;
  20. PEX_LIBS=
  21. EX_LIBS=
  22. CFLAGS= $(INCLUDE) $(CFLAG)
  23. ASFLAGS= $(INCLUDE) $(ASFLAG)
  24. AFLAGS=$(ASFLAGS)
  25. LIBS=
  26. GENERAL=Makefile README crypto-lib.com install.com
  27. TEST=constant_time_test.c
  28. LIB= $(TOP)/libcrypto.a
  29. SHARED_LIB= libcrypto$(SHLIB_EXT)
  30. LIBSRC= cryptlib.c dyn_lck.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c tmdiff.c cpt_err.c ebcdic.c uid.c o_time.c o_str.c o_dir.c o_init.c fips_err.c
  31. LIBOBJ= cryptlib.o dyn_lck.o mem.o mem_clr.o mem_dbg.o cversion.o ex_data.o tmdiff.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o o_init.o fips_err.o $(CPUID_OBJ)
  32. SRC= $(LIBSRC)
  33. EXHEADER= crypto.h tmdiff.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
  34. ossl_typ.h
  35. HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \
  36. constant_time_locl.h $(EXHEADER)
  37. ALL= $(GENERAL) $(SRC) $(HEADER)
  38. top:
  39. @(cd ..; $(MAKE) DIRS=$(DIR) all)
  40. all: lib
  41. buildinf.h: ../Makefile
  42. ( echo "#ifndef MK1MF_BUILD"; \
  43. echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
  44. echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \
  45. echo ' #define PLATFORM "$(PLATFORM)"'; \
  46. echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
  47. echo '#endif' ) >buildinf.h
  48. x86cpuid-elf.s: x86cpuid.pl perlasm/x86asm.pl
  49. $(PERL) x86cpuid.pl elf $(CFLAGS) $(PROCESSOR) > $@
  50. x86cpuid-cof.s: x86cpuid.pl perlasm/x86asm.pl
  51. $(PERL) x86cpuid.pl coff $(CFLAGS) $(PROCESSOR) > $@
  52. x86cpuid-out.s: x86cpuid.pl perlasm/x86asm.pl
  53. $(PERL) x86cpuid.pl a.out $(CFLAGS) $(PROCESSOR) > $@
  54. uplink.o: ../ms/uplink.c
  55. $(CC) $(CFLAGS) -c -o $@ ../ms/uplink.c
  56. uplink-cof.s: ../ms/uplink.pl
  57. $(PERL) ../ms/uplink.pl coff > $@
  58. x86_64cpuid.s: x86_64cpuid.pl
  59. $(PERL) x86_64cpuid.pl $@
  60. ia64cpuid.s: ia64cpuid.S
  61. $(CC) $(CFLAGS) -E ia64cpuid.S > $@
  62. testapps:
  63. [ -z "$(THIS)" ] || ( if echo ${SDIRS} | fgrep ' des '; \
  64. then cd des && $(MAKE) -e des; fi )
  65. [ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) -e testapps );
  66. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  67. subdirs:
  68. @target=all; $(RECURSIVE_MAKE)
  69. files:
  70. $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
  71. @target=files; $(RECURSIVE_MAKE)
  72. links:
  73. @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
  74. @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
  75. @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
  76. @target=links; $(RECURSIVE_MAKE)
  77. # lib: and $(LIB): are splitted to avoid end-less loop
  78. lib: buildinf.h $(LIB) subdirs
  79. @touch lib
  80. $(LIB): $(LIBOBJ)
  81. $(ARX) $(LIB) $(LIBOBJ)
  82. $(RANLIB) $(LIB) || echo Never mind.
  83. shared: buildinf.h lib subdirs
  84. if [ -n "$(SHARED_LIBS)" ]; then \
  85. (cd ..; $(MAKE) $(SHARED_LIB)); \
  86. fi
  87. libs:
  88. @target=lib; $(RECURSIVE_MAKE)
  89. install:
  90. @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
  91. @headerlist="$(EXHEADER)"; for i in $$headerlist ;\
  92. do \
  93. (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
  94. chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
  95. done;
  96. @target=install; $(RECURSIVE_MAKE)
  97. lint:
  98. @target=lint; $(RECURSIVE_MAKE)
  99. depend:
  100. @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
  101. @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
  102. @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
  103. @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
  104. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  105. clean:
  106. rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
  107. @target=clean; $(RECURSIVE_MAKE)
  108. dclean:
  109. $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
  110. mv -f Makefile.new $(MAKEFILE)
  111. @target=dclean; $(RECURSIVE_MAKE)
  112. # DO NOT DELETE THIS LINE -- make depend depends on it.
  113. cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
  114. cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  115. cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
  116. cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  117. cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  118. cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
  119. cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  120. cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  121. cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
  122. cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  123. cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  124. cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
  125. cryptlib.o: cryptlib.h
  126. cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  127. cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  128. cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
  129. cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  130. cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  131. cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
  132. cversion.o: cryptlib.h cversion.c
  133. dyn_lck.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  134. dyn_lck.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  135. dyn_lck.o: ../include/openssl/err.h ../include/openssl/lhash.h
  136. dyn_lck.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  137. dyn_lck.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  138. dyn_lck.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  139. dyn_lck.o: dyn_lck.c
  140. ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
  141. ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  142. ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  143. ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
  144. ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  145. ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  146. ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  147. ex_data.o: ex_data.c
  148. fips_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
  149. fips_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  150. fips_err.o: ../include/openssl/fips.h ../include/openssl/lhash.h
  151. fips_err.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  152. fips_err.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  153. fips_err.o: ../include/openssl/stack.h ../include/openssl/symhacks.h fips_err.c
  154. fips_err.o: fips_err.h
  155. mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  156. mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  157. mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
  158. mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  159. mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  160. mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  161. mem.o: mem.c
  162. mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  163. mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  164. mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  165. mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
  166. mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  167. mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  168. mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
  169. mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  170. mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  171. mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  172. mem_dbg.o: mem_dbg.c
  173. o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  174. o_dir.o: LPdir_unix.c o_dir.c o_dir.h
  175. o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
  176. o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  177. o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
  178. o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  179. o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  180. o_init.o: ../include/openssl/symhacks.h o_init.c
  181. o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  182. o_str.o: o_str.c o_str.h
  183. o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
  184. o_time.o: o_time.h
  185. tmdiff.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  186. tmdiff.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  187. tmdiff.o: ../include/openssl/err.h ../include/openssl/lhash.h
  188. tmdiff.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  189. tmdiff.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  190. tmdiff.o: ../include/openssl/stack.h ../include/openssl/symhacks.h
  191. tmdiff.o: ../include/openssl/tmdiff.h cryptlib.h tmdiff.c
  192. uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  193. uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  194. uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  195. uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c