1 | #
|
---|
2 | # ***** BEGIN LICENSE BLOCK *****
|
---|
3 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
4 | #
|
---|
5 | # The contents of this file are subject to the Mozilla Public License Version
|
---|
6 | # 1.1 (the "License"); you may not use this file except in compliance with
|
---|
7 | # the License. You may obtain a copy of the License at
|
---|
8 | # http://www.mozilla.org/MPL/
|
---|
9 | #
|
---|
10 | # Software distributed under the License is distributed on an "AS IS" basis,
|
---|
11 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
12 | # for the specific language governing rights and limitations under the
|
---|
13 | # License.
|
---|
14 | #
|
---|
15 | # The Original Code is the Netscape Portable Runtime (NSPR).
|
---|
16 | #
|
---|
17 | # The Initial Developer of the Original Code is
|
---|
18 | # Netscape Communications Corporation.
|
---|
19 | # Portions created by the Initial Developer are Copyright (C) 1998-2000
|
---|
20 | # the Initial Developer. All Rights Reserved.
|
---|
21 | #
|
---|
22 | # Contributor(s):
|
---|
23 | #
|
---|
24 | # Alternatively, the contents of this file may be used under the terms of
|
---|
25 | # either the GNU General Public License Version 2 or later (the "GPL"), or
|
---|
26 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
---|
27 | # in which case the provisions of the GPL or the LGPL are applicable instead
|
---|
28 | # of those above. If you wish to allow use of your version of this file only
|
---|
29 | # under the terms of either the GPL or the LGPL, and not to allow others to
|
---|
30 | # use your version of this file under the terms of the MPL, indicate your
|
---|
31 | # decision by deleting the provisions above and replace them with the notice
|
---|
32 | # and other provisions required by the GPL or the LGPL. If you do not delete
|
---|
33 | # the provisions above, a recipient may use your version of this file under
|
---|
34 | # the terms of any one of the MPL, the GPL or the LGPL.
|
---|
35 | #
|
---|
36 | # ***** END LICENSE BLOCK *****
|
---|
37 |
|
---|
38 |
|
---|
39 | #! gmake
|
---|
40 |
|
---|
41 | MOD_DEPTH = ../..
|
---|
42 | topsrcdir = @top_srcdir@
|
---|
43 | srcdir = @srcdir@
|
---|
44 | VPATH = @srcdir@
|
---|
45 |
|
---|
46 | include $(MOD_DEPTH)/config/autoconf.mk
|
---|
47 |
|
---|
48 | include $(topsrcdir)/config/config.mk
|
---|
49 |
|
---|
50 | DIRS = dll
|
---|
51 |
|
---|
52 | CSRCS = \
|
---|
53 | accept.c \
|
---|
54 | acceptread.c \
|
---|
55 | acceptreademu.c \
|
---|
56 | addrstr.c \
|
---|
57 | affinity.c \
|
---|
58 | alarm.c \
|
---|
59 | anonfm.c \
|
---|
60 | append.c \
|
---|
61 | atomic.c \
|
---|
62 | attach.c \
|
---|
63 | bigfile.c \
|
---|
64 | bigfile2.c \
|
---|
65 | bigfile3.c \
|
---|
66 | cleanup.c \
|
---|
67 | cltsrv.c \
|
---|
68 | concur.c \
|
---|
69 | cvar.c \
|
---|
70 | cvar2.c \
|
---|
71 | dceemu.c \
|
---|
72 | dlltest.c \
|
---|
73 | dtoa.c \
|
---|
74 | env.c \
|
---|
75 | errcodes.c \
|
---|
76 | errset.c \
|
---|
77 | exit.c \
|
---|
78 | fdcach.c \
|
---|
79 | fileio.c \
|
---|
80 | foreign.c \
|
---|
81 | forktest.c \
|
---|
82 | formattm.c \
|
---|
83 | fsync.c \
|
---|
84 | getai.c \
|
---|
85 | gethost.c \
|
---|
86 | getproto.c \
|
---|
87 | i2l.c \
|
---|
88 | initclk.c \
|
---|
89 | inrval.c \
|
---|
90 | instrumt.c \
|
---|
91 | intrio.c \
|
---|
92 | intrupt.c \
|
---|
93 | io_timeout.c \
|
---|
94 | ioconthr.c \
|
---|
95 | ipv6.c \
|
---|
96 | join.c \
|
---|
97 | joinkk.c \
|
---|
98 | joinku.c \
|
---|
99 | joinuk.c \
|
---|
100 | joinuu.c \
|
---|
101 | layer.c \
|
---|
102 | lazyinit.c \
|
---|
103 | libfilename.c \
|
---|
104 | lltest.c \
|
---|
105 | lock.c \
|
---|
106 | lockfile.c \
|
---|
107 | logger.c \
|
---|
108 | makedir.c \
|
---|
109 | mbcs.c \
|
---|
110 | multiacc.c \
|
---|
111 | multiwait.c \
|
---|
112 | many_cv.c \
|
---|
113 | nameshm1.c \
|
---|
114 | nbconn.c \
|
---|
115 | nblayer.c \
|
---|
116 | nonblock.c \
|
---|
117 | ntioto.c \
|
---|
118 | ntoh.c \
|
---|
119 | obsints.c \
|
---|
120 | op_2long.c \
|
---|
121 | op_excl.c \
|
---|
122 | op_filnf.c \
|
---|
123 | op_filok.c \
|
---|
124 | op_noacc.c \
|
---|
125 | op_nofil.c \
|
---|
126 | openfile.c \
|
---|
127 | parent.c \
|
---|
128 | peek.c \
|
---|
129 | perf.c \
|
---|
130 | pipeping.c \
|
---|
131 | pipeping2.c \
|
---|
132 | pipepong.c \
|
---|
133 | pipepong2.c \
|
---|
134 | pipeself.c \
|
---|
135 | poll_er.c \
|
---|
136 | poll_nm.c \
|
---|
137 | poll_to.c \
|
---|
138 | pollable.c \
|
---|
139 | prftest.c \
|
---|
140 | prftest1.c \
|
---|
141 | prftest2.c \
|
---|
142 | primblok.c \
|
---|
143 | priotest.c \
|
---|
144 | provider.c \
|
---|
145 | prpoll.c \
|
---|
146 | prpollml.c \
|
---|
147 | ranfile.c \
|
---|
148 | randseed.c \
|
---|
149 | rmdir.c \
|
---|
150 | rwlocktest.c \
|
---|
151 | sel_spd.c \
|
---|
152 | selct_er.c \
|
---|
153 | selct_nm.c \
|
---|
154 | selct_to.c \
|
---|
155 | select2.c \
|
---|
156 | selintr.c \
|
---|
157 | sem.c \
|
---|
158 | sema.c \
|
---|
159 | semaerr.c \
|
---|
160 | semaerr1.c \
|
---|
161 | semaping.c \
|
---|
162 | semapong.c \
|
---|
163 | sendzlf.c \
|
---|
164 | server_test.c \
|
---|
165 | servr_kk.c \
|
---|
166 | servr_ku.c \
|
---|
167 | servr_uk.c \
|
---|
168 | servr_uu.c \
|
---|
169 | short_thread.c \
|
---|
170 | sigpipe.c \
|
---|
171 | socket.c \
|
---|
172 | sockopt.c \
|
---|
173 | sockping.c \
|
---|
174 | sockpong.c \
|
---|
175 | sprintf.c \
|
---|
176 | sproc_ch.c \
|
---|
177 | sproc_p.c \
|
---|
178 | stack.c \
|
---|
179 | stdio.c \
|
---|
180 | str2addr.c \
|
---|
181 | strod.c \
|
---|
182 | suspend.c \
|
---|
183 | switch.c \
|
---|
184 | system.c \
|
---|
185 | testbit.c \
|
---|
186 | testfile.c \
|
---|
187 | thrpool_server.c \
|
---|
188 | thrpool_client.c \
|
---|
189 | threads.c \
|
---|
190 | thruput.c \
|
---|
191 | timemac.c \
|
---|
192 | timetest.c \
|
---|
193 | tmoacc.c \
|
---|
194 | tmocon.c \
|
---|
195 | tpd.c \
|
---|
196 | vercheck.c \
|
---|
197 | version.c \
|
---|
198 | udpsrv.c \
|
---|
199 | writev.c \
|
---|
200 | xnotify.c \
|
---|
201 | y2k.c \
|
---|
202 | y2ktmo.c \
|
---|
203 | zerolen.c \
|
---|
204 | $(NULL)
|
---|
205 |
|
---|
206 | ifeq ($(OS_TARGET),OS2)
|
---|
207 | CSRCS += \
|
---|
208 | sleep.c \
|
---|
209 | stat.c \
|
---|
210 | yield.c \
|
---|
211 | $(NULL)
|
---|
212 | endif
|
---|
213 |
|
---|
214 | ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
---|
215 | PROG_SUFFIX = .exe
|
---|
216 | else
|
---|
217 | PROG_SUFFIX =
|
---|
218 | endif
|
---|
219 |
|
---|
220 | PROGS = $(addprefix $(OBJDIR)/, $(CSRCS:.c=$(PROG_SUFFIX)))
|
---|
221 |
|
---|
222 | TARGETS = $(PROGS)
|
---|
223 |
|
---|
224 | INCLUDES = -I$(dist_includedir) -I$(topsrcdir)/pr/include -I$(topsrcdir)/pr/include/private
|
---|
225 |
|
---|
226 | ifeq ($(OS_ARCH), WINNT)
|
---|
227 | ifdef NS_USE_GCC
|
---|
228 | EXTRA_LIBS += -lwsock32
|
---|
229 | else
|
---|
230 | EXTRA_LIBS += wsock32.lib
|
---|
231 | LDOPTS = -NOLOGO -DEBUG -DEBUGTYPE:CV -INCREMENTAL:NO
|
---|
232 | ifdef PROFILE
|
---|
233 | LDOPTS += -PROFILE -MAP
|
---|
234 | endif # profile
|
---|
235 | endif # NS_USE_GCC
|
---|
236 | endif
|
---|
237 |
|
---|
238 | ifeq ($(OS_ARCH),OS2)
|
---|
239 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
240 | LDOPTS = -NOE -DEBUG -nologo -PMTYPE:VIO
|
---|
241 | else
|
---|
242 | EXTRA_LIBS = $(OS_LIBS)
|
---|
243 | LDOPTS = -Zomf -Zlinker /PM:VIO -Zlinker /ST:0x64000
|
---|
244 | endif
|
---|
245 | endif
|
---|
246 |
|
---|
247 | ifneq ($(OS_ARCH), WINNT)
|
---|
248 | # Use an absolute pathname as the runtime library path (for the -R
|
---|
249 | # or -rpath linker option or the LD_RUN_PATH environment variable).
|
---|
250 | ifeq (,$(patsubst /%,,$(DIST)))
|
---|
251 | # $(DIST) is already an absolute pathname.
|
---|
252 | ABSOLUTE_LIB_DIR = $(dist_libdir)
|
---|
253 | else
|
---|
254 | # $(DIST) is a relative pathname: prepend the current directory.
|
---|
255 | PWD = $(shell pwd)
|
---|
256 | ABSOLUTE_LIB_DIR = $(PWD)/$(dist_libdir)
|
---|
257 | endif
|
---|
258 | endif
|
---|
259 |
|
---|
260 | ifeq ($(OS_ARCH), IRIX)
|
---|
261 | ifeq ($(USE_CPLUS), 1)
|
---|
262 | CC = CC
|
---|
263 | endif
|
---|
264 | LDOPTS += -rpath $(ABSOLUTE_LIB_DIR)
|
---|
265 | ifdef NS_USE_GCC
|
---|
266 | LDOPTS += -Wl,-rdata_shared
|
---|
267 | else
|
---|
268 | LDOPTS += -rdata_shared
|
---|
269 | endif
|
---|
270 | # For 6.x machines, include this flag
|
---|
271 | ifeq ($(basename $(OS_RELEASE)),6)
|
---|
272 | ifndef NS_USE_GCC
|
---|
273 | ifeq ($(USE_N32),1)
|
---|
274 | LDOPTS += -n32
|
---|
275 | else
|
---|
276 | LDOPTS += -32
|
---|
277 | endif
|
---|
278 |
|
---|
279 | ifeq ($(USE_PTHREADS), 1)
|
---|
280 | ifeq ($(OS_RELEASE), 6.2)
|
---|
281 | LDOPTS += -Wl,-woff,85
|
---|
282 | endif
|
---|
283 | endif
|
---|
284 | endif
|
---|
285 | endif
|
---|
286 | endif
|
---|
287 |
|
---|
288 | ifeq ($(OS_ARCH), OSF1)
|
---|
289 | ifeq ($(USE_CPLUS), 1)
|
---|
290 | CC = cxx
|
---|
291 | endif
|
---|
292 | # I haven't figured out how to pass -rpath to cc on OSF1 V3.2, so
|
---|
293 | # we do static linking.
|
---|
294 | ifeq (,$(filter-out V2.0 V3.2,$(OS_RELEASE)))
|
---|
295 | LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
|
---|
296 | LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
|
---|
297 | EXTRA_LIBS = -lc_r
|
---|
298 | else
|
---|
299 | LDOPTS += -rpath $(ABSOLUTE_LIB_DIR)
|
---|
300 | endif
|
---|
301 | endif
|
---|
302 |
|
---|
303 | ifeq ($(OS_ARCH), HP-UX)
|
---|
304 | LDOPTS += -z -Wl,+s,+b,$(ABSOLUTE_LIB_DIR)
|
---|
305 | ifeq ($(USE_64),1)
|
---|
306 | LDOPTS += +DD64
|
---|
307 | endif
|
---|
308 | ifeq ($(USE_PTHREADS),1)
|
---|
309 | EXTRA_LIBS = $(LIBPTHREAD)
|
---|
310 | endif
|
---|
311 | endif
|
---|
312 |
|
---|
313 | # AIX
|
---|
314 | ifeq ($(OS_ARCH),AIX)
|
---|
315 | LDOPTS += -blibpath:$(ABSOLUTE_LIB_DIR):/usr/lib:/lib
|
---|
316 | ifneq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
|
---|
317 | LDOPTS += -brtl
|
---|
318 | EXTRA_LIBS = -ldl
|
---|
319 | endif
|
---|
320 | endif
|
---|
321 |
|
---|
322 | # Solaris
|
---|
323 | ifeq ($(OS_ARCH), SunOS)
|
---|
324 | ifneq ($(OS_RELEASE), 4.1.3_U1)
|
---|
325 | ifdef NS_USE_GCC
|
---|
326 | LDOPTS += -Xlinker -R -Xlinker $(ABSOLUTE_LIB_DIR)
|
---|
327 | else
|
---|
328 | ifeq ($(USE_CPLUS), 1)
|
---|
329 | CC = CC
|
---|
330 | endif
|
---|
331 | LDOPTS += -R $(ABSOLUTE_LIB_DIR)
|
---|
332 | endif
|
---|
333 | endif
|
---|
334 |
|
---|
335 | ifneq ($(LOCAL_THREADS_ONLY),1)
|
---|
336 | ifdef USE_PTHREADS
|
---|
337 | EXTRA_LIBS = -lpthread -lthread
|
---|
338 | else
|
---|
339 | EXTRA_LIBS = -lthread
|
---|
340 | endif
|
---|
341 | endif # LOCAL_THREADS_ONLY
|
---|
342 | endif # SunOS
|
---|
343 |
|
---|
344 | ifeq ($(OS_ARCH), NEC)
|
---|
345 | EXTRA_LIBS = $(OS_LIBS)
|
---|
346 | # This hardcodes in the executable programs the directory to find
|
---|
347 | # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
|
---|
348 | # option for ld on other platforms.
|
---|
349 | export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
|
---|
350 | endif
|
---|
351 |
|
---|
352 | ifeq ($(OS_ARCH), NCR)
|
---|
353 | # NCR needs to link against -lsocket -lnsl -ldl (and -lc, which is
|
---|
354 | # linked implicitly by $(CC)). Note that we did not link with these
|
---|
355 | # system libraries when we built libnspr.so.
|
---|
356 | EXTRA_LIBS = -lsocket -lnsl -ldl
|
---|
357 | # This hardcodes in the executable programs the directory to find
|
---|
358 | # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
|
---|
359 | # option for ld on other platforms.
|
---|
360 | export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
|
---|
361 | endif
|
---|
362 |
|
---|
363 | ifeq ($(OS_ARCH), NEXTSTEP)
|
---|
364 | # [email protected]: linkage is done in a different pass in the `tests'
|
---|
365 | # modeul, so we have to pass the `-posix' flag by "hand" to `ld'
|
---|
366 | LDOPTS += -posix
|
---|
367 | endif
|
---|
368 |
|
---|
369 | ifeq ($(OS_ARCH), NEWS-OS)
|
---|
370 | # This hardcodes in the executable programs the directory to find
|
---|
371 | # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
|
---|
372 | # option for ld on other platforms.
|
---|
373 | #export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
|
---|
374 | LIBNSPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
|
---|
375 | LIBPLC = $(dist_libdir)/libplc$(MOD_MAJOR_VERSION).a
|
---|
376 | EXTRA_LIBS = -lsocket -lnsl -lgen -lresolv
|
---|
377 | endif
|
---|
378 |
|
---|
379 | ifeq ($(OS_ARCH), Linux)
|
---|
380 | ifeq ($(OS_RELEASE), 1.2)
|
---|
381 | EXTRA_LIBS = -ldl
|
---|
382 | else
|
---|
383 | LDOPTS += -Xlinker -rpath $(ABSOLUTE_LIB_DIR)
|
---|
384 | ifeq ($(USE_PTHREADS),1)
|
---|
385 | EXTRA_LIBS = -lpthread
|
---|
386 | endif
|
---|
387 | endif
|
---|
388 | endif
|
---|
389 |
|
---|
390 | ifeq ($(OS_ARCH), SCOOS)
|
---|
391 | # SCO Unix needs to link against -lsocket again even though we
|
---|
392 | # already linked with these system libraries when we built libnspr.so.
|
---|
393 | EXTRA_LIBS = -lsocket
|
---|
394 | # This hardcodes in the executable programs the directory to find
|
---|
395 | # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
|
---|
396 | # option for ld on other platforms.
|
---|
397 | export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
|
---|
398 | endif
|
---|
399 |
|
---|
400 | ifeq ($(OS_ARCH),SINIX)
|
---|
401 | EXTRA_LIBS = -lsocket -lnsl -lresolv -ldl
|
---|
402 | # This hardcodes in the executable programs the directory to find
|
---|
403 | # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
|
---|
404 | # option for ld on other platforms.
|
---|
405 | export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
|
---|
406 | endif
|
---|
407 |
|
---|
408 | ifeq ($(OS_ARCH),OpenUNIX)
|
---|
409 | export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
|
---|
410 | ifeq ($(USE_PTHREADS),1)
|
---|
411 | LDOPTS += -pthread
|
---|
412 | endif
|
---|
413 | endif
|
---|
414 |
|
---|
415 | ifeq ($(OS_ARCH), UNIXWARE)
|
---|
416 | export LD_RUN_PATH = $(ABSOLUTE_LIB_DIR)
|
---|
417 | endif
|
---|
418 |
|
---|
419 | ifeq ($(OS_ARCH),FreeBSD)
|
---|
420 | ifeq ($(USE_PTHREADS),1)
|
---|
421 | LDOPTS += -pthread
|
---|
422 | endif
|
---|
423 | LDOPTS += -Xlinker -R $(ABSOLUTE_LIB_DIR)
|
---|
424 | endif
|
---|
425 |
|
---|
426 | ifeq ($(OS_ARCH),OpenBSD)
|
---|
427 | ifeq ($(USE_PTHREADS),1)
|
---|
428 | LDOPTS += -pthread
|
---|
429 | endif
|
---|
430 | endif
|
---|
431 |
|
---|
432 | ifeq ($(OS_ARCH),BSD_OS)
|
---|
433 | ifneq ($(OS_RELEASE),1.1)
|
---|
434 | EXTRA_LIBS = -ldl
|
---|
435 | endif
|
---|
436 | endif
|
---|
437 |
|
---|
438 | ifeq ($(USE_PTHREADS),1)
|
---|
439 | LIBPTHREAD = -lpthread
|
---|
440 | ifeq ($(OS_ARCH),AIX)
|
---|
441 | LIBPTHREAD = -lpthreads
|
---|
442 | endif
|
---|
443 | ifeq (,$(filter-out FreeBSD OpenBSD BSD_OS QNX Darwin OpenUNIX,$(OS_ARCH)))
|
---|
444 | LIBPTHREAD =
|
---|
445 | endif
|
---|
446 | ifeq ($(OS_ARCH)$(basename $(OS_RELEASE)),HP-UXB.10)
|
---|
447 | LIBPTHREAD = -ldce
|
---|
448 | endif
|
---|
449 | endif
|
---|
450 |
|
---|
451 |
|
---|
452 | #####################################################
|
---|
453 | #
|
---|
454 | # The rules
|
---|
455 | #
|
---|
456 | #####################################################
|
---|
457 |
|
---|
458 | include $(topsrcdir)/config/rules.mk
|
---|
459 |
|
---|
460 | AIX_PRE_4_2 = 0
|
---|
461 | ifeq ($(OS_ARCH),AIX)
|
---|
462 | ifeq ($(OS_RELEASE),4.1)
|
---|
463 | ifneq ($(USE_PTHREADS), 1)
|
---|
464 | #AIX_PRE_4_2 = 1
|
---|
465 | endif
|
---|
466 | endif
|
---|
467 | endif
|
---|
468 |
|
---|
469 | ifeq ($(AIX_PRE_4_2),1)
|
---|
470 |
|
---|
471 | # AIX releases prior to 4.2 need a special two-step linking hack
|
---|
472 | # in order to both override the system select() and be able to
|
---|
473 | # get at the original system select().
|
---|
474 | #
|
---|
475 | # We use a pattern rule in ns/nspr20/config/rules.mk to generate
|
---|
476 | # the .$(OBJ_SUFFIX) file from the .c source file, then do the
|
---|
477 | # two-step linking hack below.
|
---|
478 |
|
---|
479 | $(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
|
---|
480 | @$(MAKE_OBJDIR)
|
---|
481 | rm -f $@ $(AIX_TMP)
|
---|
482 | $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
|
---|
483 | $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
|
---|
484 | rm -f $(AIX_TMP)
|
---|
485 |
|
---|
486 | else
|
---|
487 |
|
---|
488 | # All platforms that are not AIX pre-4.2.
|
---|
489 |
|
---|
490 | $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
|
---|
491 | @$(MAKE_OBJDIR)
|
---|
492 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
493 | link $(LDOPTS) $(EXTRA_LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -out:$@
|
---|
494 | else
|
---|
495 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
496 | $(LD) $(EXEFLAGS) $(LDOPTS) $< $(LIBPLC) $(LIBNSPR) $(OS_LIBS) $(EXTRA_LIBS)
|
---|
497 | else
|
---|
498 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(EXTRA_LIBS) -o $@
|
---|
499 | endif # OS/2
|
---|
500 | endif # WINNT
|
---|
501 | endif # AIX_PRE_4_2
|
---|
502 |
|
---|
503 | export:: $(TARGETS)
|
---|
504 | clean::
|
---|
505 | rm -f $(TARGETS)
|
---|
506 |
|
---|
507 | # The following tests call BSD socket functions, so they need to link
|
---|
508 | # with -lsocket on some platforms.
|
---|
509 | ifeq ($(OS_ARCH),SunOS)
|
---|
510 | ifneq ($(OS_RELEASE),4.1.3_U1)
|
---|
511 | ifeq ($(USE_IPV6),1)
|
---|
512 | $(OBJDIR)/gethost: $(OBJDIR)/gethost.o
|
---|
513 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
|
---|
514 | endif
|
---|
515 | $(OBJDIR)/prpoll: $(OBJDIR)/prpoll.o
|
---|
516 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) -lsocket $(EXTRA_LIBS) -o $@
|
---|
517 | endif
|
---|
518 | endif
|
---|
519 |
|
---|
520 | ifeq ($(USE_PTHREADS), 1)
|
---|
521 | $(OBJDIR)/attach: $(OBJDIR)/attach.o
|
---|
522 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
|
---|
523 | $(OBJDIR)/foreign: $(OBJDIR)/foreign.o
|
---|
524 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
|
---|
525 | $(OBJDIR)/provider: $(OBJDIR)/provider.o
|
---|
526 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
|
---|
527 | $(OBJDIR)/socket: $(OBJDIR)/socket.o
|
---|
528 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
|
---|
529 | $(OBJDIR)/testfile: $(OBJDIR)/testfile.o
|
---|
530 | $(PURE) $(CC) $(XCFLAGS) $< $(LDOPTS) $(LIBPLC) $(LIBNSPR) $(LIBPTHREAD) $(EXTRA_LIBS) -o $@
|
---|
531 | endif
|
---|
532 |
|
---|
533 | #
|
---|
534 | # Run the test programs with no arguments
|
---|
535 | #
|
---|
536 | # Test output goes to the file pointed to by the environment variable
|
---|
537 | # NSPR_TEST_LOGFILE, if set, else to /dev/null
|
---|
538 | #
|
---|
539 | ECHO = echo
|
---|
540 | PROGRAMS = $(notdir $(PROGS))
|
---|
541 | ifdef NSPR_TEST_LOGFILE
|
---|
542 | LOGFILE = $(NSPR_TEST_LOGFILE)
|
---|
543 | else
|
---|
544 | ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
---|
545 | LOGFILE = nul
|
---|
546 | else
|
---|
547 | LOGFILE = /dev/null
|
---|
548 | endif
|
---|
549 | endif
|
---|
550 |
|
---|
551 | ifeq ($(OS_TARGET),Linux)
|
---|
552 | ECHO = /bin/echo
|
---|
553 | endif
|
---|
554 |
|
---|
555 | ALWAYS:
|
---|
556 |
|
---|
557 | runtests:: $(PROGS) ALWAYS
|
---|
558 | @$(ECHO) "\nNSPR Test Results - $(OBJDIR)\n"
|
---|
559 | @$(ECHO) "BEGIN\t\t\t`date`"
|
---|
560 | @$(ECHO) "NSPR_TEST_LOGFILE\t$(LOGFILE)\n"
|
---|
561 | @$(ECHO) "Test\t\t\tResult\n"
|
---|
562 | @cd $(OBJDIR); for i in $(PROGRAMS); do \
|
---|
563 | $(ECHO) "$$i\c"; \
|
---|
564 | ./$$i >> $(LOGFILE) 2>&1 ; \
|
---|
565 | if [ 0 = $$? ] ; then \
|
---|
566 | $(ECHO) "\t\t\tPassed"; \
|
---|
567 | else \
|
---|
568 | $(ECHO) "\t\t\tFAILED"; \
|
---|
569 | fi; \
|
---|
570 | done
|
---|
571 | @$(ECHO) "\nEND\t\t`date`\n"
|
---|