1 #***************************************************************************
3 # Project ___| | | | _ \| |
5 # | (__| |_| | _ <| |___
6 # \___|\___/|_| \_\_____|
8 # Copyright (C) 2004 - 2014, Guenter Knauf, <http://www.gknw.net/phpbb>.
9 # Copyright (C) 2001 - 2015, Daniel Stenberg, <daniel@haxx.se>, et al.
11 # This software is licensed as described in the file COPYING, which
12 # you should have received as part of this distribution. The terms
13 # are also available at https://curl.haxx.se/docs/copyright.html.
15 # You may opt to use, copy, modify, merge, publish, distribute and/or sell
16 # copies of the Software, and permit persons to whom the Software is
17 # furnished to do so, under the terms of the COPYING file.
19 # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
20 # KIND, either express or implied.
22 #***************************************************************************
24 #################################################################
26 ## Makefile for building curl.nlm (NetWare version - gnu make)
28 ## Use: make -f Makefile.netware
30 #################################################################
32 # Edit the path below to point to the base of your Novell NDK.
37 # Edit the path below to point to the base of your Zlib sources.
39 ZLIB_PATH = ../../zlib-1.2.8
42 # Edit the path below to point to the base of your OpenSSL package.
44 OPENSSL_PATH = ../../openssl-1.0.2a
47 # Edit the path below to point to the base of your LibSSH2 package.
49 LIBSSH2_PATH = ../../libssh2-1.5.0
52 # Edit the path below to point to the base of your axTLS package.
54 AXTLS_PATH = ../../axTLS-1.2.7
57 # Edit the path below to point to the base of your libidn package.
59 LIBIDN_PATH = ../../libidn-1.18
62 # Edit the path below to point to the base of your librtmp package.
64 LIBRTMP_PATH = ../../librtmp-2.3
67 # Edit the path below to point to the base of your nghttp2 package.
69 NGHTTP2_PATH = ../../nghttp2-0.6.7
72 # Edit the path below to point to the base of your fbopenssl package.
74 FBOPENSSL_PATH = ../../fbopenssl-0.4
77 # Edit the path below to point to the base of your libmetalink package.
78 ifndef LIBMETALINK_PATH
79 LIBMETALINK_PATH = ../../libmetalink-0.1.2
82 # Edit the path below to point to the base of your libexpat package.
84 LIBEXPAT_PATH = ../../expat-2.1.0
87 # Edit the path below to point to the base of your libXML2 package.
89 LIBXML2_PATH = ../../libxml2-2.8.0
92 # Edit the path below to point to the base of your c-ares package.
94 LIBCARES_PATH = ../ares
98 INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
101 # Edit the vars below to change NLM target settings.
103 VERSION = $(LIBCURL_VERSION)
104 COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
105 DESCR = curl $(LIBCURL_VERSION_STR) ($(LIBARCH)) - https://curl.haxx.se
108 SCREEN = $(TARGET) commandline utility
109 # Comment the line below if you don't want to load protected automatically.
112 # Uncomment the next line to enable linking with POSIX semantics.
115 # Edit the var below to point to your lib architecture.
120 # must be equal to NDEBUG or DEBUG, CURLDEBUG
124 # Optimization: -O<n> or debugging: -g
133 # The following lines defines your compiler.
135 METROWERKS = $(CWFolder)
138 # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
139 MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
145 # Here you can find a native Win32 binary of the original awk:
146 # http://www.gknw.net/development/prgtools/awk-20100523.zip
151 # If you want to mark the target as MTSAFE you will need a tool for
152 # generating the xdc data for the linker; here's a minimal tool:
153 # http://www.gknw.net/development/prgtools/mkxdc.zip
156 # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
157 LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
159 # Include the version info retrieved from curlver.h
160 -include $(OBJDIR)/version.inc
162 # Global flags for all compilers
163 CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
167 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
169 CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
170 CFLAGS += -relax_pointers
172 ifeq ($(LIBARCH),LIBC)
174 PRELUDE = $(NDK_LIBC)/imports/posixpre.o
176 PRELUDE = $(NDK_LIBC)/imports/libcpre.o
180 # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
181 # to avoid the __init_* / __deinit_* whoes don't use prelude from NDK
182 PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
183 # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
191 CFLAGS += -fno-builtin -fno-strict-aliasing
192 ifeq ($(findstring gcc,$(CC)),gcc)
193 CFLAGS += -fpcc-struct-return
195 CFLAGS += -Wall # -pedantic
196 ifeq ($(LIBARCH),LIBC)
198 PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
200 PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
203 # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
204 # to avoid the __init_* / __deinit_* whoes don't use prelude from NDK
205 # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
206 PRELUDE = $(NDK_ROOT)/pre/prelude.o
207 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
211 NDK_ROOT = $(NDKBASE)/ndk
213 NDK_CLIB = $(NDK_ROOT)/nwsdk
216 NDK_LIBC = $(NDK_ROOT)/libc
219 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
221 CURL_INC = ../include
224 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
226 ifeq ($(findstring -static,$(CFG)),-static)
229 ifeq ($(findstring -ares,$(CFG)),-ares)
232 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
237 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
242 ifeq ($(findstring -axtls,$(CFG)),-axtls)
246 ifeq ($(findstring -ssl,$(CFG)),-ssl)
250 ifeq ($(findstring -zlib,$(CFG)),-zlib)
253 ifeq ($(findstring -idn,$(CFG)),-idn)
256 ifeq ($(findstring -metalink,$(CFG)),-metalink)
260 ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2)
263 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
268 LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
270 LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
273 MODULES = libcurl.nlm
274 IMPORTS = @$(CURL_LIB)/libcurl.imp
277 # INCLUDES += -I$(LIBSSH2_PATH)/include
279 LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
281 MODULES += libssh2.nlm
282 IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
286 # INCLUDES += -I$(LIBRTMP_PATH)
288 LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
292 # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
293 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
294 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
295 IMPORTS += GetProcessSwitchCount RunningProcess
298 # INCLUDES += -I$(AXTLS_PATH)/inc
300 LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
302 MODULES += libaxtls.nlm
303 IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
308 INCLUDES += -I$(ZLIB_PATH)
310 LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
313 IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
317 # INCLUDES += -I$(LIBIDN_PATH)/include
318 LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
321 INCLUDES += -I$(NGHTTP2_PATH)/include
322 LDLIBS += $(NGHTTP2_PATH)/lib/libnghttp2.$(LIBEXT)
325 CFLAGS += -DUSE_METALINK
326 INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
327 INCLUDES += -I$(LIBMETALINK_PATH)/include
328 LDLIBS += $(LIBMETALINK_PATH)/lib/libmetalink.$(LIBEXT)
330 ifeq ($(LIBARCH),LIBC)
331 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlbc.imp
334 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlib.imp
339 IMPORTS += @$(LIBXML2_PATH)/lib/libxml2.imp
345 ifeq ($(LIBARCH),LIBC)
346 INCLUDES += -I$(NDK_LIBC)/include
347 # INCLUDES += -I$(NDK_LIBC)/include/nks
348 # INCLUDES += -I$(NDK_LIBC)/include/winsock
349 CFLAGS += -D_POSIX_SOURCE
351 INCLUDES += -I$(NDK_CLIB)/include/nlm
352 # INCLUDES += -I$(NDK_CLIB)/include
355 # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
357 CFLAGS += $(INCLUDES)
366 XDCDATA = $(OBJDIR)/$(TARGET).xdc
369 ifeq ($(findstring /sh,$(SHELL)),/sh)
373 #-include $(NDKBASE)/nlmconv/ncpfs.inc
379 # Makefile.inc provides the CSOURCES and HHEADERS defines
382 OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_CFILES))))
383 OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
388 vpath %.c $(CURL_LIB)
390 all: prebuild $(TARGET).nlm
392 prebuild: $(OBJDIR) $(OBJDIR)/version.inc
396 $(CC) $(CFLAGS) -c $< -o $@
398 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
400 @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
402 install: $(INSTDIR) all
403 @-$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
404 @-$(CP) ../docs/$(TARGET).html $(INSTDIR)
405 @$(CP) $(TARGET).nlm $(INSTDIR)
408 ifeq "$(wildcard tool_hugehelp.c.cvs)" "tool_hugehelp.c.cvs"
409 -$(RM) tool_hugehelp.c
413 distclean vclean: clean
416 $(OBJDIR) $(INSTDIR):
419 $(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
422 @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
424 $(OBJDIR)/%.xdc: Makefile.netware
426 @$(MPKXDC) $(XDCOPT) $@
428 $(OBJDIR)/%.def: Makefile.netware
429 @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
430 @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
431 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
432 @echo $(DL)#$(DL) >> $@
433 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
434 @echo $(DL)description "$(DESCR)"$(DL) >> $@
435 @echo $(DL)version $(VERSION)$(DL) >> $@
437 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
440 @echo $(DL)stack $(STACK)$(DL) >> $@
443 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
445 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
448 @echo $(DL)debug$(DL) >> $@
450 @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
452 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
455 @echo $(DL)flag_on 16$(DL) >> $@
458 @echo $(DL)flag_on 512$(DL) >> $@
460 ifeq ($(LIBARCH),CLIB)
461 @echo $(DL)start _Prelude$(DL) >> $@
462 @echo $(DL)exit _Stop$(DL) >> $@
463 @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
464 @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
465 @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
466 @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
467 @echo $(DL)module clib$(DL) >> $@
469 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
470 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
471 # @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
472 @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
476 @echo $(DL)flag_on 4194304$(DL) >> $@
478 @echo $(DL)flag_on 64$(DL) >> $@
479 @echo $(DL)pseudopreemption$(DL) >> $@
480 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
481 @echo $(DL)start POSIX_Start$(DL) >> $@
482 @echo $(DL)exit POSIX_Stop$(DL) >> $@
483 @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
485 @echo $(DL)start _LibCPrelude$(DL) >> $@
486 @echo $(DL)exit _LibCPostlude$(DL) >> $@
487 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
489 @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
490 @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
491 @echo $(DL)module libc$(DL) >> $@
493 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
494 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
495 # @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
496 @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
500 @echo $(DL)module $(MODULES)$(DL) >> $@
503 @echo $(DL)export $(EXPORTS)$(DL) >> $@
506 @echo $(DL)import $(IMPORTS)$(DL) >> $@
508 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
509 @echo $(DL)input $(PRELUDE)$(DL) >> $@
510 @echo $(DL)input $(OBJS)$(DL) >> $@
512 @echo $(DL)input $(LDLIBS)$(DL) >> $@
514 @echo $(DL)output $(TARGET).nlm$(DL) >> $@
519 @$(CP) tool_hugehelp.c.cvs $@
521 $(LIBCARES_PATH)/libcares.$(LIBEXT):
522 $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib