Debian Codegraph @

nsprpub/lib/prstreams/tests/testprstrm/Makefile.in

raw
1 #
2 # This Source Code Form is subject to the terms of the Mozilla Public
3 # License, v. 2.0. If a copy of the MPL was not distributed with this
4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
5
6 #! gmake
7
8 MOD_DEPTH = ../../../..
9 topsrcdir = @top_srcdir@
10 srcdir = @srcdir@
11 VPATH = @srcdir@
12
13 include $(MOD_DEPTH)/config/autoconf.mk
14
15 include $(topsrcdir)/config/config.mk
16
17 CXXSRCS = \
18 testprstrm.cpp \
19 $(NULL)
20
21 OBJS = $(addprefix $(OBJDIR)/,$(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
22
23 ifeq (,$(filter-out WINNT,$(OS_ARCH)))
24 PROG_SUFFIX = .exe
25 else
26 PROG_SUFFIX =
27 endif
28
29 PROGS = $(addprefix $(OBJDIR)/, $(CXXSRCS:.cpp=$(PROG_SUFFIX)))
30
31 TARGETS = $(PROGS) $(OBJS)
32
33 INCLUDES = -I$(dist_includedir)
34
35 # Setting the variables LDOPTS and LIBPR. We first initialize
36 # them to the default values, then adjust them for some platforms.
37 LDOPTS = -L$(dist_libdir)
38 LIBPR = -lnspr$(MOD_MAJOR_VERSION)
39 LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSION)
40
41 ifeq ($(OS_ARCH), WINNT)
42 LDOPTS = -NOLOGO -DEBUG -INCREMENTAL:NO
43 ifeq ($(OS_TARGET), WIN95)
44 LIBPR = $(dist_libdir)/nspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
45 LIBPRSTRMS = $(dist_libdir)/prstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
46 else
47 LIBPR = $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
48 LIBPRSTRMS = $(dist_libdir)/libprstrms$(MOD_MAJOR_VERSION).$(LIB_SUFFIX)
49 endif
50 endif
51
52 ifneq ($(OS_ARCH), WINNT)
53 PWD = $(shell pwd)
54 endif
55
56 ifeq ($(OS_ARCH), HP-UX)
57 LDOPTS += -Wl,+s,+b,$(PWD)/$(dist_libdir)
58 endif
59
60 # AIX
61 ifeq ($(OS_ARCH),AIX)
62 LDOPTS += -blibpath:$(PWD)/$(dist_libdir):/usr/lib:/lib
63 ifeq ($(OS_ARCH)$(OS_RELEASE),AIX4.1)
64 LIBPR = -lnspr$(MOD_MAJOR_VERSION)_shr
65 LIBPRSTRMS = -lprstrms$(MOD_MAJOR_VERSION)_shr
66 else
67 LDOPTS += -brtl
68 EXTRA_LIBS = -ldl
69 endif
70 endif
71
72 # Solaris
73 ifeq ($(OS_ARCH), SunOS)
74 ifdef NS_USE_GCC
75 LDOPTS += -Xlinker -R -Xlinker $(PWD)/$(dist_libdir)
76 else
77 LDOPTS += -R $(PWD)/$(dist_libdir)
78 # CC on SunOS 5.5.x needs to link with -lpthread even though we already
79 # linked with this system library when we built libnspr.so.
80 ifdef USE_PTHREADS
81 EXTRA_LIBS = -lpthread
82 endif # USE_PTHREADS
83 endif # NS_USE_GCC
84 endif # SunOS
85
86 ifeq ($(OS_ARCH), SCOOS)
87 # SCO Unix needs to link against -lsocket again even though we
88 # already linked with these system libraries when we built libnspr.so.
89 EXTRA_LIBS = -lsocket
90 # This hardcodes in the executable programs the directory to find
91 # libnspr.so etc. at program startup. Equivalent to the -R or -rpath
92 # option for ld on other platforms.
93 export LD_RUN_PATH = $(PWD)/$(dist_libdir)
94 endif
95
96 #####################################################
97 #
98 # The rules
99 #
100 #####################################################
101
102 include $(topsrcdir)/config/rules.mk
103
104 AIX_PRE_4_2 = 0
105 ifeq ($(OS_ARCH),AIX)
106 ifneq ($(OS_RELEASE),4.2)
107 ifneq ($(USE_PTHREADS), 1)
108 #AIX_PRE_4_2 = 1
109 endif
110 endif
111 endif
112
113 ifeq ($(AIX_PRE_4_2),1)
114
115 # AIX releases prior to 4.2 need a special two-step linking hack
116 # in order to both override the system select() and be able to
117 # get at the original system select().
118 #
119 # We use a pattern rule in ns/nspr20/config/rules.mk to generate
120 # the .$(OBJ_SUFFIX) file from the .c source file, then do the
121 # two-step linking hack below.
122
123 $(OBJDIR)/%: $(OBJDIR)/%.$(OBJ_SUFFIX)
124 @$(MAKE_OBJDIR)
125 rm -f $@ $(AIX_TMP)
126 $(CC) $(AIX_LINK_OPTS) -o $(AIX_TMP) $< $(dist_libdir)/libnspr$(MOD_MAJOR_VERSION).a
127 $(CC) -o $@ $(AIX_TMP) $(AIX_WRAP)
128 rm -f $(AIX_TMP)
129
130 else
131
132 # All platforms that are not AIX pre-4.2.
133
134 $(OBJDIR)/%$(PROG_SUFFIX): $(OBJDIR)/%.$(OBJ_SUFFIX)
135 @$(MAKE_OBJDIR)
136 ifeq ($(OS_ARCH), WINNT)
137 link $(LDOPTS) $< $(LIBPR) $(LIBPRSTRMS) ws2_32.lib -out:$@
138 else
139 $(CCC) $(XCFLAGS) $< $(LDOPTS) $(LIBPR) $(LIBPRSTRMS) $(EXTRA_LIBS) -o $@
140 endif
141 endif
142
143 export:: $(TARGETS)
144 clean::
145 rm -f $(TARGETS)
146
147 testlinker:
148 echo $(LINK)