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