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