Makefile 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  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../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 ebcdic.c uid.c o_time.c o_str.c o_dir.c
  31. LIBOBJ= cryptlib.o mem.o mem_dbg.o cversion.o ex_data.o cpt_err.o ebcdic.o uid.o o_time.o o_str.o o_dir.o $(CPUID_OBJ)
  32. SRC= $(LIBSRC)
  33. EXHEADER= crypto.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 $(EXHEADER)
  36. ALL= $(GENERAL) $(SRC) $(HEADER)
  37. top:
  38. @(cd ..; $(MAKE) DIRS=$(DIR) all)
  39. all: shared
  40. buildinf.h: ../Makefile
  41. ( echo "#ifndef MK1MF_BUILD"; \
  42. echo ' /* auto-generated by crypto/Makefile for crypto/cversion.c */'; \
  43. echo ' #define CFLAGS "$(CC) $(CFLAG)"'; \
  44. echo ' #define PLATFORM "$(PLATFORM)"'; \
  45. echo " #define DATE \"`LC_ALL=C LC_TIME=C date`\""; \
  46. echo '#endif' ) >buildinf.h
  47. x86cpuid.s: x86cpuid.pl perlasm/x86asm.pl
  48. $(PERL) x86cpuid.pl $(PERLASM_SCHEME) $(CFLAGS) $(PROCESSOR) > $@
  49. applink.o: $(TOP)/ms/applink.c
  50. $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/applink.c
  51. uplink.o: $(TOP)/ms/uplink.c applink.o
  52. $(CC) $(CFLAGS) -c -o $@ $(TOP)/ms/uplink.c
  53. uplink-cof.s: $(TOP)/ms/uplink.pl
  54. $(PERL) $(TOP)/ms/uplink.pl coff > $@
  55. x86_64cpuid.s: x86_64cpuid.pl
  56. $(PERL) x86_64cpuid.pl $(PERLASM_SCHEME) > $@
  57. ia64cpuid.s: ia64cpuid.S
  58. $(CC) $(CFLAGS) -E ia64cpuid.S > $@
  59. ppccpuid.s: ppccpuid.pl; $(PERL) ppccpuid.pl $(PERLASM_SCHEME) $@
  60. testapps:
  61. [ -z "$(THIS)" ] || ( if echo $(SDIRS) | fgrep ' des '; \
  62. then cd des && $(MAKE) -e des; fi )
  63. [ -z "$(THIS)" ] || ( cd pkcs7 && $(MAKE) -e testapps );
  64. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  65. subdirs:
  66. @target=all; $(RECURSIVE_MAKE)
  67. files:
  68. $(PERL) $(TOP)/util/files.pl Makefile >> $(TOP)/MINFO
  69. @target=files; $(RECURSIVE_MAKE)
  70. links:
  71. @$(PERL) $(TOP)/util/mklink.pl ../include/openssl $(EXHEADER)
  72. @$(PERL) $(TOP)/util/mklink.pl ../test $(TEST)
  73. @$(PERL) $(TOP)/util/mklink.pl ../apps $(APPS)
  74. @target=links; $(RECURSIVE_MAKE)
  75. # lib: $(LIB): are splitted to avoid end-less loop
  76. lib: $(LIB)
  77. @touch lib
  78. $(LIB): $(LIBOBJ)
  79. $(AR) $(LIB) $(LIBOBJ)
  80. $(RANLIB) $(LIB) || echo Never mind.
  81. shared: buildinf.h lib subdirs
  82. if [ -n "$(SHARED_LIBS)" ]; then \
  83. (cd ..; $(MAKE) $(SHARED_LIB)); \
  84. fi
  85. libs:
  86. @target=lib; $(RECURSIVE_MAKE)
  87. install:
  88. @[ -n "$(INSTALLTOP)" ] # should be set by top Makefile...
  89. @headerlist="$(EXHEADER)"; for i in $$headerlist ;\
  90. do \
  91. (cp $$i $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i; \
  92. chmod 644 $(INSTALL_PREFIX)$(INSTALLTOP)/include/openssl/$$i ); \
  93. done;
  94. @target=install; $(RECURSIVE_MAKE)
  95. lint:
  96. @target=lint; $(RECURSIVE_MAKE)
  97. depend:
  98. @[ -z "$(THIS)" -o -f buildinf.h ] || touch buildinf.h # fake buildinf.h if it does not exist
  99. @[ -z "$(THIS)" ] || $(MAKEDEPEND) -- $(CFLAG) $(INCLUDE) $(DEPFLAG) -- $(PROGS) $(LIBSRC)
  100. @[ -z "$(THIS)" -o -s buildinf.h ] || rm buildinf.h
  101. @[ -z "$(THIS)" ] || (set -e; target=depend; $(RECURSIVE_MAKE) )
  102. @if [ -z "$(THIS)" ]; then $(MAKE) -f $(TOP)/Makefile reflect THIS=$@; fi
  103. clean:
  104. rm -f buildinf.h *.s *.o */*.o *.obj lib tags core .pure .nfs* *.old *.bak fluff
  105. @target=clean; $(RECURSIVE_MAKE)
  106. dclean:
  107. $(PERL) -pe 'if (/^# DO NOT DELETE THIS LINE/) {print; exit(0);}' $(MAKEFILE) >Makefile.new
  108. mv -f Makefile.new $(MAKEFILE)
  109. rm -f opensslconf.h
  110. @target=dclean; $(RECURSIVE_MAKE)
  111. # DO NOT DELETE THIS LINE -- make depend depends on it.
  112. cpt_err.o: ../include/openssl/bio.h ../include/openssl/crypto.h
  113. cpt_err.o: ../include/openssl/e_os2.h ../include/openssl/err.h
  114. cpt_err.o: ../include/openssl/lhash.h ../include/openssl/opensslconf.h
  115. cpt_err.o: ../include/openssl/opensslv.h ../include/openssl/ossl_typ.h
  116. cpt_err.o: ../include/openssl/safestack.h ../include/openssl/stack.h
  117. cpt_err.o: ../include/openssl/symhacks.h cpt_err.c
  118. cryptlib.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  119. cryptlib.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  120. cryptlib.o: ../include/openssl/err.h ../include/openssl/lhash.h
  121. cryptlib.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  122. cryptlib.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  123. cryptlib.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.c
  124. cryptlib.o: cryptlib.h
  125. cversion.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  126. cversion.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  127. cversion.o: ../include/openssl/err.h ../include/openssl/lhash.h
  128. cversion.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  129. cversion.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  130. cversion.o: ../include/openssl/stack.h ../include/openssl/symhacks.h buildinf.h
  131. cversion.o: cryptlib.h cversion.c
  132. ebcdic.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h ebcdic.c
  133. ex_data.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  134. ex_data.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  135. ex_data.o: ../include/openssl/err.h ../include/openssl/lhash.h
  136. ex_data.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  137. ex_data.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  138. ex_data.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  139. ex_data.o: ex_data.c
  140. mem.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  141. mem.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  142. mem.o: ../include/openssl/err.h ../include/openssl/lhash.h
  143. mem.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  144. mem.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  145. mem.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  146. mem.o: mem.c
  147. mem_clr.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  148. mem_clr.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  149. mem_clr.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  150. mem_clr.o: ../include/openssl/stack.h ../include/openssl/symhacks.h mem_clr.c
  151. mem_dbg.o: ../e_os.h ../include/openssl/bio.h ../include/openssl/buffer.h
  152. mem_dbg.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  153. mem_dbg.o: ../include/openssl/err.h ../include/openssl/lhash.h
  154. mem_dbg.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  155. mem_dbg.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  156. mem_dbg.o: ../include/openssl/stack.h ../include/openssl/symhacks.h cryptlib.h
  157. mem_dbg.o: mem_dbg.c
  158. o_dir.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  159. o_dir.o: LPdir_unix.c o_dir.c o_dir.h
  160. o_str.o: ../e_os.h ../include/openssl/e_os2.h ../include/openssl/opensslconf.h
  161. o_str.o: o_str.c o_str.h
  162. o_time.o: ../include/openssl/e_os2.h ../include/openssl/opensslconf.h o_time.c
  163. o_time.o: o_time.h
  164. uid.o: ../include/openssl/crypto.h ../include/openssl/e_os2.h
  165. uid.o: ../include/openssl/opensslconf.h ../include/openssl/opensslv.h
  166. uid.o: ../include/openssl/ossl_typ.h ../include/openssl/safestack.h
  167. uid.o: ../include/openssl/stack.h ../include/openssl/symhacks.h uid.c