Destroy already created resources if create fails
[apr-util.git] / dbd / NWGNUdbdmysql
blob5f8bb121c0de80353baa687723dd2a83476adee5
2 # Declare the sub-directories to be built here
5 SUBDIRS = \
6         $(EOLIST)
9 # Get the 'head' of the build environment.  This includes default targets and
10 # paths to tools
13 ifndef EnvironmentDefined
14 include $(APR_WORK)\build\NWGNUhead.inc
15 endif
17 #include $(APR)\build\NWGNUcustom.inc
20 # build this level's files
23 # Make sure all needed macro's are defined
26 # LINK_STATIC = 1
28 # for now defined here - should finally go into build/NWGNUenvironment.inc
29 MYSQL_INC = $(MYSQLSDK)/include
30 MYSQL_IMP = $(MYSQLSDK)/lib/libmysql.imp
31 MYSQL_LIB = $(MYSQLSDK)/lib/libmysqlclient_r.lib $(MYSQLSDK)/lib/libz.lib
32 MYSQL_NLM = libmysql
35 # These directories will be at the beginning of the include list, followed by
36 # INCDIRS
38 XINCDIRS        += \
39                         $(APR)/include/arch/netware \
40                         $(APR)/include \
41                         $(APRUTIL)/include \
42                         $(APRUTIL)/include/private \
43                         $(APR) \
44                         $(MYSQL_INC) \
45                         $(EOLIST)
48 # These flags will come after CFLAGS
50 XCFLAGS         += \
51                         $(EOLIST)
54 # These defines will come after DEFINES
56 XDEFINES        += \
57                         -DAPU_HAVE_MYSQL=1 \
58                         -DHAVE_MYSQL_H \
59                         $(EOLIST)
62 # These flags will be added to the link.opt file
64 XLFLAGS         += \
65                         $(EOLIST)
67 ifdef LINK_STATIC
68 XLFLAGS         += \
69                         -l $(MYSQLSDK)/lib \
70                         $(EOLIST)
71 endif
74 # These values will be appended to the correct variables based on the value of
75 # RELEASE
77 ifeq "$(RELEASE)" "debug"
78 XINCDIRS        += \
79                         $(EOLIST)
81 XCFLAGS         += \
82                         $(EOLIST)
84 XDEFINES        += \
85                         $(EOLIST)
87 XLFLAGS         += \
88                         $(EOLIST)
89 endif
91 ifeq "$(RELEASE)" "noopt"
92 XINCDIRS        += \
93                         $(EOLIST)
95 XCFLAGS         += \
96                         $(EOLIST)
98 XDEFINES        += \
99                         $(EOLIST)
101 XLFLAGS         += \
102                         $(EOLIST)
103 endif
105 ifeq "$(RELEASE)" "release"
106 XINCDIRS        += \
107                         $(EOLIST)
109 XCFLAGS         += \
110                         $(EOLIST)
112 XDEFINES        += \
113                         $(EOLIST)
115 XLFLAGS         += \
116                         $(EOLIST)
117 endif
120 # These are used by the link target if an NLM is being generated
121 # This is used by the link 'name' directive to name the nlm.  If left blank
122 # TARGET_nlm (see below) will be used.
124 NLM_NAME        = dbdmysql
127 # This is used by the link '-desc ' directive.
128 # If left blank, NLM_NAME will be used.
130 NLM_DESCRIPTION = Apache Portability Runtime Library $(VERSION_STR) DBD MySQL Driver Module
133 # This is used by the '-threadname' directive.  If left blank,
134 # NLM_NAME Thread will be used.
136 NLM_THREAD_NAME = dbdmysql
139 # If this is specified, it will override VERSION value in
140 # $(AP_WORK)\build\NWGNUenvironment.inc
142 NLM_VERSION     =
145 # If this is specified, it will override the default of 64K
147 NLM_STACK_SIZE  = 8192
151 # If this is specified it will be used by the link '-entry' directive
153 NLM_ENTRY_SYM   = _LibCPrelude
156 # If this is specified it will be used by the link '-exit' directive
158 NLM_EXIT_SYM    = _LibCPostlude
161 # If this is specified it will be used by the link '-check' directive
163 NLM_CHECK_SYM   =
166 # If these are specified it will be used by the link '-flags' directive
168 NLM_FLAGS       = AUTOUNLOAD, PSEUDOPREEMPTION
171 # If this is specified it will be linked in with the XDCData option in the def
172 # file instead of the default of $(NWOS)/apache.xdc.  XDCData can be disabled
173 # by setting APACHE_UNIPROC in the environment
175 XDCDATA         =
178 # If there is an NLM target, put it here
180 TARGET_nlm = \
181         $(OBJDIR)\$(NLM_NAME).nlm \
182         $(EOLIST)
185 # If there is an LIB target, put it here
187 TARGET_lib = \
188         $(EOLIST)
191 # These are the OBJ files needed to create the NLM target above.
192 # Paths must all use the '/' character
194 FILES_nlm_objs = \
195         $(OBJDIR)/apr_dbd_mysql.o \
196         $(EOLIST)
199 # These are the LIB files needed to create the NLM target above.
200 # These will be added as a library command in the link.opt file.
202 FILES_nlm_libs = \
203         libcpre.o \
204         $(EOLIST)
206 ifeq ($(LINK_STATIC),1)
207 FILES_nlm_libs += \
208         $(MYSQL_LIB) \
209         $(EOLIST)
210 endif
213 # These are the modules that the above NLM target depends on to load.
214 # These will be added as a module command in the link.opt file.
216 FILES_nlm_modules = \
217         aprlib \
218         libc \
219         $(EOLIST)
221 ifneq ($(LINK_STATIC),1)
222 FILES_nlm_modules += \
223         $(MYSQL_NLM) \
224         $(EOLIST)
225 endif
228 # If the nlm has a msg file, put it's path here
230 FILE_nlm_msg =
233 # If the nlm has a hlp file put it's path here
235 FILE_nlm_hlp =
238 # If this is specified, it will override $(NWOS)\copyright.txt.
240 FILE_nlm_copyright =
243 # Any additional imports go here
245 FILES_nlm_Ximports = \
246         @$(APR)/aprlib.imp \
247         @libc.imp \
248         $(EOLIST)
250 ifneq ($(LINK_STATIC),1)
251 FILES_nlm_Ximports += \
252         @$(MYSQL_IMP) \
253         $(EOLIST)
254 endif
257 # Any symbols exported to here
259 FILES_nlm_exports = \
260         apr_dbd_mysql_driver \
261         $(EOLIST)
264 # These are the OBJ files needed to create the LIB target above.
265 # Paths must all use the '/' character
267 FILES_lib_objs = \
268         $(EOLIST)
271 # implement targets and dependancies (leave this section alone)
274 libs :: $(OBJDIR) $(TARGET_lib)
276 nlms :: libs $(TARGET_nlm)
279 # Updated this target to create necessary directories and copy files to the
280 # correct place.  (See $(AP_WORK)\build\NWGNUhead.inc for examples)
282 install :: nlms FORCE
285 # Any specialized rules here
289 # Include the 'tail' makefile that has targets that depend on variables defined
290 # in this makefile
293 include $(APR_WORK)\build\NWGNUtail.inc