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 = Netscape plugin for Tomcat $(JK_VERSION_STR)
47 #SCREEN = System Console
49 EXPORTS = jk_init jk_service
50 IMPORTS = __nsapi30_table
52 # Edit the var below to point to your lib architecture.
58 # must be equal to DEBUG or NDEBUG
61 # Optimization: -O<n> or debugging: -g
70 # Include the version info retrieved from jk_version.h
71 -include $(OBJDIR)/version.inc
73 # The following line defines your compiler.
81 # if you want to mark the target as MTSAFE you will need a tool for
82 # generating the xdc data for the linker; here's a minimal tool:
83 # http://www.gknw.net/development/prgtools/mkxdc.zip
87 # Global flags for all compilers
88 CFLAGS = $(OPT) -D$(DB) -DNETWARE -DXP_NETWARE -nostdinc -DJK_NSAPI
92 LDFLAGS = -nostdlib $(OBJS) $(PRELUDE) $(LDLIBS) -o $@ -commandfile
93 CFLAGS += -gccinc -inline off -opt nointrinsics
95 ifeq ($(LIBARCH),LIBC)
96 PRELUDE = $(SDK_LIBC)/imports/libcpre.o
97 CFLAGS += -align 4 -inst mmx -proc 686
98 # CFLAGS += -D__ANSIC__
100 PRELUDE = "$(METROWERKS)/Novell Support/libraries/runtime/prelude.obj"
101 LDLIBS = "$(METROWERKS)/Novell Support/libraries/runtime/mwcrtl.lib"
102 # CFLAGS += -include "$(METROWERKS)/Novell Support/headers/nlm_prefix.h"
103 CFLAGS += -align 1 -proc 586
108 CFLAGS += -fno-builtin -fpack-struct -fpcc-struct-return
109 CFLAGS += -Wall -Wno-main # -pedantic
110 ifeq ($(LIBARCH),LIBC)
111 PRELUDE = $(SDK_LIBC)/imports/libcpre.gcc.o
112 # CFLAGS += -D__ANSIC__
114 PRELUDE = $(SDK_CLIB)/imports/clibpre.gcc.o
115 CFLAGS += -include $(NDKBASE)/nlmconv/genlm.h
119 NDK_ROOT = $(NDKBASE)/ndk
120 SDK_CLIB = $(NDK_ROOT)/nwsdk
121 SDK_LIBC = $(NDK_ROOT)/libc
124 INCLUDES = -I$(NS_HOME)/include -I$(NS_HOME)/include/base
125 INCLUDES += -I$(JKCOMMON) -I$(NW_JDK)/include -I$(NW_JDK)/include/netware
127 ifeq ($(LIBARCH),LIBC)
128 INCLUDES += -I$(SDK_LIBC)/include
129 INCLUDES += -I$(SDK_LIBC)/include/winsock
131 INCLUDES += -I$(SDK_CLIB)/include/nlm
132 # INCLUDES += -I$(NDKBASE)/ws295sdk/include
133 CFLAGS += -DNETDB_USE_INTERNET
134 CFLAGS += -DNO_GETTIMEOFDAY
135 CFLAGS += -DJK_PREFORK
137 CFLAGS += $(INCLUDES)
140 XDCDATA = $(OBJDIR)/$(TARGET).xdc
143 ifeq ($(findstring linux,$(OSTYPE)),linux)
145 #-include $(NDKBASE)/nlmconv/ncpfs.inc
149 $(OBJDIR)/jk_nsapi_plugin.o \
150 $(OBJDIR)/jk_nwmain.o \
151 $(OBJDIR)/jk_ajp12_worker.o \
152 $(OBJDIR)/jk_ajp13.o \
153 $(OBJDIR)/jk_ajp13_worker.o \
154 $(OBJDIR)/jk_ajp14.o \
155 $(OBJDIR)/jk_ajp14_worker.o \
156 $(OBJDIR)/jk_ajp_common.o \
157 $(OBJDIR)/jk_connect.o \
158 $(OBJDIR)/jk_context.o \
159 $(OBJDIR)/jk_jni_worker.o \
160 $(OBJDIR)/jk_lb_worker.o \
163 $(OBJDIR)/jk_msg_buff.o \
164 $(OBJDIR)/jk_pool.o \
166 $(OBJDIR)/jk_sockbuf.o \
167 $(OBJDIR)/jk_status.o \
168 $(OBJDIR)/jk_uri_worker_map.o \
170 $(OBJDIR)/jk_util.o \
171 $(OBJDIR)/jk_worker.o \
172 $(OBJDIR)/ap_snprintf.o
174 vpath %.c . $(JKCOMMON)
177 all: $(OBJDIR) $(OBJDIR)/version.inc $(OBJDIR)/$(TARGET).nlm
181 @$(CC) $(CFLAGS) -c $< -o $@
183 $(OBJDIR)/version.inc: $(JKCOMMON)/jk_version.h $(OBJDIR)
185 @$(AWK) -f ../../support/get_ver.awk $< > $@
188 -$(RM) $(OBJDIR)/*.o $(OBJDIR)/$(TARGET).map $(OBJDIR)/$(TARGET).ncv
189 -$(RM) $(OBJDIR)/$(TARGET).def $(OBJDIR)/version.inc $(XDCDATA)
190 # -$(CP) ../changes.txt $(OBJDIR)/
193 @[ -d $(INSTDIR) ] || mkdir $(INSTDIR)
194 @$(CP) $(TARGET).nlm $(INSTDIR)
202 $(OBJDIR)/$(TARGET).nlm: $(OBJS) $(OBJDIR)/$(TARGET).def $(XDCDATA)
205 @$(LD) $(LDFLAGS) $(OBJDIR)/$(TARGET).def
207 $(OBJDIR)/%.xdc: Makefile.netware
209 @$(MPKXDC) $(XDCOPT) $@
211 $(OBJDIR)/%.def: Makefile.netware
212 @echo $(DL)# DEF file for linking with $(LD)$(DL) > $@
213 @echo $(DL)# Do not edit this file - it is created by make!$(DL) >> $@
214 @echo $(DL)# All your changes will be lost!!$(DL) >> $@
215 @echo $(DL)#$(DL) >> $@
216 @echo $(DL)copyright "$(COPYR)"$(DL) >> $@
217 @echo $(DL)description "$(DESCR)"$(DL) >> $@
218 @echo $(DL)version $(VERSION)$(DL) >> $@
220 @echo $(DL)type $(NLMTYPE)$(DL) >> $@
223 @echo $(DL)stack $(STACK)$(DL) >> $@
226 @echo $(DL)screenname "$(SCREEN)"$(DL) >> $@
228 @echo $(DL)screenname "DEFAULT"$(DL) >> $@
231 @echo $(DL)debug$(DL) >> $@
233 @echo $(DL)threadname "$(TARGET)"$(DL) >> $@
235 @echo $(DL)xdcdata $(XDCDATA)$(DL) >> $@
237 ifeq ($(LIBARCH),CLIB)
238 @echo $(DL)start _Prelude$(DL) >> $@
239 @echo $(DL)exit _Stop$(DL) >> $@
240 @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/clib.imp$(DL) >> $@
241 @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/threads.imp$(DL) >> $@
242 @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/nlmlib.imp$(DL) >> $@
243 @echo $(DL)import @$(NDK_ROOT)/nwsdk/imports/socklib.imp$(DL) >> $@
244 @echo $(DL)module clib$(DL) >> $@
247 @echo $(DL)flag_on 64$(DL) >> $@
249 @echo $(DL)autounload$(DL) >> $@
251 @echo $(DL)pseudopreemption$(DL) >> $@
252 @echo $(DL)start _LibCPrelude$(DL) >> $@
253 @echo $(DL)exit _LibCPostlude$(DL) >> $@
254 @echo $(DL)check _LibCCheckUnload$(DL) >> $@
255 @echo $(DL)import @$(NDK_ROOT)/libc/imports/libc.imp$(DL) >> $@
256 @echo $(DL)import @$(NDK_ROOT)/libc/imports/netware.imp$(DL) >> $@
257 @echo $(DL)module libc$(DL) >> $@
260 @echo $(DL)module $(MODULES)$(DL) >> $@
263 @echo $(DL)export $(EXPORTS)$(DL) >> $@
266 @echo $(DL)import $(IMPORTS)$(DL) >> $@
269 @echo $(DL)input $(OBJS)$(DL) >> $@
270 @echo $(DL)input $(PRELUDE)$(DL) >> $@
272 @echo $(DL)input $(LDLIBS)$(DL) >> $@
274 @echo $(DL)output $*.nlm$(DL) >> $@