2
0

Makefile 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  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. LIB= $(TOP)/libcrypto.a
  29. SHARED_LIB= libcrypto$(SHLIB_EXT)
  30. LIBSRC= cryptlib.c mem.c mem_clr.c mem_dbg.c cversion.c ex_data.c cpt_err.c \
  31. ebcdic.c uid.c o_time.c o_str.c o_dir.c thr_id.c lock.c fips_ers.c \
  32. o_init.c o_fips.c
  33. LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o \
  34. ebcdic.o uid.o o_time.o o_str.o o_dir.o thr_id.o lock.o fips_ers.o \
  35. o_init.o o_fips.o $(CPUID_OBJ)
  36. SRC= $(LIBSRC)
  37. EXHEADER= crypto.h opensslv.h opensslconf.h ebcdic.h symhacks.h \
  38. ossl_typ.h
  39. HEADER= cryptlib.h buildinf.h md32_common.h o_time.h o_str.h o_dir.h $(EXHEADER)
  40. ALL= $(GENERAL) $(SRC) $(HEADER)
  41. top:
  42. @(cd ..; $(MAKE) DIRS=$(DIR) all)
  43. all: shared
  44. fips: cryptlib.o thr_id.o uid.o $(CPUID_OBJ)
  45. [ -n "$(SDIRS)" ] && for i in $(SDIRS) ; do \
  46. ( obj=`$(PERL) $(TOP)/util/fipsobj.pl $$i` && \
  47. cd $$i && echo "making fips in $(DIR)/$$i..." && \
  48. $(MAKE) -e TOP=../.. DIR=$$i INCLUDES='$(INCLUDES)' $$obj ) || exit 1; \
  49. done;
  50. buildinf.h: ../Makefile
  51. ( echo "#ifndef MK1MF_BUILD"; \
  52. echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
  53. echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \
  54. echo ' #define PLATFORM "$(PLATFORM)"'; \
  55. echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
  56. echo '#endif' ) >buildinf.h
  57. x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
  58. $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
  59. applink.o: $(TOP)/ms/applink.c
  60. $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
  61. uplink.o: $(TOP)/ms/uplink.c applink.o
  62. $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
  63. uplink-x86.s: $(TOP)/ms/uplink-x86.pl
  64. $(PERL) $(TOP)/ms/uplink-x86.pl $(PERLASM_SCHEME) > $@
  65. x86_64cpuid.s: x86_64cpuid.pl; $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
  66. ia64cpuid.s: ia64cpuid.S; $(CC) $(CFLAGS) -E ia64cpuid.S > $@
  67. ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
  68. pariscid.s: pariscid.pl; $(PERL) pariscid.pl $(PERLASM_SCHEME) $@
  69. alphacpuid.s: alphacpuid.pl
  70. $(PERL) $< | $(CC) -E - | tee $@ > /dev/null
  71. o_init.o: o_init.c
  72. case "`(uname -s) 2>/dev/null`" in \
  73. OSF1|IRIX*) _WL_INIT="-Wl,-init,OPENSSL_init" ;; \
  74. HP-UX) _WL_INIT="-Wl,+init,OPENSSL_init" ;; \
  75. AIX) _WL_INIT="-Wl,-binitfini:OPENSSL_init,-bnoobjreorder";; \
  76. Darwin) ( while [ "x$1" != "x" -a "x$1" != "x-dynamiclib" ]; do shift; done; \
  77. [ $# -ge 1 ] \
  78. ) && _WL_INIT="-Wl,-init,_OPENSSL_init" ;; \
  79. esac ; \
  80. $(CC) $(CFLAGS) $(_WL_INIT) -c -o $@ $<
  81. testapps:
  82. [ -z "$(THIS)" ] || ( if expr " $(SDIRS) " : ".* des " >/dev/null; \
  83. then cd des && $(MAKE) -e des; fi )
  84. [ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) -e testapps );
  85. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  86. subdirs:
  87. @target=all; $(RECURSIVE_MAKE)
  88. files:
  89. $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
  90. @target=files; $(RECURSIVE_MAKE)
  91. links:
  92. @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
  93. @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
  94. @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
  95. @target=links; $(RECURSIVE_MAKE)
  96. # lib: $(LIB): are splitted to avoid end-less loop
  97. lib: $(LIB)
  98. @touch lib
  99. $(LIB): $(LIBOBJ)
  100. $(ARX) $(LIB) $(LIBOBJ)
  101. $(RANLIB) $(LIB) || echo Never mind.
  102. shared: buildinf.h lib subdirs
  103. if [ -n "$(SHARED_LIBS)" ]; then \
  104. (cd ..; $(MAKE) $(SHARED_LIB)); \
  105. fi
  106. libs:
  107. @target=lib; $(RECURSIVE_MAKE)
  108. install:
  109. @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
  110. @headerlist="$(EXHEADER)"; for i in $$headerlist ;\
  111. do \
  112. (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
  113. chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
  114. done;
  115. @target=install; $(RECURSIVE_MAKE)
  116. lint:
  117. @target=lint; $(RECURSIVE_MAKE)
  118. depend:
  119. @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
  120. @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
  121. @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
  122. @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
  123. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  124. clean:
  125. rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
  126. @target=clean; $(RECURSIVE_MAKE)
  127. dclean:
  128. $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
  129. mv -f Makefile.new $(MAKEFILE)
  130. rm -f opensslconf.h
  131. @target=dclean; $(RECURSIVE_MAKE)
  132. # DO NOT DELETE THIS LINE -- make depend depends on it.
  133. cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
  134. cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  135. cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
  136. cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  137. cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  138. cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
  139. cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  140. cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  141. cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
  142. cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  143. cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  144. cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
  145. cryptlib.o: cryptlib.h
  146. cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  147. cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  148. cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
  149. cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  150. cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  151. cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
  152. cversion.o: cryptlib.h cversion.c
  153. ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
  154. ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  155. ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  156. ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
  157. ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  158. ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  159. ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  160. ex_data.o: ex_data.c
  161. fips_ers.o: ../include/openssl/opensslconf.h fips_ers.c
  162. lock.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  163. lock.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  164. lock.o: ../include/openssl/err.h ../include/openssl/lhash.h
  165. lock.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  166. lock.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  167. lock.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  168. lock.o: lock.c
  169. mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  170. mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  171. mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
  172. mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  173. mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  174. mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  175. mem.o: mem.c
  176. mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  177. mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  178. mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  179. mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
  180. mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  181. mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  182. mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
  183. mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  184. mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  185. mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  186. mem_dbg.o: mem_dbg.c
  187. o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  188. o_dir.o: LPdir_unix.c o_dir.c o_dir.h
  189. o_fips.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  190. o_fips.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  191. o_fips.o: ../include/openssl/err.h ../include/openssl/lhash.h
  192. o_fips.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  193. o_fips.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  194. o_fips.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  195. o_fips.o: o_fips.c
  196. o_init.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/crypto.h
  197. o_init.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  198. o_init.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
  199. o_init.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  200. o_init.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  201. o_init.o: ../include/openssl/symhacks.h o_init.c
  202. o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  203. o_str.o: o_str.c o_str.h
  204. o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
  205. o_time.o: o_time.h
  206. thr_id.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  207. thr_id.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  208. thr_id.o: ../include/openssl/err.h ../include/openssl/lhash.h
  209. thr_id.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  210. thr_id.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  211. thr_id.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  212. thr_id.o: thr_id.c
  213. uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  214. uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  215. uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  216. uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c