NWGNUmakefile revision 251875
1#
2# Define our macros with defaults if we dont got them already.
3#
4ifndef APR_WORK
5export APR_WORK = $(CURDIR)
6endif
7ifneq "$(wildcard $(APR_WORK)/include/apr_version.h)" "$(APR_WORK)/include/apr_version.h"
8$(error APR_WORK does not point to a valid APR source tree) 
9endif
10ifndef APU_WORK
11export APU_WORK = $(CURDIR)/../apr-util
12endif
13ifneq "$(wildcard $(APU_WORK)/include/apu_version.h)" "$(APU_WORK)/include/apu_version.h"
14$(error APU_WORK does not point to a valid APU source tree) 
15endif
16
17#
18# Declare the sub-directories to be built here
19#
20
21SUBDIRS = \
22		build \
23		$(APU_WORK) \
24		$(EOLIST)
25
26ifeq "$(TEST)" "1"
27SUBDIRS += \
28		test \
29		$(APU_WORK)/test \
30		$(EOLIST)
31endif
32
33#
34# Get the 'head' of the build environment.  This includes default targets and
35# paths to tools
36#
37
38include $(APR_WORK)/build/NWGNUhead.inc
39
40#
41# build this level's files
42
43#
44# Make sure all needed macro's are defined
45#
46
47#
48# These directories will be at the beginning of the include list, followed by
49# INCDIRS
50#
51XINCDIRS	+= \
52			$(APR)/include \
53			$(APR)/include/arch/NetWare \
54			$(APR)/include/arch/unix \
55			$(APR)/memory/unix \
56			$(APR)/random/unix \
57			$(APU)/include \
58			$(APU)/xml \
59			$(LDAPSDK)/inc \
60			$(EOLIST)
61
62#
63# These flags will come after CFLAGS
64#
65XCFLAGS		+= \
66			$(EOLIST)
67
68#
69# These defines will come after DEFINES
70#
71XDEFINES	+= \
72			$(EOLIST)
73
74#
75# These flags will be added to the link.opt file
76#
77XLFLAGS		+= \
78			$(EOLIST)
79
80#
81# These values will be appended to the correct variables based on the value of
82# RELEASE
83#
84ifeq "$(RELEASE)" "debug"
85XINCDIRS	+= \
86			$(EOLIST)
87
88XCFLAGS		+= \
89			$(EOLIST)
90
91XDEFINES	+= \
92			$(EOLIST)
93
94XLFLAGS		+= \
95			$(EOLIST)
96endif
97
98ifeq "$(RELEASE)" "noopt"
99XINCDIRS	+= \
100			$(EOLIST)
101
102XCFLAGS		+= \
103			$(EOLIST)
104
105XDEFINES	+= \
106			$(EOLIST)
107
108XLFLAGS		+= \
109			$(EOLIST)
110endif
111
112ifeq "$(RELEASE)" "release"
113XINCDIRS	+= \
114			$(EOLIST)
115
116XCFLAGS		+= \
117			$(EOLIST)
118
119XDEFINES	+= \
120			$(EOLIST)
121
122XLFLAGS		+= \
123			$(EOLIST)
124endif
125
126#
127# These are used by the link target if an NLM is being generated
128# This is used by the link 'name' directive to name the nlm.  If left blank
129# TARGET_nlm (see below) will be used.
130#
131NLM_NAME	= aprlib
132
133#
134# This is used by the link '-desc ' directive.
135# If left blank, NLM_NAME will be used.
136#
137NLM_DESCRIPTION	= Apache Portability Runtime Library $(VERSION_STR) $(VERSION_SKT)
138
139#
140# This is used by the '-threadname' directive.  If left blank,
141# NLM_NAME Thread will be used.
142#
143NLM_THREAD_NAME	=
144#
145# If this is specified, it will override VERSION value in
146# $(APR_WORK)/build/NWGNUenvironment.inc
147#
148NLM_VERSION	=
149
150#
151# If this is specified, it will override the default of 64K
152#
153NLM_STACK_SIZE	=
154
155#
156# If this is specified it will be used by the link '-entry' directive
157#
158NLM_ENTRY_SYM	=
159
160#
161# If this is specified it will be used by the link '-exit' directive
162#
163NLM_EXIT_SYM	=
164
165#
166# If this is specified it will be used by the link '-check' directive
167#
168NLM_CHECK_SYM	=
169
170#
171# If this is specified it will be used by the link '-flags' directive
172#
173NLM_FLAGS	=
174
175#
176# If this is specified it will be linked in with the XDCData option in the def
177# file instead of the default of $(APR)/misc/netware/apache.xdc.  XDCData can
178# be disabled by setting APACHE_UNIPROC in the environment
179#
180XDCDATA		=
181
182#
183# Declare all target files (you must add your files here)
184#
185
186#
187# If there is an NLM target, put it here
188#
189TARGET_nlm = \
190	$(OBJDIR)/aprlib.nlm \
191	$(EOLIST)
192
193#
194# If there is an LIB target, put it here
195#
196TARGET_lib = \
197	$(OBJDIR)/aprlib.lib \
198	$(EOLIST)
199
200#
201# These are the OBJ files needed to create the NLM target above.
202# Paths must all use the '/' character
203#
204FILES_nlm_objs = \
205	$(OBJDIR)/libprews.o \
206	$(EOLIST)
207
208#
209# These are the LIB files needed to create the NLM target above.
210# These will be added as a library command in the link.opt file.
211#
212FILES_nlm_libs = \
213	$(PRELUDE) \
214	$(APRLIB) \
215	$(APULIB) \
216	$(APULDAPLIB) \
217	$(APUXMLLIB) \
218	$(EOLIST)
219
220#
221# These are the modules that the above NLM target depends on to load.
222# These will be added as a module command in the link.opt file.
223#
224FILES_nlm_modules = \
225	Libc \
226	$(EOLIST)
227
228# Include the Winsock libraries if Winsock is being used
229ifndef USE_STDSOCKETS
230FILES_nlm_modules += ws2_32 \
231	$(EOLIST)
232endif
233
234#If the LDAP support is defined then add the auto-load modules
235ifneq "$(LDAPSDK)" ""
236FILES_nlm_modules += \
237	lldapsdk \
238	lldapssl \
239	$(EOLIST)
240endif
241
242#
243# If the nlm has a msg file, put it's path here
244#
245FILE_nlm_msg =
246
247#
248# If the nlm has a hlp file put it's path here
249#
250FILE_nlm_hlp =
251
252#
253# If this is specified, it will override $(NWOS)\copyright.txt.
254#
255FILE_nlm_copyright =
256
257#
258# Any additional imports go here
259#
260FILES_nlm_Ximports = \
261	@libc.imp \
262	@netware.imp \
263	$(EOLIST)
264
265# Include the Winsock imports if Winsock is being used
266ifndef USE_STDSOCKETS
267FILES_nlm_Ximports +=  \
268	@ws2nlm.imp \
269	WSAStartupRTags \
270	WSACleanupRTag \
271	$(EOLIST)
272endif
273
274#If the LDAP support is defined then add the imports
275ifneq "$(LDAPSDK)" ""
276FILES_nlm_Ximports += \
277	@lldapsdk.imp \
278	@lldapssl.imp \
279	$(EOLIST)
280endif
281
282#
283# Any symbols exported to here
284#
285FILES_nlm_exports = \
286	@aprlib.imp \
287	$(EOLIST)
288
289#
290# These are the OBJ files needed to create the LIB target above.
291# Paths must all use the '/' character
292#
293FILES_lib_objs = \
294	$(OBJDIR)/apr_atomic.o \
295	$(OBJDIR)/apr_cpystrn.o \
296	$(OBJDIR)/apr_fnmatch.o \
297	$(OBJDIR)/apr_getpass.o \
298	$(OBJDIR)/apr_hash.o \
299	$(OBJDIR)/apr_pools.o \
300	$(OBJDIR)/apr_random.o \
301	$(OBJDIR)/apr_snprintf.o \
302	$(OBJDIR)/apr_strings.o \
303	$(OBJDIR)/apr_strnatcmp.o \
304	$(OBJDIR)/apr_strtok.o \
305	$(OBJDIR)/apr_tables.o \
306	$(OBJDIR)/buffer.o \
307	$(OBJDIR)/charset.o \
308	$(OBJDIR)/copy.o \
309	$(OBJDIR)/common.o \
310	$(OBJDIR)/dir.o \
311	$(OBJDIR)/dso.o \
312	$(OBJDIR)/errorcodes.o \
313	$(OBJDIR)/env.o \
314	$(OBJDIR)/fileacc.o \
315	$(OBJDIR)/filedup.o \
316	$(OBJDIR)/filepath.o \
317	$(OBJDIR)/filepath_util.o \
318	$(OBJDIR)/filestat.o \
319	$(OBJDIR)/filesys.o \
320	$(OBJDIR)/flock.o \
321	$(OBJDIR)/fullrw.o \
322	$(OBJDIR)/getopt.o \
323	$(OBJDIR)/groupinfo.o \
324	$(OBJDIR)/inet_pton.o \
325	$(OBJDIR)/inet_ntop.o \
326	$(OBJDIR)/mktemp.o \
327	$(OBJDIR)/mmap.o \
328	$(OBJDIR)/multicast.o \
329	$(OBJDIR)/open.o \
330	$(OBJDIR)/pipe.o \
331	$(OBJDIR)/otherchild.o \
332	$(OBJDIR)/proc.o \
333	$(OBJDIR)/procsup.o \
334	$(OBJDIR)/proc_mutex.o \
335	$(OBJDIR)/rand.o \
336	$(OBJDIR)/readwrite.o \
337	$(OBJDIR)/seek.o \
338	$(OBJDIR)/pollcb.o \
339	$(OBJDIR)/pollset.o \
340	$(OBJDIR)/select.o \
341	$(OBJDIR)/sendrecv.o \
342	$(OBJDIR)/sha2.o \
343	$(OBJDIR)/sha2_glue.o \
344	$(OBJDIR)/shm.o \
345	$(OBJDIR)/signals.o \
346	$(OBJDIR)/sockaddr.o \
347	$(OBJDIR)/socket_util.o \
348	$(OBJDIR)/sockets.o \
349	$(OBJDIR)/sockopt.o \
350	$(OBJDIR)/start.o \
351	$(OBJDIR)/tempdir.o \
352	$(OBJDIR)/thread.o \
353	$(OBJDIR)/thread_cond.o \
354	$(OBJDIR)/thread_mutex.o \
355	$(OBJDIR)/thread_rwlock.o \
356	$(OBJDIR)/threadpriv.o \
357	$(OBJDIR)/time.o \
358	$(OBJDIR)/timestr.o \
359	$(OBJDIR)/userinfo.o \
360	$(OBJDIR)/version.o \
361	$(OBJDIR)/waitio.o \
362	$(EOLIST)
363
364
365#
366# implement targets and dependancies (leave this section alone)
367#
368
369libs :: $(OBJDIR) $(TARGET_lib)
370
371nlms :: libs $(TARGET_nlm)
372
373#
374# Updated this target to create necessary directories and copy files to the
375# correct place.  (See $(APR_WORK)/build/NWGNUhead.inc for examples)
376#
377install :: nlms $(INSTDIRS) FORCE
378	$(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/)
379ifndef DEST
380	-$(call COPY,$(APR)/LICENSE,$(INSTALLBASE)/)
381	-$(call COPY,$(APR)/STATUS,$(INSTALLBASE)/STATUS.apr)
382	-$(call COPY,$(APR)/CHANGES,$(INSTALLBASE)/CHANGES.apr)
383	-$(call COPY,$(APU)/STATUS,$(INSTALLBASE)/STATUS.apu)
384	-$(call COPY,$(APU)/CHANGES,$(INSTALLBASE)/CHANGES.apu)
385	-$(call COPYR,$(APR)/docs,$(INSTALLBASE)/docs/)
386endif
387
388ifndef DEST
389installdev :: $(INSTDEVDIRS) FORCE
390	$(call COPY,$(APR)/include/*.h,$(INSTALLBASE)/include/)
391	$(call COPY,$(APR)/*.imp,$(INSTALLBASE)/lib/)
392	$(call COPY,$(APR)/misc/netware/*.xdc,$(INSTALLBASE)/lib/)
393	$(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/bin/)
394	$(call COPY,$(APRLIB),$(INSTALLBASE)/lib/)
395	$(call COPY,$(APULIB),$(INSTALLBASE)/lib/)
396	$(call COPY,$(APULDAPLIB),$(INSTALLBASE)/lib/)
397	$(call COPY,$(APUXMLLIB),$(INSTALLBASE)/lib/)
398
399$(INSTDEVDIRS) ::
400	$(call MKDIR,$@)
401endif
402
403#
404# Any specialized rules here
405#
406
407vpath %.c atomic/netware:strings:tables:passwd:lib:time/unix
408vpath %.c file_io/unix:locks/netware:misc/netware:misc/unix:threadproc/netware
409vpath %.c poll/unix:shmem/unix:support/unix:random/unix
410vpath %.c dso/netware:memory/unix:mmap/unix:user/netware
411
412# Use the win32 network_io if Winsock is being used
413ifndef USE_STDSOCKETS
414vpath %.c network_io/win32
415endif
416vpath %.c network_io/unix
417
418$(OBJDIR)/%.o: file_io/netware/%.c $(OBJDIR)/$(NLM_NAME)_cc.opt
419#	@echo Compiling $<
420	@echo $(DL)CC   $<$(DL)
421	$(CC) $< -cwd source -o=$@ @$(OBJDIR)/$(NLM_NAME)_cc.opt
422
423#
424# Include the 'tail' makefile that has targets that depend on variables defined
425# in this makefile
426#
427
428include $(APRBUILD)/NWGNUtail.inc
429
430
431