1 #################################################################
4 ## Makefile for building curl.nlm (NetWare version - gnu make)
5 ## Use: make -f Makefile.netware
7 ## Comments to: Guenter Knauf http://www.gknw.de/phpbb
9 #################################################################
11 # Edit the path below to point to the base of your Novell NDK.
16 # Edit the path below to point to the base of your Zlib sources.
18 ZLIB_PATH = ../../zlib-1.2.3
21 # Edit the path below to point to the base of your OpenSSL package.
23 OPENSSL_PATH = ../../openssl-0.9.8e
26 # Edit the path below to point to the base of your LibSSH2 package.
28 LIBSSH2_PATH = ../../libssh2-0.15
32 INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
35 # Edit the vars below to change NLM target settings.
37 VERSION = $(LIBCURL_VERSION)
38 COPYR = Copyright (C) 1996 - 2007, Daniel Stenberg, <daniel@haxx.se>
39 DESCR = cURL $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
42 SCREEN = $(TARGET) commandline utility
43 # Comment the line below if you dont want to load protected automatically.
46 # Edit the var below to point to your lib architecture.
51 # must be equal to NDEBUG or DEBUG, CURLDEBUG
55 # Optimization: -O<n> or debugging: -g
64 # Include the version info retrieved from curlver.h
65 -include $(OBJDIR)/version.inc
67 # The following line defines your compiler.
69 # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
70 MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
75 # a native win32 awk can be downloaded from here:
76 # http://www.gknw.net/development/prgtools/awk-20050424.zip
80 # if you want to mark the target as MTSAFE you will need a tool for
81 # generating the xdc data for the linker; here's a minimal tool:
82 # http://www.gknw.net/development/prgtools/mkxdc.zip
85 # Global flags for all compilers
86 CFLAGS = $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
90 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
92 CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
93 CFLAGS += -relax_pointers
95 ifeq ($(LIBARCH),LIBC)
96 PRELUDE = $(SDK_LIBC)/imports/libcpre.o
99 PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
100 # PRELUDE += "$(MWCW_PATH)/libraries/runtime/mwcrtl.lib"
101 PRELUDE += "$(MWCW_PATH)/libraries/runtime/output/clib/mwcrtl.lib"
102 CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
109 CFLAGS += -fno-builtin -fpcc-struct-return -fno-strict-aliasing
110 CFLAGS += -Wall # -pedantic
111 ifeq ($(LIBARCH),LIBC)
112 PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
114 PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
115 PRELUDE += c:/usr/lib/gcc-lib/i586-netware/3.2.3/libgcc.$(LIBEXT)
116 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
120 NDK_ROOT = $(NDKBASE)/ndk
121 SDK_CLIB = $(NDK_ROOT)/nwsdk
122 SDK_LIBC = $(NDK_ROOT)/libc
123 SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
124 CURL_INC = ../include
128 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
131 LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
133 MODULES = libcurl.nlm
134 IMPORTS = @$(CURL_LIB)/libcurl.imp
137 INCLUDES += -I$(ZLIB_PATH)
139 LDLIBS += $(ZLIB_PATH)/nw/libz.$(LIBEXT)
142 IMPORTS += @$(ZLIB_PATH)/nw/libz.imp
146 INCLUDES += -I$(LIBSSH2_PATH)/include
148 LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
150 MODULES += libssh2.nlm
151 IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
155 LDLIBS += $(OPENSSL_PATH)/out_nw_libc/ssl.$(LIBEXT)
156 LDLIBS += $(OPENSSL_PATH)/out_nw_libc/crypto.$(LIBEXT)
157 IMPORTS += GetProcessSwitchCount RunningProcess
160 ifeq ($(LIBARCH),LIBC)
161 INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
162 # INCLUDES += -I$(SDK_LIBC)/include/winsock
163 # INCLUDES += -I$(SDK_LDAP)/libc/inc
164 CFLAGS += -D_POSIX_SOURCE
165 # CFLAGS += -D__ANSIC__
167 INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
168 # INCLUDES += -I$(SDK_LDAP)/clib/inc
169 CFLAGS += -DNETDB_USE_INTERNET
171 CFLAGS += $(INCLUDES)
180 XDCDATA = $(OBJDIR)/$(TARGET).xdc
183 ifeq ($(findstring linux,$(OSTYPE)),linux)
186 #-include $(NDKBASE)/nlmconv/ncpfs.inc
191 # Makefile.inc provides the CSOURCES and HHEADERS defines
194 OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_ONES))))
195 OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_SOURCES))) $(OBJX)
197 vpath %.c $(CURL_LIB)
199 all: prebuild $(TARGET).nlm
201 prebuild: $(OBJDIR) $(OBJDIR)/version.inc config.h
205 $(CC) $(CFLAGS) -c $< -o $@
207 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
209 @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
212 -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
213 -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
215 install: $(INSTDIR) all
216 @$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
217 @$(CP) $(TARGET).nlm $(INSTDIR)
220 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
227 -$(RM) -r $(TARGET).nlm
235 $(TARGET).nlm: $(OBJS) $(OBJX) $(OBJDIR)/$(TARGET).def $(XDCDATA)
238 @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
240 $(OBJDIR)/%.xdc: Makefile.netware
242 @$(MPKXDC) $(XDCOPT) $@
244 $(OBJDIR)/%.def: Makefile.netware
245 @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
246 @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
247 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
248 @echo $(DL)#$(DL) >> $@
249 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
250 @echo $(DL)description "$(DESCR)"$(DL) >> $@
251 @echo $(DL)version $(VERSION)$(DL) >> $@
253 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
256 @echo $(DL)stack $(STACK)$(DL) >> $@
259 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
261 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
264 @echo $(DL)debug$(DL) >> $@
266 @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
268 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
271 @echo $(DL)flag_on 16$(DL) >> $@
274 @echo $(DL)flag_on 512$(DL) >> $@
276 ifeq ($(LIBARCH),CLIB)
277 @echo $(DL)start _Prelude$(DL) >> $@
278 @echo $(DL)exit _Stop$(DL) >> $@
279 @echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@
280 @echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@
281 @echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
282 @echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@
283 # @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
284 # @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
285 # @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
286 @echo $(DL)module clib$(DL) >> $@
288 @echo $(DL)flag_on 64$(DL) >> $@
289 @echo $(DL)pseudopreemption$(DL) >> $@
290 @echo $(DL)start _LibCPrelude$(DL) >> $@
291 @echo $(DL)exit _LibCPostlude$(DL) >> $@
292 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
293 @echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@
294 @echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@
295 # @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
296 # @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
297 # @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
298 @echo $(DL)module libc$(DL) >> $@
301 @echo $(DL)module $(MODULES)$(DL) >> $@
304 @echo $(DL)export $(EXPORTS)$(DL) >> $@
307 @echo $(DL)import $(IMPORTS)$(DL) >> $@
310 @echo $(DL)input $(OBJS)$(DL) >> $@
311 @echo $(DL)input $(PRELUDE)$(DL) >> $@
313 @echo $(DL)input $(LDLIBS)$(DL) >> $@
315 @echo $(DL)output $(TARGET).nlm$(DL) >> $@
318 config.h: Makefile.netware
320 @echo $(DL)/* $@ for NetWare target.$(DL) > $@
321 @echo $(DL)** Do not edit this file - it is created by make!$(DL) >> $@
322 @echo $(DL)** All your changes will be lost!!$(DL) >> $@
323 @echo $(DL)*/$(DL) >> $@
324 @echo $(DL)#ifndef NETWARE$(DL) >> $@
325 @echo $(DL)#error This $(notdir $@) is created for NetWare platform!$(DL) >> $@
326 @echo $(DL)#endif$(DL) >> $@
327 @echo $(DL)#define VERSION "$(LIBCURL_VERSION_STR)"$(DL) >> $@
328 @echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@
329 ifeq ($(LIBARCH),CLIB)
330 @echo $(DL)#define OS "i586-clib-NetWare"$(DL) >> $@
331 @echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@
332 @echo $(DL)#define CURL_DISABLE_CRYPTO_AUTH 1$(DL) >> $@
333 @echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
334 # @echo $(DL)#define HAVE_INET_NTOA_R_DECL 1$(DL) >> $@
335 @echo $(DL)#define HAVE_LL 1$(DL) >> $@
336 @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@
337 @echo $(DL)#define socklen_t int$(DL) >> $@
338 @echo $(DL)#define pressanykey PressAnyKeyToContinue$(DL) >> $@
340 @echo $(DL)#define OS "i586-libc-NetWare"$(DL) >> $@
341 @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@
342 @echo $(DL)#define HAVE_DLOPEN 1$(DL) >> $@
343 @echo $(DL)#define HAVE_FTRUNCATE 1$(DL) >> $@
344 @echo $(DL)#define HAVE_GETTIMEOFDAY 1$(DL) >> $@
345 @echo $(DL)#define HAVE_INET_PTON 1$(DL) >> $@
346 @echo $(DL)#define HAVE_LIMITS_H 1$(DL) >> $@
347 @echo $(DL)#define HAVE_INTTYPES_H 1$(DL) >> $@
348 @echo $(DL)#define HAVE_STDINT_H 1$(DL) >> $@
349 @echo $(DL)#define HAVE_STRCASECMP 1$(DL) >> $@
350 @echo $(DL)#define HAVE_STRLCAT 1$(DL) >> $@
351 @echo $(DL)#define HAVE_STRLCPY 1$(DL) >> $@
352 @echo $(DL)#define HAVE_SYS_PARAM_H 1$(DL) >> $@
353 @echo $(DL)#define HAVE_SYS_SELECT_H 1$(DL) >> $@
354 @echo $(DL)#define HAVE_TERMIOS_H 1$(DL) >> $@
356 @echo $(DL)#define USE_MANUAL 1$(DL) >> $@
357 @echo $(DL)#define HAVE_ARPA_INET_H 1$(DL) >> $@
358 @echo $(DL)#define HAVE_ASSERT_H 1$(DL) >> $@
359 @echo $(DL)#define HAVE_ERR_H 1$(DL) >> $@
360 @echo $(DL)#define HAVE_FCNTL_H 1$(DL) >> $@
361 @echo $(DL)#define HAVE_FIONBIO 1$(DL) >> $@
362 @echo $(DL)#define HAVE_GETHOSTBYADDR 1$(DL) >> $@
363 @echo $(DL)#define HAVE_INET_ADDR 1$(DL) >> $@
364 @echo $(DL)#define HAVE_INET_NTOA 1$(DL) >> $@
365 @echo $(DL)#define HAVE_LONGLONG 1$(DL) >> $@
366 @echo $(DL)#define HAVE_MALLOC_H 1$(DL) >> $@
367 @echo $(DL)#define HAVE_NETINET_IN_H 1$(DL) >> $@
368 @echo $(DL)#define HAVE_RECV 1$(DL) >> $@
369 @echo $(DL)#define HAVE_SELECT 1$(DL) >> $@
370 @echo $(DL)#define HAVE_SEND 1$(DL) >> $@
371 @echo $(DL)#define HAVE_SETJMP_H 1$(DL) >> $@
372 @echo $(DL)#define HAVE_SIGNAL 1$(DL) >> $@
373 @echo $(DL)#define HAVE_SIGNAL_H 1$(DL) >> $@
374 @echo $(DL)#define HAVE_SIG_ATOMIC_T 1$(DL) >> $@
375 @echo $(DL)#define HAVE_SOCKET 1$(DL) >> $@
376 @echo $(DL)#define HAVE_STDLIB_H 1$(DL) >> $@
377 @echo $(DL)#define HAVE_STRDUP 1$(DL) >> $@
378 @echo $(DL)#define HAVE_STRFTIME 1$(DL) >> $@
379 @echo $(DL)#define HAVE_STRING_H 1$(DL) >> $@
380 @echo $(DL)#define HAVE_STRSTR 1$(DL) >> $@
381 @echo $(DL)#define HAVE_SYS_STAT_H 1$(DL) >> $@
382 @echo $(DL)#define HAVE_SYS_TIME_H 1$(DL) >> $@
383 @echo $(DL)#define HAVE_TIME_H 1$(DL) >> $@
384 @echo $(DL)#define HAVE_UNAME 1$(DL) >> $@
385 @echo $(DL)#define HAVE_UNISTD_H 1$(DL) >> $@
386 @echo $(DL)#define HAVE_UTIME 1$(DL) >> $@
387 @echo $(DL)#define HAVE_UTIME_H 1$(DL) >> $@
388 @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@
389 @echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@
390 @echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@
391 @echo $(DL)#define RECV_TYPE_ARG4 int$(DL) >> $@
392 @echo $(DL)#define RECV_TYPE_RETV int$(DL) >> $@
393 @echo $(DL)#define RETSIGTYPE void$(DL) >> $@
394 @echo $(DL)#define SEND_QUAL_ARG2$(DL) >> $@
395 @echo $(DL)#define SEND_TYPE_ARG1 int$(DL) >> $@
396 @echo $(DL)#define SEND_TYPE_ARG2 char *$(DL) >> $@
397 @echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@
398 @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@
399 @echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@
400 @echo $(DL)#define SIZEOF_CURL_OFF_T 4$(DL) >> $@
401 @echo $(DL)#define STDC_HEADERS 1$(DL) >> $@
402 @echo $(DL)#define TIME_WITH_SYS_TIME 1$(DL) >> $@
403 @echo $(DL)#define HAVE_STRUCT_TIMEVAL 1$(DL) >> $@
405 @echo $(DL)#define ENABLE_IPV6 1$(DL) >> $@
408 @echo $(DL)#define HAVE_CLOSESOCKET 1$(DL) >> $@
410 @echo $(DL)#define HAVE_SYS_TYPES_H 1$(DL) >> $@
411 @echo $(DL)#define HAVE_SYS_SOCKET_H 1$(DL) >> $@
412 @echo $(DL)#define HAVE_SYS_SOCKIO_H 1$(DL) >> $@
413 @echo $(DL)#define HAVE_NETDB_H 1$(DL) >> $@
416 @echo $(DL)#define USE_ARES 1$(DL) >> $@
419 @echo $(DL)#define HAVE_ZLIB_H 1$(DL) >> $@
420 @echo $(DL)#define HAVE_LIBZ 1$(DL) >> $@
423 @echo $(DL)#define USE_SSLEAY 1$(DL) >> $@
424 @echo $(DL)#define HAVE_OPENSSL_X509_H 1$(DL) >> $@
425 @echo $(DL)#define HAVE_OPENSSL_SSL_H 1$(DL) >> $@
426 @echo $(DL)#define HAVE_OPENSSL_RSA_H 1$(DL) >> $@
427 @echo $(DL)#define HAVE_OPENSSL_PEM_H 1$(DL) >> $@
428 @echo $(DL)#define HAVE_OPENSSL_ERR_H 1$(DL) >> $@
429 @echo $(DL)#define HAVE_OPENSSL_CRYPTO_H 1$(DL) >> $@
430 @echo $(DL)#define HAVE_OPENSSL_ENGINE_H 1$(DL) >> $@
431 @echo $(DL)#define HAVE_LIBSSL 1$(DL) >> $@
432 @echo $(DL)#define HAVE_LIBCRYPTO 1$(DL) >> $@
433 @echo $(DL)#define OPENSSL_NO_KRB5 1$(DL) >> $@
436 @echo $(DL)#define USE_LIBSSH2 1$(DL) >> $@
437 @echo $(DL)#define HAVE_LIBSSH2_H 1$(DL) >> $@
439 @echo $(DL)#ifdef __GNUC__$(DL) >> $@
440 @echo $(DL)#define HAVE_VARIADIC_MACROS_GCC 1$(DL) >> $@
441 @echo $(DL)#else$(DL) >> $@
442 @echo $(DL)#define HAVE_VARIADIC_MACROS_C99 1$(DL) >> $@
443 @echo $(DL)#endif$(DL) >> $@
445 @echo $(DL)#define socklen_t int$(DL) >> $@
450 @$(CP) hugehelp.c.cvs $@