libcurl.framework.make 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. # to build Mac OS X framework call the following line with the directory set
  2. # properly to lib:
  3. # make build -e -f libcurl.framework.make
  4. TMP_DIR = ../lib/.lib
  5. LIB_DIR = ../lib
  6. # Sets the SDK. 10.4u.sdk is the minimum for building a Universal Binary.
  7. SDK = /Developer/SDKs/MacOSX10.4u.sdk
  8. # Sets the minimum OSX version where the framework will work.
  9. ENVP = MACOSX_DEPLOYMENT_TARGET=10.3
  10. # for debug symbols add the -g option. Remove the -O2 option for best debuggin.
  11. # Can be compiled with -O3 optimizations.
  12. C_OPTIONS = -isysroot $(SDK) \
  13. -fno-common \
  14. -Os \
  15. -DHAVE_CONFIG_H \
  16. -DPIC \
  17. -I../lib \
  18. -I../include \
  19. -Wall \
  20. -arch ppc \
  21. -arch i386
  22. LIBRARIES = $(SDK)/usr/lib/libssl.dylib \
  23. $(SDK)/usr/lib/libcrypto.dylib \
  24. -lz
  25. # These libtool options are needed for a framework.
  26. # @executable_path tells the application that links to this library where to find it.
  27. # On Mac OS X frameworks are usually iniside the application bundle in a frameworks folder.
  28. # Define a seg1addr so prebinding does not overlap with other frameworks or bundles.
  29. # For prebinding 0x10400000 was chosen a bit at random.
  30. # If this overlaps one of you current libs just change in the makefile.
  31. # This address is safe for all built in frameworks.
  32. LINK_OPTIONS = \
  33. -Wl,-syslibroot,$(SDK) \
  34. -arch ppc \
  35. -arch i386 \
  36. -prebind \
  37. -seg1addr 0x10400000 \
  38. -dynamiclib \
  39. -install_name @executable_path/../Frameworks/libcurl.framework/libcurl
  40. # This is the file list. It is not dynamically generated so this must be updated if new files are added to the build.
  41. OBJECTS = $(TMP_DIR)/base64.o \
  42. $(TMP_DIR)/connect.o \
  43. $(TMP_DIR)/content_encoding.o \
  44. $(TMP_DIR)/cookie.o \
  45. $(TMP_DIR)/dict.o \
  46. $(TMP_DIR)/easy.o \
  47. $(TMP_DIR)/escape.o \
  48. $(TMP_DIR)/file.o \
  49. $(TMP_DIR)/formdata.o \
  50. $(TMP_DIR)/ftp.o \
  51. $(TMP_DIR)/getenv.o \
  52. $(TMP_DIR)/getinfo.o \
  53. $(TMP_DIR)/gtls.o \
  54. $(TMP_DIR)/hash.o \
  55. $(TMP_DIR)/hostares.o \
  56. $(TMP_DIR)/hostasyn.o \
  57. $(TMP_DIR)/hostip.o \
  58. $(TMP_DIR)/hostip4.o \
  59. $(TMP_DIR)/hostip6.o \
  60. $(TMP_DIR)/hostsyn.o \
  61. $(TMP_DIR)/hostthre.o \
  62. $(TMP_DIR)/http.o \
  63. $(TMP_DIR)/http_chunks.o \
  64. $(TMP_DIR)/http_digest.o \
  65. $(TMP_DIR)/http_negotiate.o \
  66. $(TMP_DIR)/http_ntlm.o \
  67. $(TMP_DIR)/if2ip.o \
  68. $(TMP_DIR)/inet_ntop.o \
  69. $(TMP_DIR)/inet_pton.o \
  70. $(TMP_DIR)/krb4.o \
  71. $(TMP_DIR)/ldap.o \
  72. $(TMP_DIR)/llist.o \
  73. $(TMP_DIR)/md5.o \
  74. $(TMP_DIR)/memdebug.o \
  75. $(TMP_DIR)/mprintf.o \
  76. $(TMP_DIR)/multi.o \
  77. $(TMP_DIR)/netrc.o \
  78. $(TMP_DIR)/parsedate.o \
  79. $(TMP_DIR)/progress.o \
  80. $(TMP_DIR)/security.o \
  81. $(TMP_DIR)/select.o \
  82. $(TMP_DIR)/sendf.o \
  83. $(TMP_DIR)/share.o \
  84. $(TMP_DIR)/speedcheck.o \
  85. $(TMP_DIR)/sslgen.o \
  86. $(TMP_DIR)/ssluse.o \
  87. $(TMP_DIR)/strequal.o \
  88. $(TMP_DIR)/strerror.o \
  89. $(TMP_DIR)/strtok.o \
  90. $(TMP_DIR)/strtoofft.o \
  91. $(TMP_DIR)/telnet.o \
  92. $(TMP_DIR)/tftp.o \
  93. $(TMP_DIR)/timeval.o \
  94. $(TMP_DIR)/transfer.o \
  95. $(TMP_DIR)/url.o \
  96. $(TMP_DIR)/version.o \
  97. $(TMP_DIR)/splay.o \
  98. $(TMP_DIR)/socks.o
  99. build: $(TMP_DIR) $(LIB_DIR) $(LIB_DIR)/libcurl.framework
  100. $(TMP_DIR) :
  101. mkdir -p $(TMP_DIR)
  102. $(LIB_DIR) :
  103. mkdir -p $(LIB_DIR)
  104. # This builds the framework structure and links everything properly
  105. $(LIB_DIR)/libcurl.framework: $(OBJECTS) $(LIB_DIR)/libcurl.plist
  106. mkdir -p $(LIB_DIR)/libcurl.framework/Versions/A/Resources
  107. $(ENVP) $(CC) $(LINK_OPTIONS) $(LIBRARIES) $(OBJECTS) \
  108. -o $(LIB_DIR)/libcurl.framework/Versions/A/libcurl
  109. cp $(LIB_DIR)/libcurl.plist $(LIB_DIR)/libcurl.framework/Versions/A/Resources/Info.plist
  110. mkdir -p $(LIB_DIR)/libcurl.framework/Versions/A/Headers
  111. cp $(LIB_DIR)/../include/curl/*.h $(LIB_DIR)/libcurl.framework/Versions/A/Headers
  112. cd $(LIB_DIR)/libcurl.framework; \
  113. ln -fs Versions/A/libcurl libcurl; \
  114. ln -fs Versions/A/Resources Resources; \
  115. ln -fs Versions/A/Headers Headers
  116. cd $(LIB_DIR)/libcurl.framework/Versions; \
  117. ln -fs A Current
  118. $(OBJECTS) : $(TMP_DIR)/%.o: $(LIB_DIR)/%.c
  119. $(CC) $(C_OPTIONS) -c $< -o $@
  120. clean:
  121. rm -fr $(LIB_DIR)/libcurl.framework
  122. rm -f $(OBJECTS)