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