]> granicus.if.org Git - apache/blob - modules/lua/NWGNUmakefile
accept both 5.1 and 5.2, so make messages clear
[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                         $(SRC)/include \
30                         $(STDMOD)/database \
31                         $(STDMOD)/http \
32                         $(STDMOD)/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                         -DLUA_COMPAT_5_2 \
50                         -DLUA_COMPAT_5_1 \
51                         -DLUA_COMPAT_MODULE \
52                         $(EOLIST)
53
54 #
55 # These flags will be added to the link.opt file
56 #
57 XLFLAGS         += \
58                         -L$(OBJDIR) \
59                         $(EOLIST)
60
61 #
62 # These values will be appended to the correct variables based on the value of
63 # RELEASE
64 #
65 ifeq "$(RELEASE)" "debug"
66 XINCDIRS        += \
67                         $(EOLIST)
68
69 XCFLAGS         += \
70                         $(EOLIST)
71
72 XDEFINES        += \
73                         $(EOLIST)
74
75 XLFLAGS         += \
76                         $(EOLIST)
77 endif
78
79 ifeq "$(RELEASE)" "noopt"
80 XINCDIRS        += \
81                         $(EOLIST)
82
83 XCFLAGS         += \
84                         $(EOLIST)
85
86 XDEFINES        += \
87                         $(EOLIST)
88
89 XLFLAGS         += \
90                         $(EOLIST)
91 endif
92
93 ifeq "$(RELEASE)" "release"
94 XINCDIRS        += \
95                         $(EOLIST)
96
97 XCFLAGS         += \
98                         $(EOLIST)
99
100 XDEFINES        += \
101                         $(EOLIST)
102
103 XLFLAGS         += \
104                         $(EOLIST)
105 endif
106
107 #
108 # These are used by the link target if an NLM is being generated
109 # This is used by the link 'name' directive to name the nlm.  If left blank
110 # TARGET_nlm (see below) will be used.
111 #
112 NLM_NAME        = mod_lua
113
114 #
115 # This is used by the link '-desc ' directive.
116 # If left blank, NLM_NAME will be used.
117 #
118 NLM_DESCRIPTION = Apache $(VERSION_STR) LUA Module
119
120 #
121 # This is used by the '-threadname' directive.  If left blank,
122 # NLM_NAME Thread will be used.
123 #
124 NLM_THREAD_NAME = LUA Module
125
126 #
127 # If this is specified, it will override VERSION value in
128 # $(AP_WORK)/build/NWGNUenvironment.inc
129 #
130 NLM_VERSION     =
131
132 #
133 # If this is specified, it will override the default of 64K
134 #
135 NLM_STACK_SIZE  = 131072
136
137
138 #
139 # If this is specified it will be used by the link '-entry' directive
140 #
141 NLM_ENTRY_SYM   =
142
143 #
144 # If this is specified it will be used by the link '-exit' directive
145 #
146 NLM_EXIT_SYM    =
147
148 #
149 # If this is specified it will be used by the link '-check' directive
150 #
151 NLM_CHECK_SYM   =
152
153 #
154 # If these are specified it will be used by the link '-flags' directive
155 #
156 NLM_FLAGS       =
157
158 #
159 # If this is specified it will be linked in with the XDCData option in the def
160 # file instead of the default of $(NWOS)/apache.xdc.  XDCData can be disabled
161 # by setting APACHE_UNIPROC in the environment
162 #
163 XDCDATA         =
164
165 #
166 # If there is an NLM target, put it here
167 #
168 TARGET_nlm = \
169         $(OBJDIR)/$(NLM_NAME).nlm \
170         $(EOLIST)
171
172 #
173 # If there is an LIB target, put it here
174 #
175 TARGET_lib = \
176         $(OBJDIR)/lua.lib \
177         $(EOLIST)
178
179 #
180 # These are the OBJ files needed to create the NLM target above.
181 # Paths must all use the '/' character
182 #
183 FILES_nlm_objs = \
184         $(OBJDIR)/mod_lua.o \
185         $(OBJDIR)/lua_apr.o \
186         $(OBJDIR)/lua_config.o \
187         $(OBJDIR)/lua_passwd.o \
188         $(OBJDIR)/lua_request.o \
189         $(OBJDIR)/lua_vmprep.o \
190         $(OBJDIR)/lua_dbd.o \
191         $(OBJDIR)/libprews.o \
192         $(EOLIST)
193
194 #
195 # These are the LIB files needed to create the NLM target above.
196 # These will be added as a library command in the link.opt file.
197 #
198 FILES_nlm_libs = \
199         $(PRELUDE) \
200         $(OBJDIR)/lua.lib \
201         $(EOLIST)
202
203 #
204 # These are the modules that the above NLM target depends on to load.
205 # These will be added as a module command in the link.opt file.
206 #
207 FILES_nlm_modules = \
208         aprlib \
209         libc \
210         $(EOLIST)
211
212 #
213 # If the nlm has a msg file, put it's path here
214 #
215 FILE_nlm_msg =
216
217 #
218 # If the nlm has a hlp file put it's path here
219 #
220 FILE_nlm_hlp =
221
222 #
223 # If this is specified, it will override $(NWOS)\copyright.txt.
224 #
225 FILE_nlm_copyright =
226
227 #
228 # Any additional imports go here
229 #
230 FILES_nlm_Ximports = \
231         @aprlib.imp \
232         @httpd.imp \
233         @libc.imp \
234         $(EOLIST)
235
236 # Don't link with Winsock if standard sockets are being used
237 ifndef USE_STDSOCKETS
238 FILES_nlm_Ximports += @ws2nlm.imp \
239         $(EOLIST)
240 endif
241
242 #
243 # Any symbols exported to here
244 #
245 FILES_nlm_exports = \
246         lua_module \
247         $(EOLIST)
248
249 #
250 # These are the OBJ files needed to create the LIB target above.
251 # Paths must all use the '/' character
252 #
253 UNWANTED = $(LUASRC)/src/lua.c $(LUASRC)/src/luac.c $(LUASRC)/src/print.c
254
255 FILES_lib_objs = \
256         $(patsubst $(LUASRC)/src/%.c,$(OBJDIR)/%.o, $(filter-out $(UNWANTED), $(wildcard $(LUASRC)/src/*.c))) \
257         $(EOLIST)
258
259 #
260 # implement targets and dependancies (leave this section alone)
261 #
262
263 libs :: $(OBJDIR) $(TARGET_lib)
264
265 nlms :: libs $(TARGET_nlm)
266
267 #
268 # Updated this target to create necessary directories and copy files to the
269 # correct place.  (See $(AP_WORK)/build/NWGNUhead.inc for examples)
270 #
271 install :: nlms FORCE
272         $(call COPY,$(OBJDIR)/*.nlm, $(INSTALLBASE)/modules/)
273
274 #
275 # Any specialized rules here
276 #
277
278 vpath %.c $(LUASRC)/src ../arch/netware
279
280 #
281 # Include the 'tail' makefile that has targets that depend on variables defined
282 # in this makefile
283 #
284
285 include $(APBUILD)/NWGNUtail.inc
286
287