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.8zc
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 nghttp2 package.
47 NGHTTP2_PATH = ../../nghttp2-0.6.7
50 # Edit the path below to point to the base of your fbopenssl package.
52 FBOPENSSL_PATH = ../../fbopenssl-0.4
55 # Edit the path below to point to the base of your libmetalink package.
56 ifndef LIBMETALINK_PATH
57 LIBMETALINK_PATH = ../../libmetalink-0.1.2
60 # Edit the path below to point to the base of your libexpat package.
62 LIBEXPAT_PATH = ../../expat-2.1.0
65 # Edit the path below to point to the base of your libXML2 package.
67 LIBXML2_PATH = ../../libxml2-2.8.0
70 # Edit the path below to point to the base of your c-ares package.
72 LIBCARES_PATH = ../ares
76 INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
79 # Edit the vars below to change NLM target settings.
81 VERSION = $(LIBCURL_VERSION)
82 COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
83 DESCR = cURL $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
86 SCREEN = $(TARGET) commandline utility
87 # Comment the line below if you dont want to load protected automatically.
90 # Uncomment the next line to enable linking with POSIX semantics.
93 # Edit the var below to point to your lib architecture.
98 # must be equal to NDEBUG or DEBUG, CURLDEBUG
102 # Optimization: -O<n> or debugging: -g
111 # The following lines defines your compiler.
113 METROWERKS = $(CWFolder)
116 # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
117 MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
123 # Here you can find a native Win32 binary of the original awk:
124 # http://www.gknw.net/development/prgtools/awk-20100523.zip
129 # If you want to mark the target as MTSAFE you will need a tool for
130 # generating the xdc data for the linker; here's a minimal tool:
131 # http://www.gknw.net/development/prgtools/mkxdc.zip
134 # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
135 LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
137 # Include the version info retrieved from curlver.h
138 -include $(OBJDIR)/version.inc
140 # Global flags for all compilers
141 CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
145 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
147 CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
148 CFLAGS += -relax_pointers
150 ifeq ($(LIBARCH),LIBC)
152 PRELUDE = $(NDK_LIBC)/imports/posixpre.o
154 PRELUDE = $(NDK_LIBC)/imports/libcpre.o
158 # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
159 # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
160 PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
161 # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
169 CFLAGS += -fno-builtin -fno-strict-aliasing
170 ifeq ($(findstring gcc,$(CC)),gcc)
171 CFLAGS += -fpcc-struct-return
173 CFLAGS += -Wall # -pedantic
174 ifeq ($(LIBARCH),LIBC)
176 PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
178 PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
181 # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
182 # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
183 # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
184 PRELUDE = $(NDK_ROOT)/pre/prelude.o
185 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
189 NDK_ROOT = $(NDKBASE)/ndk
191 NDK_CLIB = $(NDK_ROOT)/nwsdk
194 NDK_LIBC = $(NDK_ROOT)/libc
197 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
199 CURL_INC = ../include
202 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
204 ifeq ($(findstring -static,$(CFG)),-static)
207 ifeq ($(findstring -ares,$(CFG)),-ares)
210 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
215 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
220 ifeq ($(findstring -axtls,$(CFG)),-axtls)
224 ifeq ($(findstring -ssl,$(CFG)),-ssl)
228 ifeq ($(findstring -zlib,$(CFG)),-zlib)
231 ifeq ($(findstring -idn,$(CFG)),-idn)
234 ifeq ($(findstring -metalink,$(CFG)),-metalink)
238 ifeq ($(findstring -nghttp2,$(CFG)),-nghttp2)
241 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
246 LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
248 LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
251 MODULES = libcurl.nlm
252 IMPORTS = @$(CURL_LIB)/libcurl.imp
255 # INCLUDES += -I$(LIBSSH2_PATH)/include
257 LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
259 MODULES += libssh2.nlm
260 IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
264 # INCLUDES += -I$(LIBRTMP_PATH)
266 LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
270 # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
271 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
272 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
273 IMPORTS += GetProcessSwitchCount RunningProcess
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 INCLUDES += -I$(NGHTTP2_PATH)/include
300 LDLIBS += $(NGHTTP2_PATH)/lib/libnghttp2.$(LIBEXT)
303 CFLAGS += -DUSE_METALINK
304 INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
305 INCLUDES += -I$(LIBMETALINK_PATH)/include
306 LDLIBS += $(LIBMETALINK_PATH)/lib/libmetalink.$(LIBEXT)
308 ifeq ($(LIBARCH),LIBC)
309 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlbc.imp
312 IMPORTS += @$(LIBEXPAT_PATH)/imports/expatlib.imp
317 IMPORTS += @$(LIBXML2_PATH)/lib/libxml2.imp
323 ifeq ($(LIBARCH),LIBC)
324 INCLUDES += -I$(NDK_LIBC)/include
325 # INCLUDES += -I$(NDK_LIBC)/include/nks
326 # INCLUDES += -I$(NDK_LIBC)/include/winsock
327 CFLAGS += -D_POSIX_SOURCE
329 INCLUDES += -I$(NDK_CLIB)/include/nlm
330 # INCLUDES += -I$(NDK_CLIB)/include
333 # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
335 CFLAGS += $(INCLUDES)
344 XDCDATA = $(OBJDIR)/$(TARGET).xdc
347 ifeq ($(findstring /sh,$(SHELL)),/sh)
351 #-include $(NDKBASE)/nlmconv/ncpfs.inc
357 # Makefile.inc provides the CSOURCES and HHEADERS defines
360 OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_CFILES))))
361 OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
366 vpath %.c $(CURL_LIB)
368 all: prebuild $(TARGET).nlm
370 prebuild: $(OBJDIR) $(OBJDIR)/version.inc
374 $(CC) $(CFLAGS) -c $< -o $@
376 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
378 @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
380 install: $(INSTDIR) all
381 @-$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
382 @-$(CP) ../docs/$(TARGET).html $(INSTDIR)
383 @$(CP) $(TARGET).nlm $(INSTDIR)
386 ifeq "$(wildcard tool_hugehelp.c.cvs)" "tool_hugehelp.c.cvs"
387 -$(RM) tool_hugehelp.c
391 distclean vclean: clean
394 $(OBJDIR) $(INSTDIR):
397 $(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
400 @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
402 $(OBJDIR)/%.xdc: Makefile.netware
404 @$(MPKXDC) $(XDCOPT) $@
406 $(OBJDIR)/%.def: Makefile.netware
407 @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
408 @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
409 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
410 @echo $(DL)#$(DL) >> $@
411 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
412 @echo $(DL)description "$(DESCR)"$(DL) >> $@
413 @echo $(DL)version $(VERSION)$(DL) >> $@
415 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
418 @echo $(DL)stack $(STACK)$(DL) >> $@
421 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
423 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
426 @echo $(DL)debug$(DL) >> $@
428 @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
430 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
433 @echo $(DL)flag_on 16$(DL) >> $@
436 @echo $(DL)flag_on 512$(DL) >> $@
438 ifeq ($(LIBARCH),CLIB)
439 @echo $(DL)start _Prelude$(DL) >> $@
440 @echo $(DL)exit _Stop$(DL) >> $@
441 @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
442 @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
443 @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
444 @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
445 @echo $(DL)module clib$(DL) >> $@
447 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
448 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
449 # @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
450 @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
454 @echo $(DL)flag_on 4194304$(DL) >> $@
456 @echo $(DL)flag_on 64$(DL) >> $@
457 @echo $(DL)pseudopreemption$(DL) >> $@
458 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
459 @echo $(DL)start POSIX_Start$(DL) >> $@
460 @echo $(DL)exit POSIX_Stop$(DL) >> $@
461 @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
463 @echo $(DL)start _LibCPrelude$(DL) >> $@
464 @echo $(DL)exit _LibCPostlude$(DL) >> $@
465 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
467 @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
468 @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
469 @echo $(DL)module libc$(DL) >> $@
471 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
472 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
473 # @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
474 @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
478 @echo $(DL)module $(MODULES)$(DL) >> $@
481 @echo $(DL)export $(EXPORTS)$(DL) >> $@
484 @echo $(DL)import $(IMPORTS)$(DL) >> $@
486 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
487 @echo $(DL)input $(PRELUDE)$(DL) >> $@
488 @echo $(DL)input $(OBJS)$(DL) >> $@
490 @echo $(DL)input $(LDLIBS)$(DL) >> $@
492 @echo $(DL)output $(TARGET).nlm$(DL) >> $@
497 @$(CP) tool_hugehelp.c.cvs $@
499 $(LIBCARES_PATH)/libcares.$(LIBEXT):
500 $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib