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