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