Makefile.netware 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407
  1. #################################################################
  2. #
  3. ## Makefile for building libcurl.nlm (NetWare version - gnu make)
  4. ## Use: make -f Makefile.netware
  5. ##
  6. ## Comments to: Guenter Knauf <eflash@gmx.net>
  7. #
  8. #################################################################
  9. # Edit the path below to point to the base of your Novell NDK.
  10. ifndef NDKBASE
  11. NDKBASE = c:/novell
  12. endif
  13. # Edit the path below to point to the base of your Zlib sources.
  14. ifndef ZLIB_PATH
  15. ZLIB_PATH = ../../zlib-1.2.3
  16. endif
  17. # Edit the path below to point to the base of your OpenSSL package.
  18. ifndef OPENSSL_PATH
  19. OPENSSL_PATH = ../../openssl-0.9.8
  20. endif
  21. ifndef INSTDIR
  22. INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
  23. endif
  24. # Edit the vars below to change NLM target settings.
  25. TARGET = libcurl
  26. VERSION = $(LIBCURL_VERSION)
  27. COPYR = Copyright (C) 1996 - 2005, Daniel Stenberg, <daniel@haxx.se>
  28. DESCR = cURL libcurl $(LIBCURL_VERSION_STR) - http://curl.haxx.se
  29. MTSAFE = YES
  30. STACK = 64000
  31. SCREEN = none
  32. EXPORTS = @libcurl.imp
  33. # Edit the var below to point to your lib architecture.
  34. ifndef LIBARCH
  35. LIBARCH = LIBC
  36. endif
  37. # must be equal to DEBUG or NDEBUG
  38. DB = NDEBUG
  39. # DB = DEBUG
  40. # DB = CURLDEBUG
  41. # Optimization: -O<n> or debugging: -g
  42. ifeq ($(DB),NDEBUG)
  43. OPT = -O2
  44. OBJDIR = release
  45. else
  46. OPT = -g
  47. OBJDIR = debug
  48. endif
  49. # Include the version info retrieved from curlver.h
  50. -include $(OBJDIR)/version.inc
  51. # The following line defines your compiler.
  52. ifdef METROWERKS
  53. CC = mwccnlm
  54. else
  55. CC = gcc
  56. endif
  57. YACC = bison -y
  58. CP = cp -afv
  59. # RM = rm -f
  60. # if you want to mark the target as MTSAFE you will need a tool for
  61. # generating the xdc data for the linker; here's a minimal tool:
  62. # http://www.gknw.com/development/prgtools/mkxdc.zip
  63. MPKXDC = mkxdc
  64. # Global flags for all compilers
  65. CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
  66. ifeq ($(CC),mwccnlm)
  67. LD = mwldnlm
  68. LDFLAGS = -nostdlib $(PRELUDE) $(OBJL) -o $(TARGET).nlm -commandfile
  69. AR = mwldnlm
  70. ARFLAGS = -type library -w nocmdline $(OBJS) -o
  71. CFLAGS += -msgstyle gcc -gccinc -inline off -opt nointrinsics -proc 586
  72. CFLAGS += -relax_pointers
  73. #CFLAGS += -w on
  74. ifeq ($(LIBARCH),LIBC)
  75. PRELUDE = $(SDK_LIBC)/imports/libcpre.o
  76. CFLAGS += -align 4
  77. else
  78. PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
  79. # CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
  80. CFLAGS += -align 1
  81. endif
  82. else
  83. LD = nlmconv
  84. LDFLAGS = -T
  85. AR = ar
  86. ARFLAGS = -cq
  87. CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return -fno-strict-aliasing
  88. CFLAGS += -Wall # -pedantic
  89. ifeq ($(LIBARCH),LIBC)
  90. PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
  91. else
  92. PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
  93. CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
  94. endif
  95. endif
  96. NDK_ROOT = $(NDKBASE)/ndk
  97. SDK_CLIB = $(NDK_ROOT)/nwsdk
  98. SDK_LIBC = $(NDK_ROOT)/libc
  99. SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
  100. INCLUDES = -I. -I../include
  101. ifdef WITH_ARES
  102. INCLUDES += -I../ares
  103. LDLIBS = ../ares/libcares.lib
  104. endif
  105. ifdef WITH_SSL
  106. INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_libc -I$(OPENSSL_PATH)/outinc_nw_libc/openssl
  107. LDLIBS += $(OPENSSL_PATH)/out_nw_libc/crypto.lib $(OPENSSL_PATH)/out_nw_libc/ssl.lib
  108. IMPORTS += GetProcessSwitchCount RunningProcess
  109. endif
  110. ifdef WITH_ZLIB
  111. INCLUDES += -I$(ZLIB_PATH)
  112. ifdef LINK_STATIC
  113. LDLIBS += $(ZLIB_PATH)/nw/libz.lib
  114. else
  115. IMPORTS += @$(ZLIB_PATH)/nw/libz.imp
  116. MODULES += libz.nlm
  117. endif
  118. endif
  119. ifeq ($(LIBARCH),LIBC)
  120. INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
  121. # INCLUDES += -I$(SDK_LIBC)/include/winsock
  122. # INCLUDES += -I$(SDK_LDAP)/libc/inc
  123. CFLAGS += -D_POSIX_SOURCE
  124. # CFLAGS += -D__ANSIC__
  125. else
  126. INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
  127. # INCLUDES += -I$(SDK_CLIB)/include/nlm/obsolete
  128. # INCLUDES += -I$(SDK_LDAP)/clib/inc
  129. CFLAGS += -DNETDB_USE_INTERNET
  130. endif
  131. CFLAGS += $(INCLUDES)
  132. ifeq ($(MTSAFE),YES)
  133. XDCOPT = -n
  134. endif
  135. ifeq ($(MTSAFE),NO)
  136. XDCOPT = -u
  137. endif
  138. ifdef XDCOPT
  139. XDCDATA = $(OBJDIR)/$(TARGET).xdc
  140. endif
  141. ifeq ($(findstring linux,$(OSTYPE)),linux)
  142. DL = '
  143. DS = /
  144. #-include $(NDKBASE)/nlmconv/ncpfs.inc
  145. else
  146. DS = \\
  147. endif
  148. # Makefile.inc provides the CSOURCES and HHEADERS defines
  149. include Makefile.inc
  150. OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CSOURCES))) $(LDLIBS)
  151. OBJL = $(OBJS) $(OBJDIR)/nwlib.o
  152. all: lib nlm
  153. nlm: prebuild $(TARGET).nlm
  154. lib: prebuild $(TARGET).lib
  155. prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h ca-bundle.h
  156. $(OBJDIR)/%.o: %.c
  157. # @echo Compiling $<
  158. $(CC) $(CFLAGS) -c $< -o $@
  159. $(OBJDIR)/version.inc: ../include/curl/curlver.h $(OBJDIR)
  160. @echo Creating $@
  161. @awk -f ../packages/NetWare/get_ver.awk $< > $@
  162. dist: all
  163. -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
  164. -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
  165. install: $(INSTDIR) all
  166. @$(CP) $(TARGET).nlm $(INSTDIR)
  167. @$(CP) $(TARGET).lib $(INSTDIR)
  168. @$(CP) ../CHANGES $(INSTDIR)
  169. @$(CP) ../COPYING $(INSTDIR)
  170. @$(CP) ../README $(INSTDIR)
  171. @$(CP) ../RELEASE-NOTES $(INSTDIR)
  172. ifdef WITH_SSL
  173. @$(CP) ca-bundle.crt $(INSTDIR)
  174. endif
  175. clean:
  176. -$(RM) config.h ca-bundle.h
  177. -$(RM) -r $(OBJDIR)
  178. $(INSTDIR):
  179. @mkdir $(INSTDIR)
  180. $(OBJDIR):
  181. @mkdir $(OBJDIR)
  182. $(TARGET).lib: $(OBJS)
  183. @echo Creating $@
  184. @-$(RM) $@
  185. @$(AR) $(ARFLAGS) $@ $^
  186. $(TARGET).nlm: $(OBJDIR)/$(TARGET).def $(OBJL) $(XDCDATA)
  187. @echo Linking $@
  188. @-$(RM) $@
  189. @$(LD) $(LDFLAGS) $<
  190. $(OBJDIR)/%.xdc: Makefile.netware
  191. @echo Creating $@
  192. @$(MPKXDC) $(XDCOPT) $@
  193. $(OBJDIR)/%.def: Makefile.netware
  194. @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
  195. @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
  196. @echo $(DL)# All your changes will be lost!!$(DL) >> $@
  197. @echo $(DL)#$(DL) >> $@
  198. @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
  199. @echo $(DL)description "$(DESCR)"$(DL) >> $@
  200. @echo $(DL)version $(VERSION)$(DL) >> $@
  201. ifdef NLMTYPE
  202. @echo $(DL)type $(NLMTYPE)$(DL) >> $@
  203. endif
  204. ifdef STACK
  205. @echo $(DL)stack $(STACK)$(DL) >> $@
  206. endif
  207. ifdef SCREEN
  208. @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
  209. else
  210. @echo $(DL)screenname "DEFAULT"$(DL) >> $@
  211. endif
  212. ifeq ($(DB),DEBUG)
  213. @echo $(DL)debug$(DL) >> $@
  214. endif
  215. @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
  216. ifdef XDCDATA
  217. @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
  218. endif
  219. ifeq ($(LIBARCH),CLIB)
  220. @echo $(DL)start _Prelude$(DL) >> $@
  221. @echo $(DL)exit _Stop$(DL) >> $@
  222. @echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@
  223. @echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@
  224. @echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
  225. @echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@
  226. # @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
  227. # @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
  228. # @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
  229. @echo $(DL)module clib$(DL) >> $@
  230. else
  231. @echo $(DL)flag_on 64$(DL) >> $@
  232. @echo $(DL)pseudopreemption$(DL) >> $@
  233. @echo $(DL)start _LibCPrelude$(DL) >> $@
  234. @echo $(DL)exit _LibCPostlude$(DL) >> $@
  235. @echo $(DL)check _LibCCheckUnload$(DL) >> $@
  236. @echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@
  237. @echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@
  238. # @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
  239. # @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
  240. # @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
  241. @echo $(DL)module libc$(DL) >> $@
  242. endif
  243. ifdef MODULES
  244. @echo $(DL)module $(MODULES)$(DL) >> $@
  245. endif
  246. ifdef EXPORTS
  247. @echo $(DL)export $(EXPORTS)$(DL) >> $@
  248. endif
  249. ifdef IMPORTS
  250. @echo $(DL)import $(IMPORTS)$(DL) >> $@
  251. endif
  252. ifeq ($(LD),nlmconv)
  253. ifdef LDLIBS
  254. @echo $(DL)input $(LDLIBS)$(DL) >> $@
  255. endif
  256. @echo $(DL)input $(OBJL)$(DL) >> $@
  257. @echo $(DL)input $(PRELUDE)$(DL) >> $@
  258. @echo $(DL)output $(TARGET).nlm$(DL) >> $@
  259. endif
  260. config.h: Makefile.netware
  261. @echo Creating $@
  262. @echo $(DL)/* $@ for NetWare target.$(DL) > $@
  263. @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
  264. @echo $(DL)** All your changes will be lost!!$(DL) >> $@
  265. @echo $(DL)*/$(DL) >> $@
  266. @echo $(DL)#define OS "i586-pc-NetWare"$(DL) >> $@
  267. @echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
  268. @echo $(DL)#define PACKAGE_BUGREPORT "curl-bug@haxx.se"$(DL) >> $@
  269. @echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
  270. @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
  271. @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
  272. @echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
  273. @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
  274. @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
  275. @echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
  276. @echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
  277. @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
  278. @echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
  279. @echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
  280. @echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
  281. @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
  282. @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
  283. @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
  284. @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
  285. @echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
  286. @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
  287. @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
  288. @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
  289. @echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
  290. @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
  291. @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
  292. @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
  293. @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
  294. @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
  295. @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
  296. @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
  297. @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
  298. @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
  299. @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
  300. @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
  301. @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
  302. @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
  303. @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
  304. @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
  305. @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
  306. @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
  307. @echo $(DL)#define RETSIGTYPE void$(DL) >> $@
  308. @echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
  309. @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
  310. @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
  311. @echo $(DL)#define HAVE_AF_INET6 1$(DL) >> $@
  312. @echo $(DL)#define HAVE_PF_INET6 1$(DL) >> $@
  313. @echo $(DL)#define HAVE_STRUCT_IN6_ADDR 1$(DL) >> $@
  314. @echo $(DL)#define HAVE_STRUCT_SOCKADDR_IN6 1$(DL) >> $@
  315. @echo $(DL)#define HAVE_STRUCT_ADDRINFO 1$(DL) >> $@
  316. @echo $(DL)#define SIZEOF_STRUCT_IN6_ADDR 16$(DL) >> $@
  317. @echo $(DL)#define SIZEOF_STRUCT_IN_ADDR 4$(DL) >> $@
  318. ifdef DISABLE_LDAP
  319. @echo $(DL)#define CURL_DISABLE_LDAP 1$(DL) >> $@
  320. else
  321. @echo $(DL)#define DL_LDAP_FILE "lldapsdk.nlm"$(DL) >> $@
  322. endif
  323. ifdef ENABLE_IPV6
  324. @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
  325. endif
  326. ifdef NW_WINSOCK
  327. @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
  328. else
  329. @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
  330. @echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@
  331. @echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@
  332. @echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@
  333. endif
  334. ifdef WITH_ARES
  335. @echo $(DL)#define USE_ARES 1$(DL) >> $@
  336. endif
  337. ifdef WITH_ZLIB
  338. @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
  339. @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
  340. endif
  341. ifdef WITH_SSL
  342. @echo $(DL)#define USE_SSLEAY 1$(DL) >> $@
  343. @echo $(DL)#define USE_OPENSSL 1$(DL) >> $@
  344. @echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@
  345. @echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@
  346. @echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@
  347. @echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@
  348. @echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@
  349. @echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@
  350. @echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@
  351. @echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@
  352. @echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@
  353. @echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@
  354. endif
  355. ifdef OLD_NOVELLSDK
  356. @echo $(DL)#define socklen_t int$(DL) >> $@
  357. endif
  358. ca-bundle.h: Makefile.netware
  359. @echo Creating $@
  360. @echo $(DL)/* Do not edit this file - it is created by make!$(DL) > $@
  361. @echo $(DL)** All your changes will be lost!!$(DL) >> $@
  362. @echo $(DL)*/$(DL) >> $@
  363. @echo $(DL)#define CURL_CA_BUNDLE getenv("CURL_CA_BUNDLE")$(DL) >> $@
  364. url.c: ca-bundle.h
  365. $(LIBCARES):
  366. $(MAKE) -C ../ares -f Makefile.netware lib