Annotation of embedaddon/curl/docs/examples/Makefile.netware, revision 1.1.1.1

1.1       misho       1: #***************************************************************************
                      2: #                                  _   _ ____  _
                      3: #  Project                     ___| | | |  _ \| |
                      4: #                             / __| | | | |_) | |
                      5: #                            | (__| |_| |  _ <| |___
                      6: #                             \___|\___/|_| \_\_____|
                      7: #
                      8: # Copyright (C) 2008 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al.
                      9: #
                     10: # This software is licensed as described in the file COPYING, which
                     11: # you should have received as part of this distribution. The terms
                     12: # are also available at https://curl.haxx.se/docs/copyright.html.
                     13: #
                     14: # You may opt to use, copy, modify, merge, publish, distribute and/or sell
                     15: # copies of the Software, and permit persons to whom the Software is
                     16: # furnished to do so, under the terms of the COPYING file.
                     17: #
                     18: # This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
                     19: # KIND, either express or implied.
                     20: #
                     21: ###########################################################################
                     22: #################################################################
                     23: #
                     24: ## Makefile for building curl.nlm (NetWare version - gnu make)
                     25: ## Use: make -f Makefile.netware
                     26: ##
                     27: ## Comments to: Guenter Knauf
                     28: #
                     29: #################################################################
                     30: 
                     31: # Edit the path below to point to the base of your Novell NDK.
                     32: ifndef NDKBASE
                     33: NDKBASE = c:/novell
                     34: endif
                     35: 
                     36: # Edit the path below to point to the base of your Zlib sources.
                     37: ifndef ZLIB_PATH
                     38: ZLIB_PATH = ../../../zlib-1.2.8
                     39: endif
                     40: 
                     41: # Edit the path below to point to the base of your OpenSSL package.
                     42: ifndef OPENSSL_PATH
                     43: OPENSSL_PATH = ../../../openssl-1.0.2a
                     44: endif
                     45: 
                     46: # Edit the path below to point to the base of your LibSSH2 package.
                     47: ifndef LIBSSH2_PATH
                     48: LIBSSH2_PATH = ../../../libssh2-1.5.0
                     49: endif
                     50: 
                     51: # Edit the path below to point to the base of your libidn package.
                     52: ifndef LIBIDN_PATH
                     53: LIBIDN_PATH = ../../../libidn-1.32
                     54: endif
                     55: 
                     56: # Edit the path below to point to the base of your librtmp package.
                     57: ifndef LIBRTMP_PATH
                     58: LIBRTMP_PATH = ../../../librtmp-2.4
                     59: endif
                     60: 
                     61: # Edit the path below to point to the base of your fbopenssl package.
                     62: ifndef FBOPENSSL_PATH
                     63: FBOPENSSL_PATH = ../../fbopenssl-0.4
                     64: endif
                     65: 
                     66: # Edit the path below to point to the base of your c-ares package.
                     67: ifndef LIBCARES_PATH
                     68: LIBCARES_PATH = ../../ares
                     69: endif
                     70: 
                     71: ifndef INSTDIR
                     72: INSTDIR = ..$(DS)..$(DS)curl-$(LIBCURL_VERSION_STR)-bin-nw
                     73: endif
                     74: 
                     75: # Edit the vars below to change NLM target settings.
                     76: TARGET  = examples
                     77: VERSION = $(LIBCURL_VERSION)
                     78: COPYR   = Copyright (C) $(LIBCURL_COPYRIGHT_STR)
                     79: DESCR   = curl ($(LIBARCH))
                     80: MTSAFE  = YES
                     81: STACK   = 8192
                     82: SCREEN  = Example Program
                     83: # Comment the line below if you don't want to load protected automatically.
                     84: # LDRING = 3
                     85: 
                     86: # Uncomment the next line to enable linking with POSIX semantics.
                     87: # POSIXFL = 1
                     88: 
                     89: # Edit the var below to point to your lib architecture.
                     90: ifndef LIBARCH
                     91: LIBARCH = LIBC
                     92: endif
                     93: 
                     94: # must be equal to NDEBUG or DEBUG, CURLDEBUG
                     95: ifndef DB
                     96: DB = NDEBUG
                     97: endif
                     98: # Optimization: -O<n> or debugging: -g
                     99: ifeq ($(DB),NDEBUG)
                    100:   OPT = -O2
                    101:   OBJDIR = release
                    102: else
                    103:   OPT = -g
                    104:   OBJDIR = debug
                    105: endif
                    106: 
                    107: # The following lines defines your compiler.
                    108: ifdef CWFolder
                    109:   METROWERKS = $(CWFolder)
                    110: endif
                    111: ifdef METROWERKS
                    112:   # MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support
                    113:   MWCW_PATH = $(subst \,/,$(METROWERKS))/Novell Support/Metrowerks Support
                    114:   CC = mwccnlm
                    115: else
                    116:   CC = gcc
                    117: endif
                    118: PERL = perl
                    119: # Here you can find a native Win32 binary of the original awk:
                    120: # http://www.gknw.net/development/prgtools/awk-20100523.zip
                    121: AWK = awk
                    122: CP = cp -afv
                    123: MKDIR = mkdir
                    124: # RM = rm -f
                    125: # If you want to mark the target as MTSAFE you will need a tool for
                    126: # generating the xdc data for the linker; here's a minimal tool:
                    127: # http://www.gknw.net/development/prgtools/mkxdc.zip
                    128: MPKXDC = mkxdc
                    129: 
                    130: # LIBARCH_U = $(shell $(AWK) 'BEGIN {print toupper(ARGV[1])}' $(LIBARCH))
                    131: LIBARCH_L = $(shell $(AWK) 'BEGIN {print tolower(ARGV[1])}' $(LIBARCH))
                    132: 
                    133: # Include the version info retrieved from curlver.h
                    134: -include $(OBJDIR)/version.inc
                    135: 
                    136: # Global flags for all compilers
                    137: CFLAGS += $(OPT) -D$(DB) -DNETWARE -DHAVE_CONFIG_H -nostdinc
                    138: 
                    139: ifeq ($(CC),mwccnlm)
                    140:   LD = mwldnlm
                    141:   LDFLAGS = -nostdlib $< $(PRELUDE) $(LDLIBS) -o $@ -commandfile
                    142:   LIBEXT  = lib
                    143:   CFLAGS  += -gccinc -inline off -opt nointrinsics -proc 586
                    144:   CFLAGS  += -relax_pointers
                    145:   #CFLAGS += -w on
                    146:   ifeq ($(LIBARCH),LIBC)
                    147:     ifeq ($(POSIXFL),1)
                    148:       PRELUDE = $(NDK_LIBC)/imports/posixpre.o
                    149:     else
                    150:       PRELUDE = $(NDK_LIBC)/imports/libcpre.o
                    151:     endif
                    152:     CFLAGS += -align 4
                    153:   else
                    154:     # PRELUDE = $(NDK_CLIB)/imports/clibpre.o
                    155:     # to avoid the __init_* / __deinit_* woes don't use prelude from NDK
                    156:     PRELUDE = "$(MWCW_PATH)/libraries/runtime/prelude.obj"
                    157:     # CFLAGS += -include "$(MWCW_PATH)/headers/nlm_clib_prefix.h"
                    158:     CFLAGS += -align 1
                    159:   endif
                    160: else
                    161:   LD = nlmconv
                    162:   LDFLAGS = -T
                    163:   LIBEXT  = a
                    164:   CFLAGS  += -m32
                    165:   CFLAGS  += -fno-builtin -fno-strict-aliasing
                    166:   ifeq ($(findstring gcc,$(CC)),gcc)
                    167:     CFLAGS += -fpcc-struct-return
                    168:   endif
                    169:   CFLAGS += -Wall # -pedantic
                    170:   ifeq ($(LIBARCH),LIBC)
                    171:     ifeq ($(POSIXFL),1)
                    172:       PRELUDE = $(NDK_LIBC)/imports/posixpre.gcc.o
                    173:     else
                    174:       PRELUDE = $(NDK_LIBC)/imports/libcpre.gcc.o
                    175:     endif
                    176:   else
                    177:     # PRELUDE = $(NDK_CLIB)/imports/clibpre.gcc.o
                    178:     # to avoid the __init_* / __deinit_* woes don't use prelude from NDK
                    179:     # http://www.gknw.net/development/mk_nlm/gcc_pre.zip
                    180:     PRELUDE = $(NDK_ROOT)/pre/prelude.o
                    181:     CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
                    182:   endif
                    183: endif
                    184: 
                    185: NDK_ROOT = $(NDKBASE)/ndk
                    186: ifndef NDK_CLIB
                    187: NDK_CLIB = $(NDK_ROOT)/nwsdk
                    188: endif
                    189: ifndef NDK_LIBC
                    190: NDK_LIBC = $(NDK_ROOT)/libc
                    191: endif
                    192: ifndef NDK_LDAP
                    193: NDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
                    194: endif
                    195: CURL_INC = ../../include
                    196: CURL_LIB = ../../lib
                    197: 
                    198: INCLUDES = -I$(CURL_INC)
                    199: 
                    200: ifeq ($(findstring -static,$(CFG)),-static)
                    201: LINK_STATIC = 1
                    202: endif
                    203: ifeq ($(findstring -ares,$(CFG)),-ares)
                    204: WITH_ARES = 1
                    205: endif
                    206: ifeq ($(findstring -rtmp,$(CFG)),-rtmp)
                    207: WITH_RTMP = 1
                    208: WITH_SSL = 1
                    209: WITH_ZLIB = 1
                    210: endif
                    211: ifeq ($(findstring -ssh2,$(CFG)),-ssh2)
                    212: WITH_SSH2 = 1
                    213: WITH_SSL = 1
                    214: WITH_ZLIB = 1
                    215: endif
                    216: ifeq ($(findstring -ssl,$(CFG)),-ssl)
                    217: WITH_SSL = 1
                    218: endif
                    219: ifeq ($(findstring -zlib,$(CFG)),-zlib)
                    220: WITH_ZLIB = 1
                    221: endif
                    222: ifeq ($(findstring -idn,$(CFG)),-idn)
                    223: WITH_IDN = 1
                    224: endif
                    225: ifeq ($(findstring -ipv6,$(CFG)),-ipv6)
                    226: ENABLE_IPV6 = 1
                    227: endif
                    228: 
                    229: ifdef LINK_STATIC
                    230:   LDLIBS = $(CURL_LIB)/libcurl.$(LIBEXT)
                    231: ifdef WITH_ARES
                    232:   LDLIBS += $(LIBCARES_PATH)/libcares.$(LIBEXT)
                    233: endif
                    234: else
                    235:   MODULES = libcurl.nlm
                    236:   IMPORTS = @$(CURL_LIB)/libcurl.imp
                    237: endif
                    238: ifdef WITH_SSH2
                    239:   # INCLUDES += -I$(LIBSSH2_PATH)/include
                    240:   ifdef LINK_STATIC
                    241:     LDLIBS += $(LIBSSH2_PATH)/nw/libssh2.$(LIBEXT)
                    242:   else
                    243:     MODULES += libssh2.nlm
                    244:     IMPORTS += @$(LIBSSH2_PATH)/nw/libssh2.imp
                    245:   endif
                    246: endif
                    247: ifdef WITH_RTMP
                    248:   # INCLUDES += -I$(LIBRTMP_PATH)
                    249: ifdef LINK_STATIC
                    250:   LDLIBS += $(LIBRTMP_PATH)/librtmp/librtmp.$(LIBEXT)
                    251: endif
                    252: endif
                    253: ifdef WITH_SSL
                    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
                    258: else
                    259: endif
                    260: ifdef WITH_ZLIB
                    261:   # INCLUDES += -I$(ZLIB_PATH)
                    262: ifdef LINK_STATIC
                    263:   LDLIBS += $(ZLIB_PATH)/nw/$(LIBARCH)/libz.$(LIBEXT)
                    264: else
                    265:   MODULES += libz.nlm
                    266:   IMPORTS += @$(ZLIB_PATH)/nw/$(LIBARCH)/libz.imp
                    267: endif
                    268: endif
                    269: ifdef WITH_IDN
                    270:   # INCLUDES += -I$(LIBIDN_PATH)/include
                    271:   LDLIBS += $(LIBIDN_PATH)/lib/libidn.$(LIBEXT)
                    272: endif
                    273: 
                    274: ifeq ($(LIBARCH),LIBC)
                    275:   INCLUDES += -I$(NDK_LIBC)/include
                    276:   # INCLUDES += -I$(NDK_LIBC)/include/nks
                    277:   # INCLUDES += -I$(NDK_LIBC)/include/winsock
                    278:   CFLAGS += -D_POSIX_SOURCE
                    279: else
                    280:   INCLUDES += -I$(NDK_CLIB)/include/nlm
                    281:   # INCLUDES += -I$(NDK_CLIB)/include
                    282: endif
                    283: ifndef DISABLE_LDAP
                    284:   # INCLUDES += -I$(NDK_LDAP)/$(LIBARCH_L)/inc
                    285: endif
                    286: CFLAGS += $(INCLUDES)
                    287: 
                    288: ifeq ($(MTSAFE),YES)
                    289:   XDCOPT = -n
                    290: endif
                    291: ifeq ($(MTSAFE),NO)
                    292:   XDCOPT = -u
                    293: endif
                    294: ifdef XDCOPT
                    295:   XDCDATA = $(OBJDIR)/$(TARGET).xdc
                    296: endif
                    297: 
                    298: ifeq ($(findstring /sh,$(SHELL)),/sh)
                    299: DL  = '
                    300: DS  = /
                    301: PCT = %
                    302: #-include $(NDKBASE)/nlmconv/ncpfs.inc
                    303: else
                    304: DS  = \\
                    305: PCT = %%
                    306: endif
                    307: 
                    308: # Makefile.inc provides the CSOURCES and HHEADERS defines
                    309: include Makefile.inc
                    310: 
                    311: check_PROGRAMS := $(patsubst %,%.nlm,$(strip $(check_PROGRAMS)))
                    312: 
                    313: .PRECIOUS: $(OBJDIR)/%.o $(OBJDIR)/%.def $(OBJDIR)/%.xdc
                    314: 
                    315: 
                    316: all: prebuild $(check_PROGRAMS)
                    317: 
                    318: prebuild: $(OBJDIR) $(OBJDIR)/version.inc
                    319: 
                    320: $(OBJDIR)/%.o: %.c
                    321:        @echo Compiling $<
                    322:        $(CC) $(CFLAGS) -c $< -o $@
                    323: 
                    324: $(OBJDIR)/version.inc: $(CURL_INC)/curl/curlver.h $(OBJDIR)
                    325:        @echo Creating $@
                    326:        @$(AWK) -f ../../packages/NetWare/get_ver.awk $< > $@
                    327: 
                    328: install: $(INSTDIR) all
                    329:        @$(CP) $(check_PROGRAMS) $(INSTDIR)
                    330: 
                    331: clean:
                    332:        -$(RM) -r $(OBJDIR)
                    333: 
                    334: distclean vclean: clean
                    335:        -$(RM) $(check_PROGRAMS)
                    336: 
                    337: $(OBJDIR) $(INSTDIR):
                    338:        @$(MKDIR) $@
                    339: 
                    340: %.nlm: $(OBJDIR)/%.o $(OBJDIR)/%.def $(XDCDATA)
                    341:        @echo Linking $@
                    342:        @-$(RM) $@
                    343:        @$(LD) $(LDFLAGS) $(OBJDIR)/$(@:.nlm=.def)
                    344: 
                    345: $(OBJDIR)/%.xdc: Makefile.netware
                    346:        @echo Creating $@
                    347:        @$(MPKXDC) $(XDCOPT) $@
                    348: 
                    349: $(OBJDIR)/%.def: Makefile.netware
                    350:        @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
                    351:        @echo $(DL)# Do not edit this file - it is created by Make!$(DL) >> $@
                    352:        @echo $(DL)# All your changes will be lost!!$(DL) >> $@
                    353:        @echo $(DL)#$(DL) >> $@
                    354:        @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
                    355:        @echo $(DL)description "$(DESCR) $(notdir $(@:.def=)) Example"$(DL) >> $@
                    356:        @echo $(DL)version $(VERSION)$(DL) >> $@
                    357: ifdef NLMTYPE
                    358:        @echo $(DL)type $(NLMTYPE)$(DL) >> $@
                    359: endif
                    360: ifdef STACK
                    361:        @echo $(DL)stack $(STACK)$(DL) >> $@
                    362: endif
                    363: ifdef SCREEN
                    364:        @echo $(DL)screenname "$(DESCR) $(notdir $(@:.def=)) $(SCREEN)"$(DL) >> $@
                    365: else
                    366:        @echo $(DL)screenname "DEFAULT"$(DL) >> $@
                    367: endif
                    368: ifneq ($(DB),NDEBUG)
                    369:        @echo $(DL)debug$(DL) >> $@
                    370: endif
                    371:        @echo $(DL)threadname "_$(notdir $(@:.def=))"$(DL) >> $@
                    372: ifdef XDCDATA
                    373:        @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
                    374: endif
                    375: ifeq ($(LDRING),0)
                    376:        @echo $(DL)flag_on 16$(DL) >> $@
                    377: endif
                    378: ifeq ($(LDRING),3)
                    379:        @echo $(DL)flag_on 512$(DL) >> $@
                    380: endif
                    381: ifeq ($(LIBARCH),CLIB)
                    382:        @echo $(DL)start _Prelude$(DL) >> $@
                    383:        @echo $(DL)exit _Stop$(DL) >> $@
                    384:        @echo $(DL)import @$(NDK_CLIB)/imports/clib.imp$(DL) >> $@
                    385:        @echo $(DL)import @$(NDK_CLIB)/imports/threads.imp$(DL) >> $@
                    386:        @echo $(DL)import @$(NDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
                    387:        @echo $(DL)import @$(NDK_CLIB)/imports/socklib.imp$(DL) >> $@
                    388:        @echo $(DL)module clib$(DL) >> $@
                    389: ifndef DISABLE_LDAP
                    390:        @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
                    391:        @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
                    392: #      @echo $(DL)import @$(NDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
                    393:        @echo $(DL)module ldapsdk ldapssl$(DL) >> $@
                    394: endif
                    395: else
                    396: ifeq ($(POSIXFL),1)
                    397:        @echo $(DL)flag_on 4194304$(DL) >> $@
                    398: endif
                    399:        @echo $(DL)flag_on 64$(DL) >> $@
                    400:        @echo $(DL)pseudopreemption$(DL) >> $@
                    401: ifeq ($(findstring posixpre,$(PRELUDE)),posixpre)
                    402:        @echo $(DL)start POSIX_Start$(DL) >> $@
                    403:        @echo $(DL)exit POSIX_Stop$(DL) >> $@
                    404:        @echo $(DL)check POSIX_CheckUnload$(DL) >> $@
                    405: else
                    406:        @echo $(DL)start _LibCPrelude$(DL) >> $@
                    407:        @echo $(DL)exit _LibCPostlude$(DL) >> $@
                    408:        @echo $(DL)check _LibCCheckUnload$(DL) >> $@
                    409: endif
                    410:        @echo $(DL)import @$(NDK_LIBC)/imports/libc.imp$(DL) >> $@
                    411:        @echo $(DL)import @$(NDK_LIBC)/imports/netware.imp$(DL) >> $@
                    412:        @echo $(DL)module libc$(DL) >> $@
                    413: ifndef DISABLE_LDAP
                    414:        @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
                    415:        @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
                    416: #      @echo $(DL)import @$(NDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
                    417:        @echo $(DL)module lldapsdk lldapssl$(DL) >> $@
                    418: endif
                    419: endif
                    420: ifdef MODULES
                    421:        @echo $(DL)module $(MODULES)$(DL) >> $@
                    422: endif
                    423: ifdef EXPORTS
                    424:        @echo $(DL)export $(EXPORTS)$(DL) >> $@
                    425: endif
                    426: ifdef IMPORTS
                    427:        @echo $(DL)import $(IMPORTS)$(DL) >> $@
                    428: endif
                    429: ifeq ($(findstring nlmconv,$(LD)),nlmconv)
                    430:        @echo $(DL)input $(PRELUDE)$(DL) >> $@
                    431:        @echo $(DL)input $(@:.def=.o)$(DL) >> $@
                    432: ifdef LDLIBS
                    433:        @echo $(DL)input $(LDLIBS)$(DL) >> $@
                    434: endif
                    435:        @echo $(DL)output $(notdir $(@:.def=.nlm))$(DL) >> $@
                    436: endif

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>