]> icculus.org git repositories - icculus/iodoom3.git/blob - neo/curl/src/Makefile.netware
hello world
[icculus/iodoom3.git] / neo / curl / src / Makefile.netware
1 #################################################################
2 #
3 ## Makefile for building curl.nlm (NetWare version - gnu make)
4 ## Use: make -f Makefile.netware
5 ##
6 ## Comments to: Guenter Knauf <eflash@gmx.net>
7 #
8 #################################################################
9
10 # Edit the path below to point to the base of your Novell NDK.
11 BASE    = c:/novell
12 INSTDIR = s:/libcurl
13
14 # Edit the path below to point to the base of your Zlib sources.
15 ZLIB_PATH = ../../../cw/zlib-src-1.1.4
16
17 # Edit the vars below to change NLM target settings.
18 TARGET  = curl
19 VERSION = $(LIBCURL_VERSION)
20 COPYR   = Copyright (c) 1996 - 2004, Daniel Stenberg, <daniel@haxx.se>
21 DESCR   = cURL $(LIBCURL_VERSION_STR) - http://curl.haxx.se
22 MTSAFE  = YES
23 STACK   = 64000
24 SCREEN  = $(TARGET) commandline utility
25 MODULES = libcurl.nlm
26 IMPORTS = @../lib/libcurl.imp
27
28 # Edit the var below to point to your lib architecture.
29 ifndef LIBARCH
30 LIBARCH = LIBC
31 endif
32
33 # must be equal to DEBUG or NDEBUG
34 DB      = NDEBUG
35 # DB    = DEBUG
36 # Optimization: -O<n> or debugging: -g
37 ifeq ($(DB),NDEBUG)
38         OPT     = -O2
39         OBJDIR  = release
40 else
41         OPT     = -g
42         OBJDIR  = debug
43 endif
44
45 # Include the version info retrieved from jk_version.h
46 -include $(OBJDIR)/version.inc
47
48 # The following line defines your compiler.
49 ifdef METROWERKS
50         CC = mwccnlm
51 else
52         CC = gcc
53 endif
54 # RM    = rm -f
55 # CP    = cp -fv
56 # if you want to mark the target as MTSAFE you will need a tool for
57 # generating the xdc data for the linker; here's a minimal tool:
58 # http://www.gknw.de/development/prgtools/mkxdc.zip
59 MPKXDC  = mkxdc
60
61 # Global flags for all compilers
62 CFLAGS  = $(OPT) -D$(DB) -DNETWARE -nostdinc
63 CFLAGS  += -DUSE_MANUAL
64 #CFLAGS += -DHAVE_LIBZ
65
66 ifeq ($(CC),mwccnlm)
67 LD      = mwldnlm
68 LDFLAGS = -nostdlib $(PRELUDE) $(OBJDIR)/*.o -o $(OBJDIR)/$(TARGET).nlm -commandfile
69 CFLAGS  += -gccinc -inline off -opt nointrinsics
70 CFLAGS  += -relax_pointers
71 #CFLAGS += -w on
72 ifeq ($(LIBARCH),LIBC)
73         PRELUDE = $(SDK_LIBC)/imports/libcpre.o
74         CFLAGS += -align 4 -inst mmx -proc 686
75         CFLAGS += -D_POSIX_SOURCE
76 #       CFLAGS += -D__ANSIC__
77 else
78         PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
79 #       CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
80         CFLAGS += -align 1 -proc 586
81 endif
82 else
83 LD      = nlmconv
84 LDFLAGS = -T
85 CFLAGS  += -fno-builtin -fpack-struct -fpcc-struct-return
86 CFLAGS  += -Wall #-Wno-main # -pedantic
87 ifeq ($(LIBARCH),LIBC)
88         PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
89         CFLAGS += -D_POSIX_SOURCE
90 #       CFLAGS += -D__ANSIC__
91 else
92         PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
93         CFLAGS += -include $(BASE)/nlmconv/genlm.h
94 endif
95 endif
96
97 LDLIBS  =
98
99 NDK_ROOT = $(BASE)/ndk
100 SDK_CLIB = $(NDK_ROOT)/nwsdk
101 SDK_LIBC = $(NDK_ROOT)/libc
102 SDK_LDAP = $(NDK_ROOT)/cldapsdk/netware
103 CURL_INC = ../include
104 CURL_LIB = ../lib
105
106 INCLUDES = -I$(CURL_INC) -I$(CURL_LIB)
107 INCLUDES += -I$(ZLIB_PATH)
108
109 ifeq ($(LIBARCH),LIBC)
110         INCLUDES += -I$(SDK_LIBC)/include -I$(SDK_LIBC)/include/nks
111         INCLUDES += -I$(SDK_LIBC)/include/winsock
112         INCLUDES += -I$(SDK_LDAP)/libc/inc
113 else
114         INCLUDES += -I$(SDK_CLIB)/include/nlm -I$(SDK_CLIB)/include
115         INCLUDES += -I$(SDK_LDAP)/clib/inc
116         CFLAGS += -DNETDB_USE_INTERNET
117 endif
118 CFLAGS  += $(INCLUDES)
119
120 ifeq ($(MTSAFE),YES)
121         XDCDATA = $(OBJDIR)/$(TARGET).xdc
122 endif
123
124 ifeq ($(OSTYPE),linux)
125 DL      = '
126 -include $(BASE)/nlmconv/ncpfs.inc
127 endif
128
129 OBJS    = \
130         $(OBJDIR)/main.o \
131         $(OBJDIR)/hugehelp.o \
132         $(OBJDIR)/urlglob.o \
133         $(OBJDIR)/writeout.o \
134         $(OBJDIR)/getpass.o \
135         $(OBJDIR)/homedir.o
136
137
138 all: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).nlm 
139
140 $(OBJDIR)/%.o: %.c
141         @echo Compiling $<
142         @$(CC) $(CFLAGS) -c $< -o $@
143
144 $(OBJDIR)/version.inc: $(CURL_INC)/curl/curl.h $(OBJDIR)
145         @echo Creating $@
146         @awk -f ../packages/netware/get_ver.awk $< > $@
147
148 dist: all
149         -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
150         -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
151 #       -$(CP) ../changes.txt $(OBJDIR)/
152
153 install: all
154         @[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
155         @$(CP) $(TARGET).nlm $(INSTDIR)
156
157 clean:
158         -$(RM) -r $(OBJDIR)
159
160 $(OBJDIR):
161         @mkdir $(OBJDIR)
162
163 $(OBJDIR)/$(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
164         @echo Linking $@
165         @-$(RM) $@
166         @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
167
168 $(OBJDIR)/%.xdc: Makefile.netware
169         @echo Creating $@
170         @$(MPKXDC) $(XDCOPT) $@
171
172 $(OBJDIR)/%.def: Makefile.netware
173         @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
174         @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
175         @echo $(DL)# All your changes will be lost!!$(DL) >> $@
176         @echo $(DL)#$(DL) >> $@
177         @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
178         @echo $(DL)description "$(DESCR)"$(DL) >> $@
179         @echo $(DL)version $(VERSION)$(DL) >> $@
180 ifdef NLMTYPE
181         @echo $(DL)type $(NLMTYPE)$(DL) >> $@
182 endif
183 ifdef STACK
184         @echo $(DL)stack $(STACK)$(DL) >> $@
185 endif
186 ifdef SCREEN
187         @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
188 else
189         @echo $(DL)screenname "DEFAULT"$(DL) >> $@
190 endif
191 ifeq ($(DB),DEBUG)
192         @echo $(DL)debug$(DL) >> $@
193 endif
194         @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
195 ifdef XDCDATA
196         @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
197 endif
198 ifeq ($(LIBARCH),CLIB)
199         @echo $(DL)start _Prelude$(DL) >> $@
200         @echo $(DL)exit _Stop$(DL) >> $@
201         @echo $(DL)import @$(SDK_CLIB)/imports/clib.imp$(DL) >> $@
202         @echo $(DL)import @$(SDK_CLIB)/imports/threads.imp$(DL) >> $@
203         @echo $(DL)import @$(SDK_CLIB)/imports/nlmlib.imp$(DL) >> $@
204         @echo $(DL)import @$(SDK_CLIB)/imports/socklib.imp$(DL) >> $@
205         @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapsdk.imp$(DL) >> $@
206         @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapssl.imp$(DL) >> $@
207         @echo $(DL)import @$(SDK_LDAP)/clib/imports/ldapx.imp$(DL) >> $@
208         @echo $(DL)module clib$(DL) >> $@
209 else
210 ifeq ($(LD),nlmconv)
211         @echo $(DL)flag_on 64$(DL) >> $@
212 else
213         @echo $(DL)autounload$(DL) >> $@
214 endif
215         @echo $(DL)pseudopreemption$(DL) >> $@
216         @echo $(DL)start _LibCPrelude$(DL) >> $@
217         @echo $(DL)exit _LibCPostlude$(DL) >> $@
218         @echo $(DL)check _LibCCheckUnload$(DL) >> $@
219         @echo $(DL)import @$(SDK_LIBC)/imports/libc.imp$(DL) >> $@
220         @echo $(DL)import @$(SDK_LIBC)/imports/netware.imp$(DL) >> $@
221         @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapsdk.imp$(DL) >> $@
222         @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapssl.imp$(DL) >> $@
223         @echo $(DL)import @$(SDK_LDAP)/libc/imports/lldapx.imp$(DL) >> $@
224         @echo $(DL)module libc$(DL) >> $@
225 endif
226 ifdef MODULES
227         @echo $(DL)module $(MODULES)$(DL) >> $@
228 endif
229 ifdef EXPORTS
230         @echo $(DL)export $(EXPORTS)$(DL) >> $@
231 endif
232 ifdef IMPORTS
233         @echo $(DL)import $(IMPORTS)$(DL) >> $@
234 endif
235 ifeq ($(LD),nlmconv)
236         @echo $(DL)input $(OBJS)$(DL) >> $@
237         @echo $(DL)input $(PRELUDE)$(DL) >> $@
238         @echo $(DL)output $(TARGET).nlm$(DL) >> $@
239 endif
240