]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/apr/NWGNUmakefile
MFC r368207,368607:
[FreeBSD/stable/10.git] / contrib / apr / NWGNUmakefile
1 #
2 # Define our macros with defaults if we dont got them already.
3 #
4 ifndef APR_WORK
5 export APR_WORK = $(CURDIR)
6 endif
7 ifneq "$(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) 
9 endif
10 ifndef APU_WORK
11 export APU_WORK = $(CURDIR)/../apr-util
12 endif
13 ifneq "$(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) 
15 endif
16
17 #
18 # Declare the sub-directories to be built here
19 #
20
21 SUBDIRS = \
22                 build \
23                 $(APU_WORK) \
24                 $(EOLIST)
25
26 ifeq "$(TEST)" "1"
27 SUBDIRS += \
28                 test \
29                 $(APU_WORK)/test \
30                 $(EOLIST)
31 endif
32
33 #
34 # Get the 'head' of the build environment.  This includes default targets and
35 # paths to tools
36 #
37
38 include $(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 #
51 XINCDIRS        += \
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 #
66 XCFLAGS         += \
67                         $(EOLIST)
68
69 #
70 # These defines will come after DEFINES
71 #
72 XDEFINES        += \
73                         $(EOLIST)
74
75 #
76 # These flags will be added to the link.opt file
77 #
78 XLFLAGS         += \
79                         $(EOLIST)
80
81 #
82 # These values will be appended to the correct variables based on the value of
83 # RELEASE
84 #
85 ifeq "$(RELEASE)" "debug"
86 XINCDIRS        += \
87                         $(EOLIST)
88
89 XCFLAGS         += \
90                         $(EOLIST)
91
92 XDEFINES        += \
93                         $(EOLIST)
94
95 XLFLAGS         += \
96                         $(EOLIST)
97 endif
98
99 ifeq "$(RELEASE)" "noopt"
100 XINCDIRS        += \
101                         $(EOLIST)
102
103 XCFLAGS         += \
104                         $(EOLIST)
105
106 XDEFINES        += \
107                         $(EOLIST)
108
109 XLFLAGS         += \
110                         $(EOLIST)
111 endif
112
113 ifeq "$(RELEASE)" "release"
114 XINCDIRS        += \
115                         $(EOLIST)
116
117 XCFLAGS         += \
118                         $(EOLIST)
119
120 XDEFINES        += \
121                         $(EOLIST)
122
123 XLFLAGS         += \
124                         $(EOLIST)
125 endif
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 #
132 NLM_NAME        = aprlib
133
134 #
135 # This is used by the link '-desc ' directive.
136 # If left blank, NLM_NAME will be used.
137 #
138 NLM_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 #
144 NLM_THREAD_NAME =
145 #
146 # If this is specified, it will override VERSION value in
147 # $(APR_WORK)/build/NWGNUenvironment.inc
148 #
149 NLM_VERSION     =
150
151 #
152 # If this is specified, it will override the default of 64K
153 #
154 NLM_STACK_SIZE  =
155
156 #
157 # If this is specified it will be used by the link '-entry' directive
158 #
159 NLM_ENTRY_SYM   =
160
161 #
162 # If this is specified it will be used by the link '-exit' directive
163 #
164 NLM_EXIT_SYM    =
165
166 #
167 # If this is specified it will be used by the link '-check' directive
168 #
169 NLM_CHECK_SYM   =
170
171 #
172 # If this is specified it will be used by the link '-flags' directive
173 #
174 NLM_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 #
181 XDCDATA         =
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 #
190 TARGET_nlm = \
191         $(OBJDIR)/aprlib.nlm \
192         $(EOLIST)
193
194 #
195 # If there is an LIB target, put it here
196 #
197 TARGET_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 #
205 FILES_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 #
213 FILES_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 #
225 FILES_nlm_modules = \
226         Libc \
227         $(EOLIST)
228
229 # Include the Winsock libraries if Winsock is being used
230 ifndef USE_STDSOCKETS
231 FILES_nlm_modules += ws2_32 \
232         $(EOLIST)
233 endif
234
235 #If the LDAP support is defined then add the auto-load modules
236 ifneq "$(LDAPSDK)" ""
237 FILES_nlm_modules += \
238         lldapsdk \
239         lldapssl \
240         $(EOLIST)
241 endif
242
243 #
244 # If the nlm has a msg file, put it's path here
245 #
246 FILE_nlm_msg =
247
248 #
249 # If the nlm has a hlp file put it's path here
250 #
251 FILE_nlm_hlp =
252
253 #
254 # If this is specified, it will override $(NWOS)\copyright.txt.
255 #
256 FILE_nlm_copyright =
257
258 #
259 # Any additional imports go here
260 #
261 FILES_nlm_Ximports = \
262         @libc.imp \
263         @netware.imp \
264         $(EOLIST)
265
266 # Include the Winsock imports if Winsock is being used
267 ifndef USE_STDSOCKETS
268 FILES_nlm_Ximports +=  \
269         @ws2nlm.imp \
270         WSAStartupRTags \
271         WSACleanupRTag \
272         $(EOLIST)
273 endif
274
275 #If the LDAP support is defined then add the imports
276 ifneq "$(LDAPSDK)" ""
277 FILES_nlm_Ximports += \
278         @lldapsdk.imp \
279         @lldapssl.imp \
280         $(EOLIST)
281 endif
282
283 #
284 # Any symbols exported to here
285 #
286 FILES_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 #
294 FILES_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
372 libs :: $(OBJDIR) $(TARGET_lib)
373
374 nlms :: 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 #
380 install :: nlms $(INSTDIRS) FORCE
381         $(call COPY,$(APR)/$(TARGET_nlm),$(INSTALLBASE)/)
382 ifndef 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/)
389 endif
390
391 ifndef DEST
392 installdev :: $(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,$@)
404 endif
405
406 #
407 # Any specialized rules here
408 #
409
410 vpath %.c atomic/netware:strings:tables:passwd:lib:time/unix
411 vpath %.c file_io/unix:locks/netware:misc/netware:misc/unix:threadproc/netware
412 vpath %.c poll/unix:shmem/unix:support/unix:random/unix
413 vpath %.c dso/netware:memory/unix:mmap/unix:user/netware:encoding
414
415 # Use the win32 network_io if Winsock is being used
416 ifndef USE_STDSOCKETS
417 vpath %.c network_io/win32
418 endif
419 vpath %.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
431 include $(APRBUILD)/NWGNUtail.inc
432
433