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.7
20 # Edit the path below to point to the base of your OpenSSL package.
22 OPENSSL_PATH = ../../openssl-0.9.8x
25 # Edit the path below to point to the base of your LibSSH2 package.
27 LIBSSH2_PATH = ../../libssh2-1.4.2
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.0.3
55 # Edit the path below to point to the base of your c-ares package.
57 LIBCARES_PATH = ../ares
61 INSTDIR = ..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
64 # Edit the vars below to change NLM target settings.
66 VERSION = $(LIBCURL_VERSION)
67 COPYR = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
68 DESCR = cURL $(LIBCURL_VERSION_STR) ($(LIBARCH)) - http://curl.haxx.se
71 SCREEN = $(TARGET) commandline utility
72 # Comment the line below if you dont want to load protected automatically.
75 # Uncomment the next line to enable linking with POSIX semantics.
78 # Edit the var below to point to your lib architecture.
83 # must be equal to NDEBUG or DEBUG, CURLDEBUG
87 # Optimization: -O<n> or debugging: -g
96 # The following lines defines your compiler.
98 METROWERKS = $(CWFolder)
101 # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
102 MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
108 # Here you can find a native Win32 binary of the original awk:
109 # http://www.gknw.net/development/prgtools/awk-20100523.zip
114 # If you want to mark the target as MTSAFE you will need a tool for
115 # generating the xdc data for the linker; here's a minimal tool:
116 # http://www.gknw.net/development/prgtools/mkxdc.zip
119 # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
120 LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
122 # Include the version info retrieved from curlver.h
123 -include $(OBJDIR)/version.inc
125 # Global flags for all compilers
126 CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
130 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
132 CFLAGS += -gccinc -inline off -opt nointrinsics -proc 586
133 CFLAGS += -relax_pointers
135 ifeq ($(LIBARCH),LIBC)
137 PRELUDE = $(NDK_LIBC)/imports/posixpre.o
139 PRELUDE = $(NDK_LIBC)/imports/libcpre.o
143 # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
144 # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
145 PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
146 # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
154 CFLAGS += -fno-builtin -fno-strict-aliasing
155 ifeq ($(findstring gcc,$(CC)),gcc)
156 CFLAGS += -fpcc-struct-return
158 CFLAGS += -Wall # -pedantic
159 ifeq ($(LIBARCH),LIBC)
161 PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
163 PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
166 # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
167 # to avoid the __init_* / __deinit_* whoes dont use prelude from NDK
168 # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
169 PRELUDE = $(NDK_ROOT)/pre/prelude.o
170 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
174 NDK_ROOT = $(NDKBASE)/ndk
176 NDK_CLIB = $(NDK_ROOT)/nwsdk
179 NDK_LIBC = $(NDK_ROOT)/libc
182 NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
184 CURL_INC = ../include
187 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
189 ifeq ($(findstring -static,$(CFG)),-static)
192 ifeq ($(findstring -ares,$(CFG)),-ares)
195 ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
200 ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
205 ifeq ($(findstring -axtls,$(CFG)),-axtls)
209 ifeq ($(findstring -ssl,$(CFG)),-ssl)
213 ifeq ($(findstring -zlib,$(CFG)),-zlib)
216 ifeq ($(findstring -idn,$(CFG)),-idn)
219 ifeq ($(findstring -spnego,$(CFG)),-spnego)
222 ifeq ($(findstring -metalink,$(CFG)),-metalink)
225 ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
230 LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
232 LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
235 MODULES = libcurl.nlm
236 IMPORTS = @$(CURL_LIB)/libcurl.imp
239 # INCLUDES += -I$(LIBSSH2_PATH)/include
241 LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
243 MODULES += libssh2.nlm
244 IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
248 # INCLUDES += -I$(LIBRTMP_PATH)
250 LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
254 # INCLUDES += -I$(OPENSSL_PATH)/outinc_nw_$(LIBARCH_L)
255 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/ssl.$(LIBEXT)
256 LDLIBS += $(OPENSSL_PATH)/out_nw_$(LIBARCH_L)/crypto.$(LIBEXT)
257 IMPORTS += GetProcessSwitchCount RunningProcess
259 # INCLUDES += -I$(FBOPENSSL_PATH)/include
260 LDLIBS += $(FBOPENSSL_PATH)/nw/fbopenssl.$(LIBEXT)
264 # INCLUDES += -I$(AXTLS_PATH)/inc
266 LDLIBS += $(AXTLS_PATH)/lib/libaxtls.$(LIBEXT)
268 MODULES += libaxtls.nlm
269 IMPORTS += $(AXTLS_PATH)/lib/libaxtls.imp
274 INCLUDES += -I$(ZLIB_PATH)
276 LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
279 IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
283 # INCLUDES += -I$(LIBIDN_PATH)/include
284 LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
287 CFLAGS += -DUSE_METALINK
288 INCLUDES += -I$(METALINK_PATH)/include
289 LDLIBS += $(METALINK_PATH)/lib/libmetalink.$(LIBEXT)
292 ifeq ($(LIBARCH),LIBC)
293 INCLUDES += -I$(NDK_LIBC)/include
294 # INCLUDES += -I$(NDK_LIBC)/include/nks
295 # INCLUDES += -I$(NDK_LIBC)/include/winsock
296 CFLAGS += -D_POSIX_SOURCE
298 INCLUDES += -I$(NDK_CLIB)/include/nlm
299 # INCLUDES += -I$(NDK_CLIB)/include
302 # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
304 CFLAGS += $(INCLUDES)
313 XDCDATA = $(OBJDIR)/$(TARGET).xdc
316 ifeq ($(findstring /sh,$(SHELL)),/sh)
320 #-include $(NDKBASE)/nlmconv/ncpfs.inc
326 # Makefile.inc provides the CSOURCES and HHEADERS defines
329 OBJX := $(patsubst %.c,$(OBJDIR)/%.o,$(notdir $(strip $(CURLX_ONES))))
330 OBJS := $(patsubst %.c,$(OBJDIR)/%.o,$(strip $(CURL_CFILES)))
335 vpath %.c $(CURL_LIB)
337 all: prebuild $(TARGET).nlm
339 prebuild: $(OBJDIR) $(OBJDIR)/version.inc
343 $(CC) $(CFLAGS) -c $< -o $@
345 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
347 @$(AWK) -f ../packages/NetWare/get_ver.awk $< > $@
349 install: $(INSTDIR) all
350 @-$(CP) ../docs/$(TARGET).pdf $(INSTDIR)
351 @-$(CP) ../docs/$(TARGET).html $(INSTDIR)
352 @$(CP) $(TARGET).nlm $(INSTDIR)
355 ifeq "$(wildcard hugehelp.c.cvs)" "hugehelp.c.cvs"
360 distclean vclean: clean
363 $(OBJDIR) $(INSTDIR):
366 $(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
369 @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
371 $(OBJDIR)/%.xdc: Makefile.netware
373 @$(MPKXDC) $(XDCOPT) $@
375 $(OBJDIR)/%.def: Makefile.netware
376 @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
377 @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
378 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
379 @echo $(DL)#$(DL) >> $@
380 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
381 @echo $(DL)description "$(DESCR)"$(DL) >> $@
382 @echo $(DL)version $(VERSION)$(DL) >> $@
384 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
387 @echo $(DL)stack $(STACK)$(DL) >> $@
390 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
392 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
395 @echo $(DL)debug$(DL) >> $@
397 @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
399 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
402 @echo $(DL)flag_on 16$(DL) >> $@
405 @echo $(DL)flag_on 512$(DL) >> $@
407 ifeq ($(LIBARCH),CLIB)
408 @echo $(DL)start _Prelude$(DL) >> $@
409 @echo $(DL)exit _Stop$(DL) >> $@
410 @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
411 @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
412 @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
413 @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
414 @echo $(DL)module clib$(DL) >> $@
416 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
417 @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
418 # @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
419 @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
423 @echo $(DL)flag_on 4194304$(DL) >> $@
425 @echo $(DL)flag_on 64$(DL) >> $@
426 @echo $(DL)pseudopreemption$(DL) >> $@
427 ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
428 @echo $(DL)start POSIX_Start$(DL) >> $@
429 @echo $(DL)exit POSIX_Stop$(DL) >> $@
430 @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
432 @echo $(DL)start _LibCPrelude$(DL) >> $@
433 @echo $(DL)exit _LibCPostlude$(DL) >> $@
434 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
436 @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
437 @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
438 @echo $(DL)module libc$(DL) >> $@
440 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
441 @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
442 # @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
443 @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
447 @echo $(DL)module $(MODULES)$(DL) >> $@
450 @echo $(DL)export $(EXPORTS)$(DL) >> $@
453 @echo $(DL)import $(IMPORTS)$(DL) >> $@
455 ifeq ($(findstring nlmconv,$(LD)),nlmconv)
456 @echo $(DL)input $(PRELUDE)$(DL) >> $@
457 @echo $(DL)input $(OBJS)$(DL) >> $@
459 @echo $(DL)input $(LDLIBS)$(DL) >> $@
461 @echo $(DL)output $(TARGET).nlm$(DL) >> $@
466 @$(CP) hugehelp.c.cvs $@
468 $(LIBCARES_PATH)/libcares.$(LIBEXT):
469 $(MAKE) -C $(LIBCARES_PATH) -f Makefile.netware lib