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
9 # http://www.apache.org/licenses/LICENSE-2.0
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.
19 # Makefile for jk_nsapi_plugin (NetWare version - gnu make)
20 # created by Guenter Knauf <fuankg@apache.org>
23 # Edit the path below to point to the base of your Netscape includes.
25 NS_HOME = c:/projects/sdks/netscape
27 # Edit the path below to point to the base of your NetWare Java SDK.
29 NW_JDK = c:/projects/sdks/java-nw
31 # Edit the path below to point to the base of your Novell NDK.
37 INSTDIR = s:/sys/novonyx/modules
40 # Edit the vars below to change NLM target settings.
42 VERSION = $(JK_VERSION)
43 COPYR = Licensed under the Apache License, Version 2.0
44 DESCR = JNI natives for Tomcat $(JK_VERSION_STR)
47 #SCREEN = System Console
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
57 #IMPORTS = __nsapi30_table
59 # Edit the var below to point to your lib architecture.
65 # must be equal to DEBUG or NDEBUG
68 # Optimization: -O<n> or debugging: -g
77 # Include the version info retrieved from jk_version.h
78 -include $(OBJDIR)/version.inc
80 # The following line defines your compiler.
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
94 # Global flags for all compilers
95 CFLAGS = $(OPT) -D$(DB) -DNETWARE -DXP_NETWARE -nostdinc
99 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
100 CFLAGS += -gccinc -inline off -opt nointrinsics
102 ifeq ($(LIBARCH),LIBC)
103 PRELUDE = $(SDK_LIBC)/imports/libcpre.o
104 CFLAGS += -align 4 -inst mmx -proc 686
105 # CFLAGS += -D__ANSIC__
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
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__
121 PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
122 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
126 NDK_ROOT = $(NDKBASE)/ndk
127 SDK_CLIB = $(NDK_ROOT)/nwsdk
128 SDK_LIBC = $(NDK_ROOT)/libc
131 INCLUDES = -I$(NS_HOME)/include -I$(NS_HOME)/include/base
132 INCLUDES += -I$(JKCOMMON) -I$(NW_JDK)/include -I$(NW_JDK)/include/netware
134 ifeq ($(LIBARCH),LIBC)
135 INCLUDES += -I$(SDK_LIBC)/include
136 INCLUDES += -I$(SDK_LIBC)/include/winsock
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
144 CFLAGS += $(INCLUDES)
147 XDCDATA = $(OBJDIR)/$(TARGET).xdc
150 ifeq ($(findstring linux,$(OSTYPE)),linux)
152 #-include $(NDKBASE)/nlmconv/ncpfs.inc
156 $(OBJDIR)/jk_jnicb.o \
157 $(OBJDIR)/jk_nwmain.o \
159 $(OBJDIR)/jk_pool.o \
160 $(OBJDIR)/jk_util.o \
161 $(OBJDIR)/ap_snprintf.o
163 vpath %.c . $(JKCOMMON)
166 all: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).nlm
170 @$(CC) $(CFLAGS) -c $< -o $@
172 $(OBJDIR)/version.inc: $(JKCOMMON)/jk_version.h $(OBJDIR)
174 @$(AWK) -f ../../support/get_ver.awk $< > $@
177 -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
178 -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
179 # -$(CP) ../changes.txt $(OBJDIR)/
182 @[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
183 @$(CP) $(TARGET).nlm $(INSTDIR)
191 $(OBJDIR)/$(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
194 @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
196 $(OBJDIR)/%.xdc: Makefile.netware
198 @$(MPKXDC) $(XDCOPT) $@
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) >> $@
209 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
212 @echo $(DL)stack $(STACK)$(DL) >> $@
215 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
217 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
220 @echo $(DL)debug$(DL) >> $@
222 @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
224 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
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) >> $@
236 @echo $(DL)flag_on 64$(DL) >> $@
238 @echo $(DL)autounload$(DL) >> $@
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) >> $@
249 @echo $(DL)module $(MODULES)$(DL) >> $@
252 @echo $(DL)export $(EXPORTS)$(DL) >> $@
255 @echo $(DL)import $(IMPORTS)$(DL) >> $@
258 @echo $(DL)input $(OBJS)$(DL) >> $@
259 @echo $(DL)input $(PRELUDE)$(DL) >> $@
261 @echo $(DL)input $(LDLIBS)$(DL) >> $@
263 @echo $(DL)output $*.nlm$(DL) >> $@