Makefile 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221
  1. #
  2. # OpenSSL/crypto/Makefile
  3. #
  4. DIR= crypto
  5. TOP= ..
  6. CC= cc
  7. INCLUDE= -I. -I$(TOP) -I../include $(ZLIB_INCLUDE)
  8. # INCLUDES targets sudbirs!
  9. INCLUDES= -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include $(ZLIB_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. CPUID_OBJ=mem_clr.o
  26. LIBS=
  27. GENERAL=Makefile README crypto-lib.com install.com
  28. TEST=constant_time_test.c
  29. LIB= $(TOP)/libcrypto.a
  30. SHARED_LIB= libcrypto$(SHLIB_EXT)
  31. LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
  32. ebcdic.c uid.c o_time.c o_str.c o_dir.c o_fips.c o_init.c fips_ers.c
  33. LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o \
  34. uid.o o_time.o o_str.o o_dir.o o_fips.o o_init.o fips_ers.o $(CPUID_OBJ)
  35. SRC= $(LIBSRC)
  36. EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
  37. ossl_typ.h
  38. HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h \
  39. constant_time_locl.h $(EXHEADER)
  40. ALL= $(GENERAL) $(SRC) $(HEADER)
  41. top:
  42. @(cd ..; $(MAKE) DIRS=$(DIR) all)
  43. all: shared
  44. buildinf.h: ../Makefile
  45. $(PERL) $(TOP)/util/mkbuildinf.pl "$(CC) $(CFLAGS)" "$(PLATFORM)" >buildinf.h
  46. x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
  47. $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
  48. applink.o: $(TOP)/ms/applink.c
  49. $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
  50. uplink.o: $(TOP)/ms/uplink.c applink.o
  51. $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
  52. uplink-x86.s: $(TOP)/ms/uplink-x86.pl
  53. $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
  54. x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
  55. ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@
  56. ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
  57. pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
  58. alphacpuid.s: alphacpuid.pl
  59. (preproc=$$$$.$@.S; trap "rm $$preproc" INT; \
  60. $(PERL) alphacpuid.pl > $$preproc && \
  61. $(CC) -E -P $$preproc > $@ && rm $$preproc)
  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 "CPUID_OBJ=$(CPUID_OBJ)" 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: $(LIB): are splitted to avoid end-less loop
  78. lib: $(LIB)
  79. @touch lib
  80. $(LIB): $(LIBOBJ)
  81. $(AR) $(LIB) $(LIBOBJ)
  82. test -z "$(FIPSLIBDIR)" || $(AR) $(LIB) $(FIPSLIBDIR)fipscanister.o
  83. $(RANLIB) $(LIB) || echo Never mind.
  84. shared: buildinf.h lib subdirs
  85. if [ -n "$(SHARED_LIBS)" ]; then \
  86. (cd ..; $(MAKE) $(SHARED_LIB)); \
  87. fi
  88. libs:
  89. @target=lib; $(RECURSIVE_MAKE)
  90. install:
  91. @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
  92. @headerlist="$(EXHEADER)"; for i in $$headerlist ;\
  93. do \
  94. (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
  95. chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
  96. done;
  97. @target=install; $(RECURSIVE_MAKE)
  98. lint:
  99. @target=lint; $(RECURSIVE_MAKE)
  100. update: local_depend
  101. @[ -z "$(THIS)" ] || (set -e; target=update; $(RECURSIVE_MAKE) )
  102. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  103. depend: local_depend
  104. @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
  105. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  106. local_depend:
  107. @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
  108. @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
  109. @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
  110. clean:
  111. rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
  112. @target=clean; $(RECURSIVE_MAKE)
  113. dclean:
  114. $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
  115. mv -f Makefile.new $(MAKEFILE)
  116. rm -f opensslconf.h
  117. @target=dclean; $(RECURSIVE_MAKE)
  118. # DO NOT DELETE THIS LINE -- make depend depends on it.
  119. cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
  120. cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  121. cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
  122. cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  123. cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  124. cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
  125. cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  126. cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  127. cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
  128. cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  129. cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  130. cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
  131. cryptlib.o: cryptlib.h
  132. cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  133. cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  134. cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
  135. cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  136. cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  137. cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
  138. cversion.o: cryptlib.h cversion.c
  139. ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
  140. ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  141. ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  142. ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
  143. ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  144. ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  145. ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  146. ex_data.o: ex_data.c
  147. fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c
  148. mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  149. mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  150. mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
  151. mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  152. mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  153. mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  154. mem.o: mem.c
  155. mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  156. mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  157. mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  158. mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
  159. mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  160. mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  161. mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
  162. mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  163. mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  164. mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  165. mem_dbg.o: mem_dbg.c
  166. o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  167. o_dir.o: LPdir_unix.c o_dir.c o_dir.h
  168. o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  169. o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  170. o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h
  171. o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  172. o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  173. o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  174. o_fips.o: o_fips.c
  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. uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  186. uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  187. uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  188. uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c