1 #################################################################
3 ## Makefile for building curl.nlm (NetWare version - gnu make)
4 ## Use: make -f Makefile.netware
6 ## Comments to: Guenter Knauf http://www.gknw.net/phpbb
8 #################################################################
10 # Edit the path below to point to the base of your Novell NDK.
15 # Edit the path below to point to the base of your Zlib sources.
17 ZLIB_PATH = ../../zlib-1.2.8
20 # Edit the path below to point to the base of your OpenSSL package.
22 OPENSSL_PATH = ../../openssl-0.9.8y
25 # Edit the path below to point to the base of your LibSSH2 package.
27 LIBSSH2_PATH = ../../libssh2-1.4.3
30 # Edit the path below to point to the base of your axTLS package.
32 AXTLS_PATH = ../../axTLS-1.2.7
35 # Edit the path below to point to the base of your libidn package.
37 LIBIDN_PATH = ../../libidn-1.18
40 # Edit the path below to point to the base of your librtmp package.
42 LIBRTMP_PATH = ../../librtmp-2.3
45 # Edit the path below to point to the base of your fbopenssl package.
47 FBOPENSSL_PATH = ../../fbopenssl-0.4
50 # Edit the path below to point to the base of your libmetalink package.
51 ifndef LIBMETALINK_PATH
52 LIBMETALINK_PATH = ../../libmetalink-0.1.2
55 # Edit the path below to point to the base of your libexpat package.
57 LIBEXPAT_PATH = ../../expat-2.1.0
60 # Edit the path below to point to the base of your libXML2 package.
62 LIBXML2_PATH = ../../libxml2-2.8.0
65 # Edit the path below to point to the base of your c-ares package.
67 LIBCARES_PATH = ../ares
71 INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
74 # Edit the vars below to change NLM target settings.
76 VERSION = $(LIBCURL_VERSION)
77 COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
78 DESCR = cURL $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
81 SCREEN = $(TARGET) commandline utility
82 # Comment the line below if you dont want to load protected automatically.
85 # Uncomment the next line to enable linking with POSIX semantics.
88 # Edit the var below to point to your lib architecture.
93 # must be equal to NDEBUG or DEBUG, CURLDEBUG
97 # Optimization: -O<n> or debugging: -g
106 # The following lines defines your compiler.
108 METROWERKS = $(CWFolder)
111 # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
112 MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
118 # Here you can find a native Win32 binary of the original awk:
119 # http://www.gknw.net/development/prgtools/awk-20100523.zip
124 # If you want to mark the target as MTSAFE you will need a tool for
125 # generating the xdc data for the linker; here's a minimal tool:
126 # http://www.gknw.net/development/prgtools/mkxdc.zip
129 # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
130 LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
132 # Include the version info retrieved from curlver.h
133 -include $(OBJDIR)/version.inc
135 # Global flags for all compilers
136 CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
140 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
142 CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
143 CFLAGS += -relax_pointers
145 ifeq ($(LIBARCH),LIBC)
147 PRELUDE = $(NDK_LIBC)/imports/posixpre.o
149 PRELUDE = $(NDK_LIBC)/imports/libcpre.o
153 # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
154 # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
155 PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
156 # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
164 CFLAGS += -fno-builtin -fno-strict-aliasing
165 ifeq ($(findstring gcc,$(CC)),gcc)
166 CFLAGS += -fpcc-struct-return
168 CFLAGS += -Wall # -pedantic
169 ifeq ($(LIBARCH),LIBC)
171 PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
173 PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
176 # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
177 # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
178 # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
179 PRELUDE = $(NDK_ROOT)/pre/prelude.o
180 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
184 NDK_ROOT = $(NDKBASE)/ndk
186 NDK_CLIB = $(NDK_ROOT)/nwsdk
189 NDK_LIBC = $(NDK_ROOT)/libc
192 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
194 CURL_INC = ../include
197 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
199 ifeq ($(findstring -static,$(CFG)),-static)
202 ifeq ($(findstring -ares,$(CFG)),-ares)
205 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
210 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
215 ifeq ($(findstring -axtls,$(CFG)),-axtls)
219 ifeq ($(findstring -ssl,$(CFG)),-ssl)
223 ifeq ($(findstring -zlib,$(CFG)),-zlib)
226 ifeq ($(findstring -idn,$(CFG)),-idn)
229 ifeq ($(findstring -spnego,$(CFG)),-spnego)
233 ifeq ($(findstring -metalink,$(CFG)),-metalink)
237 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
242 LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
244 LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
247 MODULES = libcurl.nlm
248 IMPORTS = @$(CURL_LIB)/libcurl.imp
251 # INCLUDES += -I$(LIBSSH2_PATH)/include
253 LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
255 MODULES += libssh2.nlm
256 IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
260 # INCLUDES += -I$(LIBRTMP_PATH)
262 LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
266 # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
267 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
268 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
269 IMPORTS += GetProcessSwitchCount RunningProcess
271 # INCLUDES += -I$(FBOPENSSL_PATH)/include
272 LDLIBS += $(FBOPENSSL_PATH)/nw/fbopenssl.$(LIBEXT)
276 # INCLUDES += -I$(AXTLS_PATH)/inc
278 LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
280 MODULES += libaxtls.nlm
281 IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
286 INCLUDES += -I$(ZLIB_PATH)
288 LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
291 IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
295 # INCLUDES += -I$(LIBIDN_PATH)/include
296 LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
299 CFLAGS += -DUSE_METALINK
300 INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
301 INCLUDES += -I$(LIBMETALINK_PATH)/include
302 LDLIBS += $(LIBMETALINK_PATH)/lib/libmetalink.$(LIBEXT)
304 ifeq ($(LIBARCH),LIBC)
305 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlbc.imp
308 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlib.imp
313 IMPORTS += @$(LIBXML2_PATH)/lib/libxml2.imp
319 ifeq ($(LIBARCH),LIBC)
320 INCLUDES += -I$(NDK_LIBC)/include
321 # INCLUDES += -I$(NDK_LIBC)/include/nks
322 # INCLUDES += -I$(NDK_LIBC)/include/winsock
323 CFLAGS += -D_POSIX_SOURCE
325 INCLUDES += -I$(NDK_CLIB)/include/nlm
326 # INCLUDES += -I$(NDK_CLIB)/include
329 # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
331 CFLAGS += $(INCLUDES)
340 XDCDATA = $(OBJDIR)/$(TARGET).xdc
343 ifeq ($(findstring /sh,$(SHELL)),/sh)
347 #-include $(NDKBASE)/nlmconv/ncpfs.inc
353 # Makefile.inc provides the CSOURCES and HHEADERS defines
356 OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_CFILES))))
357 OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
362 vpath %.c $(CURL_LIB)
364 all: prebuild $(TARGET).nlm
366 prebuild: $(OBJDIR) $(OBJDIR)/version.inc
370 $(CC) $(CFLAGS) -c $< -o $@
372 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
374 @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
376 install: $(INSTDIR) all
377 @-$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
378 @-$(CP) ../docs/$(TARGET).html $(INSTDIR)
379 @$(CP) $(TARGET).nlm $(INSTDIR)
382 ifeq "$(wildcard tool_hugehelp.c.cvs)" "tool_hugehelp.c.cvs"
383 -$(RM) tool_hugehelp.c
387 distclean vclean: clean
390 $(OBJDIR) $(INSTDIR):
393 $(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
396 @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
398 $(OBJDIR)/%.xdc: Makefile.netware
400 @$(MPKXDC) $(XDCOPT) $@
402 $(OBJDIR)/%.def: Makefile.netware
403 @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
404 @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
405 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
406 @echo $(DL)#$(DL) >> $@
407 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
408 @echo $(DL)description "$(DESCR)"$(DL) >> $@
409 @echo $(DL)version $(VERSION)$(DL) >> $@
411 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
414 @echo $(DL)stack $(STACK)$(DL) >> $@
417 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
419 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
422 @echo $(DL)debug$(DL) >> $@
424 @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
426 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
429 @echo $(DL)flag_on 16$(DL) >> $@
432 @echo $(DL)flag_on 512$(DL) >> $@
434 ifeq ($(LIBARCH),CLIB)
435 @echo $(DL)start _Prelude$(DL) >> $@
436 @echo $(DL)exit _Stop$(DL) >> $@
437 @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
438 @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
439 @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
440 @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
441 @echo $(DL)module clib$(DL) >> $@
443 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
444 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
445 # @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
446 @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
450 @echo $(DL)flag_on 4194304$(DL) >> $@
452 @echo $(DL)flag_on 64$(DL) >> $@
453 @echo $(DL)pseudopreemption$(DL) >> $@
454 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
455 @echo $(DL)start POSIX_Start$(DL) >> $@
456 @echo $(DL)exit POSIX_Stop$(DL) >> $@
457 @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
459 @echo $(DL)start _LibCPrelude$(DL) >> $@
460 @echo $(DL)exit _LibCPostlude$(DL) >> $@
461 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
463 @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
464 @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
465 @echo $(DL)module libc$(DL) >> $@
467 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
468 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
469 # @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
470 @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
474 @echo $(DL)module $(MODULES)$(DL) >> $@
477 @echo $(DL)export $(EXPORTS)$(DL) >> $@
480 @echo $(DL)import $(IMPORTS)$(DL) >> $@
482 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
483 @echo $(DL)input $(PRELUDE)$(DL) >> $@
484 @echo $(DL)input $(OBJS)$(DL) >> $@
486 @echo $(DL)input $(LDLIBS)$(DL) >> $@
488 @echo $(DL)output $(TARGET).nlm$(DL) >> $@
493 @$(CP) tool_hugehelp.c.cvs $@
495 $(LIBCARES_PATH)/libcares.$(LIBEXT):
496 $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib