1#
2# Get the 'head' of the build environment if necessary.  This includes default
3# targets and paths to tools
4#
5
6ifndef EnvironmentDefined
7include $(AP_WORK)/build/NWGNUhead.inc
8endif
9
10#
11# build this level's files
12#
13# Make sure all needed macro's are defined
14#
15
16ifeq "$(WITH_ABS)" "1"
17
18ifeq "$(USE_NTLS)" "1"
19SSL_INC = $(NTLSSDK)/inc
20SSL_LIB = $(NTLSSDK)/imp
21SSL_BIN = $(NTLSSDK)/bin
22SSL_APP = $(NTLSSDK)/apps
23ifneq "$(wildcard $(SSL_INC)/openssl/opensslv.h)" "$(SSL_INC)/openssl/opensslv.h"
24$(warning '$(NTLSSDK)' does NOT point to a valid NTLS SDK!)
25endif
26else
27SSL_INC = $(OSSLSDK)/outinc_nw_libc
28SSL_LIB = $(OSSLSDK)/out_nw_libc
29SSL_BIN = $(OSSLSDK)/out_nw_libc
30SSL_APP = $(OSSLSDK)/apps
31ifneq "$(wildcard $(SSL_INC)/openssl/opensslv.h)" "$(SSL_INC)/openssl/opensslv.h"
32$(warning '$(OSSLSDK)' does NOT point to a valid OpenSSL SDK!)
33endif
34endif
35ifeq "$(wildcard $(SSL_INC)/openssl/opensslv.h)" "$(SSL_INC)/openssl/opensslv.h"
36HAVE_OPENSSL = 1
37endif
38
39endif
40
41#
42# These directories will be at the beginning of the include list, followed by
43# INCDIRS
44#
45ifdef HAVE_OPENSSL
46XINCDIRS	+= \
47			$(SSL_INC) \
48			$(SSL_INC)/openssl \
49			$(EOLIST)
50endif
51
52XINCDIRS	+= \
53			$(NWOS) \
54			$(AP_WORK)/include \
55			$(APR)/include \
56			$(APRUTIL)/include \
57			$(APR)/misc/netware \
58			$(EOLIST)
59
60#
61# These flags will come after CFLAGS
62#
63XCFLAGS		+= \
64			$(EOLIST)
65
66#
67# These defines will come after DEFINES
68#
69ifdef HAVE_OPENSSL
70XDEFINES	+= \
71			-DHAVE_OPENSSL \
72			$(EOLIST)
73
74#
75# These flags will be added to the link.opt file
76#
77XLFLAGS		+= \
78			-l $(SSL_LIB) \
79			$(EOLIST)
80endif
81
82#
83# These values will be appended to the correct variables based on the value of
84# RELEASE
85#
86ifeq "$(RELEASE)" "debug"
87XINCDIRS	+= \
88			$(EOLIST)
89
90XCFLAGS		+= \
91			$(EOLIST)
92
93XDEFINES	+= \
94			$(EOLIST)
95
96XLFLAGS		+= \
97			$(EOLIST)
98endif
99
100ifeq "$(RELEASE)" "noopt"
101XINCDIRS	+= \
102			$(EOLIST)
103
104XCFLAGS		+= \
105			$(EOLIST)
106
107XDEFINES	+= \
108			$(EOLIST)
109
110XLFLAGS		+= \
111			$(EOLIST)
112endif
113
114ifeq "$(RELEASE)" "release"
115XINCDIRS	+= \
116			$(EOLIST)
117
118XCFLAGS		+= \
119			$(EOLIST)
120
121XDEFINES	+= \
122			$(EOLIST)
123
124XLFLAGS		+= \
125			$(EOLIST)
126endif
127
128#
129# These are used by the link target if an NLM is being generated
130# This is used by the link 'name' directive to name the nlm.  If left blank
131# TARGET_nlm (see below) will be used.
132#
133ifdef HAVE_OPENSSL
134NLM_NAME		= abs
135else
136NLM_NAME		= ab
137endif
138
139#
140# This is used by the link '-desc ' directive.
141# If left blank, NLM_NAME will be used.
142#
143NLM_DESCRIPTION	= Apache $(VERSION_STR) Benchmark Utility for NetWare
144
145#
146# This is used by the '-threadname' directive.  If left blank,
147# NLM_NAME Thread will be used.
148#
149NLM_THREAD_NAME	= $(NLM_NAME)
150
151#
152# This is used by the '-screenname' directive.  If left blank,
153# 'Apache for NetWare' Thread will be used.
154#
155#NLM_SCREEN_NAME = Apache Bench
156NLM_SCREEN_NAME = DEFAULT
157
158#
159# If this is specified, it will override VERSION value in
160# $(AP_WORK)/build/NWGNUenvironment.inc
161#
162NLM_VERSION	=
163
164#
165# If this is specified, it will override the default of 64K
166#
167NLM_STACK_SIZE	= 65536
168
169
170#
171# If this is specified it will be used by the link '-entry' directive
172#
173NLM_ENTRY_SYM	=
174
175#
176# If this is specified it will be used by the link '-exit' directive
177#
178NLM_EXIT_SYM	=
179
180#
181# If this is specified it will be used by the link '-check' directive
182#
183NLM_CHECK_SYM	=
184
185#
186# If these are specified it will be used by the link '-flags' directive
187#
188NLM_FLAGS	=
189
190#
191# If this is specified it will be linked in with the XDCData option in the def
192# file instead of the default of $(NWOS)/apache.xdc.  XDCData can be disabled
193# by setting APACHE_UNIPROC in the environment
194#
195XDCDATA		=
196
197#
198# If there is an NLM target, put it here
199#
200TARGET_nlm = \
201	$(OBJDIR)/$(NLM_NAME).nlm \
202	$(EOLIST)
203
204#
205# If there is an LIB target, put it here
206#
207TARGET_lib = \
208	$(EOLIST)
209
210#
211# These are the OBJ files needed to create the NLM target above.
212# Paths must all use the '/' character
213#
214FILES_nlm_objs = \
215	$(OBJDIR)/ab.o \
216	$(EOLIST)
217
218#
219# These are the LIB files needed to create the NLM target above.
220# These will be added as a library command in the link.opt file.
221#
222FILES_nlm_libs = \
223	$(PRELUDE) \
224	$(EOLIST)
225
226ifdef HAVE_OPENSSL
227ifneq "$(USE_NTLS)" "1"
228FILES_nlm_libs += \
229	$(SSL_LIB)/crypto.lib \
230	$(SSL_LIB)/ssl.lib \
231	$(EOLIST)
232endif
233endif
234
235#
236# These are the modules that the above NLM target depends on to load.
237# These will be added as a module command in the link.opt file.
238#
239FILES_nlm_modules = \
240	aprlib \
241	libc \
242	$(EOLIST)
243
244ifdef HAVE_OPENSSL
245ifeq "$(USE_NTLS)" "1"
246FILES_nlm_modules += ntls \
247	$(EOLIST)
248endif
249endif
250
251#
252# If the nlm has a msg file, put it's path here
253#
254FILE_nlm_msg =
255
256#
257# If the nlm has a hlp file put it's path here
258#
259FILE_nlm_hlp =
260
261#
262# If this is specified, it will override $(NWOS)\copyright.txt.
263#
264FILE_nlm_copyright =
265
266#
267# Any additional imports go here
268#
269FILES_nlm_Ximports = \
270	@aprlib.imp \
271	@libc.imp \
272	$(EOLIST)
273
274# Don't link with Winsock if standard sockets are being used
275ifneq "$(USE_STDSOCKETS)" "1"
276FILES_nlm_Ximports += @ws2nlm.imp \
277	$(EOLIST)
278endif
279
280ifdef HAVE_OPENSSL
281ifeq "$(USE_NTLS)" "1"
282FILES_nlm_Ximports += @ntls.imp \
283	$(EOLIST)
284else
285FILES_nlm_Ximports += \
286	GetProcessSwitchCount \
287	RunningProcess \
288	GetSuperHighResolutionTimer \
289	$(EOLIST)
290endif
291endif
292
293#
294# Any symbols exported to here
295#
296FILES_nlm_exports = \
297	$(EOLIST)
298
299#
300# These are the OBJ files needed to create the LIB target above.
301# Paths must all use the '/' character
302#
303FILES_lib_objs = \
304	$(EOLIST)
305
306#
307# implement targets and dependancies (leave this section alone)
308#
309
310libs :: $(OBJDIR) $(TARGET_lib)
311
312nlms :: libs $(TARGET_nlm)
313
314#
315# Updated this target to create necessary directories and copy files to the
316# correct place.  (See $(AP_WORK)/build/NWGNUhead.inc for examples)
317#
318install :: nlms FORCE
319
320#
321# Any specialized rules here
322#
323
324#
325# Include the 'tail' makefile that has targets that depend on variables defined
326# in this makefile
327#
328
329include $(AP_WORK)/build/NWGNUtail.inc
330
331