bottleneck testcase based on rubbos
[bottlenecks.git] / rubbos / app / tomcat-connectors-1.2.32-src / native / jni / Makefile.netware
1 #
2 # Licensed to the Apache Software Foundation (ASF) under one or more
3 # contributor license agreements.  See the NOTICE file distributed with
4 # this work for additional information regarding copyright ownership.
5 # The ASF licenses this file to You under the Apache License, Version 2.0
6 # (the "License"); you may not use this file except in compliance with
7 # the License.  You may obtain a copy of the License at
8 #
9 #     http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17
18 #
19 # Makefile for jk_nsapi_plugin (NetWare version - gnu make)
20 # created by Guenter Knauf <fuankg@apache.org>
21 #
22
23 # Edit the path below to point to the base of your Netscape includes.
24 ifndef NS_HOME
25 NS_HOME = c:/projects/sdks/netscape
26 endif
27 # Edit the path below to point to the base of your NetWare Java SDK.
28 ifndef NW_JDK
29 NW_JDK  = c:/projects/sdks/java-nw
30 endif
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 ifndef INSTDIR
37 INSTDIR = s:/sys/novonyx/modules
38 endif
39
40 # Edit the vars below to change NLM target settings.
41 TARGET  = jni_conn
42 VERSION = $(JK_VERSION)
43 COPYR   = Licensed under the Apache License, Version 2.0
44 DESCR   = JNI natives for Tomcat $(JK_VERSION_STR)
45 MTSAFE  = NO
46 STACK   = 64000
47 #SCREEN = System Console
48 MODULES = nsapi
49 EXPORTS = \
50         Java_org_apache_tomcat_modules_server_JNIConnectionHandler_write \
51         Java_org_apache_tomcat_modules_server_JNIConnectionHandler_startReasponse \
52         Java_org_apache_tomcat_modules_server_JNIConnectionHandler_readHeaders \
53         Java_org_apache_tomcat_modules_server_JNIConnectionHandler_readEnvironment \
54         Java_org_apache_tomcat_modules_server_JNIConnectionHandler_read \
55         Java_org_apache_tomcat_modules_server_JNIConnectionHandler_getNumberOfHeaders
56
57 #IMPORTS        = __nsapi30_table
58
59 # Edit the var below to point to your lib architecture.
60 ifndef LIBARCH
61 LIBARCH = CLIB
62 # LIBARCH = LIBC
63 endif
64
65 # must be equal to DEBUG or NDEBUG
66 DB      = NDEBUG
67 # DB    = DEBUG
68 # Optimization: -O<n> or debugging: -g
69 ifeq ($(DB),NDEBUG)
70         OPT     = -O2
71         OBJDIR  = release
72 else
73         OPT     = -g
74         OBJDIR  = debug
75 endif
76
77 # Include the version info retrieved from jk_version.h
78 -include $(OBJDIR)/version.inc
79
80 # The following line defines your compiler.
81 ifdef METROWERKS
82         CC = mwccnlm
83 else
84         CC = gcc
85 endif
86 # RM    = rm -f
87 # CP    = cp -fv
88 # if you want to mark the target as MTSAFE you will need a tool for
89 # generating the xdc data for the linker; here's a minimal tool:
90 # http://www.gknw.net/development/prgtools/mkxdc.zip
91 MPKXDC  = mkxdc
92 AWK     = awk
93
94 # Global flags for all compilers
95 CFLAGS  = $(OPT) -D$(DB) -DNETWARE -DXP_NETWARE -nostdinc
96
97 ifeq ($(CC),mwccnlm)
98 LD      = mwldnlm
99 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
100 CFLAGS  += -gccinc -inline off -opt nointrinsics
101 #CFLAGS += -w on
102 ifeq ($(LIBARCH),LIBC)
103         PRELUDE = $(SDK_LIBC)/imports/libcpre.o
104         CFLAGS += -align 4 -inst mmx -proc 686
105 #       CFLAGS += -D__ANSIC__
106 else
107         PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
108         LDLIBS = "$(METROWERKS)/Novell Support/libraries/runtime/mwcrtl.lib"
109 #       CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
110         CFLAGS += -align 1 -proc 586
111 endif
112 else
113 LD      = nlmconv
114 LDFLAGS = -T
115 CFLAGS  += -fno-builtin -fpack-struct -fpcc-struct-return
116 CFLAGS  += -Wall -Wno-main # -pedantic
117 ifeq ($(LIBARCH),LIBC)
118         PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
119 #       CFLAGS += -D__ANSIC__
120 else
121         PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
122         CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
123 endif
124 endif
125
126 NDK_ROOT = $(NDKBASE)/ndk
127 SDK_CLIB = $(NDK_ROOT)/nwsdk
128 SDK_LIBC = $(NDK_ROOT)/libc
129 JKCOMMON = ../common
130
131 INCLUDES = -I$(NS_HOME)/include -I$(NS_HOME)/include/base
132 INCLUDES += -I$(JKCOMMON) -I$(NW_JDK)/include -I$(NW_JDK)/include/netware 
133
134 ifeq ($(LIBARCH),LIBC)
135         INCLUDES += -I$(SDK_LIBC)/include
136         INCLUDES += -I$(SDK_LIBC)/include/winsock
137 else
138         INCLUDES += -I$(SDK_CLIB)/include/nlm
139         # INCLUDES += -I$(NDKBASE)/ws295sdk/include
140         CFLAGS += -DNETDB_USE_INTERNET
141         CFLAGS += -DNO_GETTIMEOFDAY
142         CFLAGS += -DJK_PREFORK
143 endif
144 CFLAGS  += $(INCLUDES)
145
146 ifeq ($(MTSAFE),YES)
147         XDCDATA = $(OBJDIR)/$(TARGET).xdc
148 endif
149
150 ifeq ($(findstring linux,$(OSTYPE)),linux)
151 DL      = '
152 #-include $(NDKBASE)/nlmconv/ncpfs.inc
153 endif
154
155 OBJS    = \
156         $(OBJDIR)/jk_jnicb.o \
157         $(OBJDIR)/jk_nwmain.o \
158         $(OBJDIR)/jk_map.o \
159         $(OBJDIR)/jk_pool.o \
160         $(OBJDIR)/jk_util.o \
161         $(OBJDIR)/ap_snprintf.o
162
163 vpath %.c . $(JKCOMMON)
164
165
166 all: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).nlm 
167
168 $(OBJDIR)/%.o: %.c
169         @echo Compiling $<
170         @$(CC) $(CFLAGS) -c $< -o $@
171
172 $(OBJDIR)/version.inc: $(JKCOMMON)/jk_version.h $(OBJDIR)
173         @echo Creating $@
174         @$(AWK) -f ../../support/get_ver.awk $< > $@
175
176 dist: all
177         -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
178         -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
179 #       -$(CP) ../changes.txt $(OBJDIR)/
180
181 install: all
182         @[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
183         @$(CP) $(TARGET).nlm $(INSTDIR)
184
185 clean:
186         -$(RM) -r $(OBJDIR)
187
188 $(OBJDIR):
189         @mkdir $(OBJDIR)
190
191 $(OBJDIR)/$(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
192         @echo Linking $@
193         @-$(RM) $@
194         @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
195
196 $(OBJDIR)/%.xdc: Makefile.netware
197         @echo Creating $@
198         @$(MPKXDC) $(XDCOPT) $@
199
200 $(OBJDIR)/%.def: Makefile.netware
201         @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
202         @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
203         @echo $(DL)# All your changes will be lost!!$(DL) >> $@
204         @echo $(DL)#$(DL) >> $@
205         @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
206         @echo $(DL)description "$(DESCR)"$(DL) >> $@
207         @echo $(DL)version $(VERSION)$(DL) >> $@
208 ifdef NLMTYPE
209         @echo $(DL)type $(NLMTYPE)$(DL) >> $@
210 endif
211 ifdef STACK
212         @echo $(DL)stack $(STACK)$(DL) >> $@
213 endif
214 ifdef SCREEN
215         @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
216 else
217         @echo $(DL)screenname "DEFAULT"$(DL) >> $@
218 endif
219 ifeq ($(DB),DEBUG)
220         @echo $(DL)debug$(DL) >> $@
221 endif
222         @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
223 ifdef XDCDATA
224         @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
225 endif
226 ifeq ($(LIBARCH),CLIB)
227         @echo $(DL)start _Prelude$(DL) >> $@
228         @echo $(DL)exit _Stop$(DL) >> $@
229         @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/clib.imp$(DL) >> $@
230         @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/threads.imp$(DL) >> $@
231         @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/nlmlib.imp$(DL) >> $@
232         @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/socklib.imp$(DL) >> $@
233         @echo $(DL)module clib$(DL) >> $@
234 else
235 ifeq ($(LD),nlmconv)
236         @echo $(DL)flag_on 64$(DL) >> $@
237 else
238         @echo $(DL)autounload$(DL) >> $@
239 endif
240         @echo $(DL)pseudopreemption$(DL) >> $@
241         @echo $(DL)start _LibCPrelude$(DL) >> $@
242         @echo $(DL)exit _LibCPostlude$(DL) >> $@
243         @echo $(DL)check _LibCCheckUnload$(DL) >> $@
244         @echo $(DL)import @$(NDK_ROOT)/libc/imports/libc.imp$(DL) >> $@
245         @echo $(DL)import @$(NDK_ROOT)/libc/imports/netware.imp$(DL) >> $@
246         @echo $(DL)module libc$(DL) >> $@
247 endif
248 ifdef MODULES
249         @echo $(DL)module $(MODULES)$(DL) >> $@
250 endif
251 ifdef EXPORTS
252         @echo $(DL)export $(EXPORTS)$(DL) >> $@
253 endif
254 ifdef IMPORTS
255         @echo $(DL)import $(IMPORTS)$(DL) >> $@
256 endif
257 ifeq ($(LD),nlmconv)
258         @echo $(DL)input $(OBJS)$(DL) >> $@
259         @echo $(DL)input $(PRELUDE)$(DL) >> $@
260 ifdef LDLIBS
261         @echo $(DL)input $(LDLIBS)$(DL) >> $@
262 endif
263         @echo $(DL)output $*.nlm$(DL) >> $@
264 endif
265
266