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-1.0.2a
25 # Edit the path below to point to the base of your LibSSH2 package.
27 LIBSSH2_PATH = ../../../libssh2-1.5.0
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.32
40 # Edit the path below to point to the base of your librtmp package.
42 LIBRTMP_PATH = ../../../librtmp-2.4
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 c-ares package.
52 LIBCARES_PATH = ../../ares
56 INSTDIR = ..$(DS)..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
59 # Edit the vars below to change NLM target settings.
61 VERSION = $(LIBCURL_VERSION)
62 COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
63 DESCR = curl ($(LIBARCH))
66 SCREEN = Example Program
67 # Comment the line below if you don't want to load protected automatically.
70 # Uncomment the next line to enable linking with POSIX semantics.
73 # Edit the var below to point to your lib architecture.
78 # must be equal to NDEBUG or DEBUG, CURLDEBUG
82 # Optimization: -O<n> or debugging: -g
91 # The following lines defines your compiler.
93 METROWERKS = $(CWFolder)
96 # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
97 MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
103 # Here you can find a native Win32 binary of the original awk:
104 # http://www.gknw.net/development/prgtools/awk-20100523.zip
109 # If you want to mark the target as MTSAFE you will need a tool for
110 # generating the xdc data for the linker; here's a minimal tool:
111 # http://www.gknw.net/development/prgtools/mkxdc.zip
114 # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
115 LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
117 # Include the version info retrieved from curlver.h
118 -include $(OBJDIR)/version.inc
120 # Global flags for all compilers
121 CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
125 LDFLAGS = -nostdlib $< $(PRELUDE) $(LDLIBS) -o $@ -commandfile
127 CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
128 CFLAGS += -relax_pointers
130 ifeq ($(LIBARCH),LIBC)
132 PRELUDE = $(NDK_LIBC)/imports/posixpre.o
134 PRELUDE = $(NDK_LIBC)/imports/libcpre.o
138 # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
139 # to avoid the __init_* / __deinit_* whoes don't use prelude from NDK
140 PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
141 # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
149 CFLAGS += -fno-builtin -fno-strict-aliasing
150 ifeq ($(findstring gcc,$(CC)),gcc)
151 CFLAGS += -fpcc-struct-return
153 CFLAGS += -Wall # -pedantic
154 ifeq ($(LIBARCH),LIBC)
156 PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
158 PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
161 # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
162 # to avoid the __init_* / __deinit_* whoes don't use prelude from NDK
163 # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
164 PRELUDE = $(NDK_ROOT)/pre/prelude.o
165 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
169 NDK_ROOT = $(NDKBASE)/ndk
171 NDK_CLIB = $(NDK_ROOT)/nwsdk
174 NDK_LIBC = $(NDK_ROOT)/libc
177 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
179 CURL_INC = ../../include
182 INCLUDES = -I$(CURL_INC)
184 ifeq ($(findstring -static,$(CFG)),-static)
187 ifeq ($(findstring -ares,$(CFG)),-ares)
190 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
195 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
200 ifeq ($(findstring -axtls,$(CFG)),-axtls)
204 ifeq ($(findstring -ssl,$(CFG)),-ssl)
208 ifeq ($(findstring -zlib,$(CFG)),-zlib)
211 ifeq ($(findstring -idn,$(CFG)),-idn)
214 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
219 LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
221 LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
224 MODULES = libcurl.nlm
225 IMPORTS = @$(CURL_LIB)/libcurl.imp
228 # INCLUDES += -I$(LIBSSH2_PATH)/include
230 LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
232 MODULES += libssh2.nlm
233 IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
237 # INCLUDES += -I$(LIBRTMP_PATH)
239 LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
243 INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
244 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
245 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
246 IMPORTS += GetProcessSwitchCount RunningProcess
249 INCLUDES += -I$(AXTLS_PATH)/inc
251 LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
253 MODULES += libaxtls.nlm
254 IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
259 # INCLUDES += -I$(ZLIB_PATH)
261 LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
264 IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
268 # INCLUDES += -I$(LIBIDN_PATH)/include
269 LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
272 ifeq ($(LIBARCH),LIBC)
273 INCLUDES += -I$(NDK_LIBC)/include
274 # INCLUDES += -I$(NDK_LIBC)/include/nks
275 # INCLUDES += -I$(NDK_LIBC)/include/winsock
276 CFLAGS += -D_POSIX_SOURCE
278 INCLUDES += -I$(NDK_CLIB)/include/nlm
279 # INCLUDES += -I$(NDK_CLIB)/include
282 # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
284 CFLAGS += $(INCLUDES)
293 XDCDATA = $(OBJDIR)/$(TARGET).xdc
296 ifeq ($(findstring /sh,$(SHELL)),/sh)
300 #-include $(NDKBASE)/nlmconv/ncpfs.inc
306 # Makefile.inc provides the CSOURCES and HHEADERS defines
309 check_PROGRAMS := $(patsubst %,%.nlm,$(strip $(check_PROGRAMS)))
311 .PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc
314 all: prebuild $(check_PROGRAMS)
316 prebuild: $(OBJDIR) $(OBJDIR)/version.inc
320 $(CC) $(CFLAGS) -c $< -o $@
322 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
324 @$(AWK) -f ../../packages/NetWare/get_ver.awk $< > $@
326 install: $(INSTDIR) all
327 @$(CP) $(check_PROGRAMS) $(INSTDIR)
332 distclean vclean: clean
333 -$(RM) $(check_PROGRAMS)
335 $(OBJDIR) $(INSTDIR):
338 %.nlm: $(OBJDIR)/%.o $(OBJDIR)/%.def $(XDCDATA)
341 @$(LD) $(LDFLAGS) $(OBJDIR)/$(@:.nlm=.def)
343 $(OBJDIR)/%.xdc: Makefile.netware
345 @$(MPKXDC) $(XDCOPT) $@
347 $(OBJDIR)/%.def: Makefile.netware
348 @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
349 @echo $(DL)# Do not edit this file - it is created by Make!$(DL) >> $@
350 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
351 @echo $(DL)#$(DL) >> $@
352 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
353 @echo $(DL)description "$(DESCR) $(notdir $(@:.def=)) Example"$(DL) >> $@
354 @echo $(DL)version $(VERSION)$(DL) >> $@
356 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
359 @echo $(DL)stack $(STACK)$(DL) >> $@
362 @echo $(DL)screenname "$(DESCR) $(notdir $(@:.def=)) $(SCREEN)"$(DL) >> $@
364 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
367 @echo $(DL)debug$(DL) >> $@
369 @echo $(DL)threadname "_$(notdir $(@:.def=))"$(DL) >> $@
371 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
374 @echo $(DL)flag_on 16$(DL) >> $@
377 @echo $(DL)flag_on 512$(DL) >> $@
379 ifeq ($(LIBARCH),CLIB)
380 @echo $(DL)start _Prelude$(DL) >> $@
381 @echo $(DL)exit _Stop$(DL) >> $@
382 @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
383 @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
384 @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
385 @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
386 @echo $(DL)module clib$(DL) >> $@
388 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
389 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
390 # @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
391 @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
395 @echo $(DL)flag_on 4194304$(DL) >> $@
397 @echo $(DL)flag_on 64$(DL) >> $@
398 @echo $(DL)pseudopreemption$(DL) >> $@
399 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
400 @echo $(DL)start POSIX_Start$(DL) >> $@
401 @echo $(DL)exit POSIX_Stop$(DL) >> $@
402 @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
404 @echo $(DL)start _LibCPrelude$(DL) >> $@
405 @echo $(DL)exit _LibCPostlude$(DL) >> $@
406 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
408 @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
409 @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
410 @echo $(DL)module libc$(DL) >> $@
412 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
413 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
414 # @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
415 @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
419 @echo $(DL)module $(MODULES)$(DL) >> $@
422 @echo $(DL)export $(EXPORTS)$(DL) >> $@
425 @echo $(DL)import $(IMPORTS)$(DL) >> $@
427 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
428 @echo $(DL)input $(PRELUDE)$(DL) >> $@
429 @echo $(DL)input $(@:.def=.o)$(DL) >> $@
431 @echo $(DL)input $(LDLIBS)$(DL) >> $@
433 @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@