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 | #! gmake
|
---|
39 |
|
---|
40 | MOD_DEPTH = ../..
|
---|
41 | topsrcdir = @top_srcdir@
|
---|
42 | srcdir = @srcdir@
|
---|
43 | VPATH = @srcdir@
|
---|
44 |
|
---|
45 | include $(MOD_DEPTH)/config/autoconf.mk
|
---|
46 |
|
---|
47 | include $(topsrcdir)/config/config.mk
|
---|
48 |
|
---|
49 | # Disable optimization of the nspr on SunOS4.1.3
|
---|
50 | ifeq ($(OS_ARCH),SunOS)
|
---|
51 | ifeq ($(OS_RELEASE),4.1.3_U1)
|
---|
52 | OPTIMIZER =
|
---|
53 | else
|
---|
54 | # The C++ compiler in Workshop 5.0 uses standard
|
---|
55 | # iostreams as default. -library=iostream will
|
---|
56 | # allow Workshop 5.0 to work with classic iostreams.
|
---|
57 | ifndef NS_USE_GCC
|
---|
58 | CCC_VERSION := $(shell $(CCC) -V 2>&1)
|
---|
59 | ifneq (,$(findstring 5.0,$(CCC_VERSION)))
|
---|
60 | CCC_ONLY_FLAGS += -library=iostream
|
---|
61 | endif
|
---|
62 | endif
|
---|
63 | endif
|
---|
64 | endif
|
---|
65 |
|
---|
66 | ifeq ($(OS_ARCH), IRIX)
|
---|
67 | ifneq ($(OS_RELEASE),5.3)
|
---|
68 | CCC_ONLY_FLAGS += -exceptions
|
---|
69 | endif
|
---|
70 | endif
|
---|
71 |
|
---|
72 | ifeq ($(OS_ARCH), BeOS)
|
---|
73 | CFLAGS += -frtti -fexceptions
|
---|
74 | endif
|
---|
75 |
|
---|
76 | INCLUDES = -I$(dist_includedir)
|
---|
77 |
|
---|
78 | HEADERS = $(wildcard $(srcdir)/*.h)
|
---|
79 |
|
---|
80 | CSRCS = \
|
---|
81 | plvrsion.c \
|
---|
82 | $(NULL)
|
---|
83 |
|
---|
84 | CXXSRCS = \
|
---|
85 | prstrms.cpp \
|
---|
86 | $(NULL)
|
---|
87 |
|
---|
88 | OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX)) $(CXXSRCS:.cpp=.$(OBJ_SUFFIX)))
|
---|
89 |
|
---|
90 | ifeq ($(OS_ARCH), WINNT)
|
---|
91 | DLLBASE=/BASE:0x30000000
|
---|
92 | RES=$(OBJDIR)/prstrms.res
|
---|
93 | RESNAME=prstrms.rc
|
---|
94 | OS_LIBS = user32.lib
|
---|
95 | else
|
---|
96 | ifeq ($(OS_ARCH),OS2)
|
---|
97 | ifneq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
98 | OS_LIBS = -lstdcpp
|
---|
99 | endif
|
---|
100 | else
|
---|
101 | ifeq ($(OS_ARCH), AIX)
|
---|
102 | ifeq ($(OS_RELEASE), 4.1)
|
---|
103 | ifeq ($(CLASSIC_NSPR),1)
|
---|
104 | OS_LIBS += -lC -lc
|
---|
105 | else
|
---|
106 | OS_LIBS += -lC_r -lc_r
|
---|
107 | endif
|
---|
108 | else
|
---|
109 | # makeC++SharedLib(_r) is in either /usr/lpp/xlC/bin
|
---|
110 | # or /usr/ibmcxx/bin.
|
---|
111 | ifeq ($(CLASSIC_NSPR),1)
|
---|
112 | MKSHLIB = makeC++SharedLib -p 0
|
---|
113 | else
|
---|
114 | MKSHLIB = makeC++SharedLib_r -p 0
|
---|
115 | endif
|
---|
116 | OS_LIBS += -ldl
|
---|
117 | endif
|
---|
118 | endif
|
---|
119 | endif
|
---|
120 | endif
|
---|
121 |
|
---|
122 | ifeq ($(OS_ARCH),BeOS)
|
---|
123 | OS_LIBS = -lstdc++.r4
|
---|
124 | endif
|
---|
125 |
|
---|
126 | ifeq ($(OS_ARCH), UNIXWARE)
|
---|
127 | OS_LIBS += -lC
|
---|
128 | endif
|
---|
129 |
|
---|
130 | EXTRA_LIBS = $(LIBNSPR)
|
---|
131 |
|
---|
132 | # On NCR and SCOOS, we can't link with extra libraries when
|
---|
133 | # we build a shared library. If we do so, the linker doesn't
|
---|
134 | # complain, but we would run into weird problems at run-time.
|
---|
135 | # Therefore on these platforms, we link just the object files.
|
---|
136 | ifeq ($(OS_ARCH),NCR)
|
---|
137 | EXTRA_LIBS =
|
---|
138 | endif
|
---|
139 | ifeq ($(OS_ARCH),SCOOS)
|
---|
140 | EXTRA_LIBS =
|
---|
141 | endif
|
---|
142 |
|
---|
143 | ifdef RESOLVE_LINK_SYMBOLS
|
---|
144 | EXTRA_LIBS += $(OS_LIBS)
|
---|
145 | endif
|
---|
146 |
|
---|
147 | LIBRARY_NAME = prstrms
|
---|
148 | LIBRARY_VERSION = $(MOD_MAJOR_VERSION)
|
---|
149 |
|
---|
150 | RELEASE_HEADERS = $(HEADERS)
|
---|
151 | RELEASE_HEADERS_DEST = $(RELEASE_INCLUDE_DIR)
|
---|
152 | RELEASE_LIBS = $(TARGETS)
|
---|
153 |
|
---|
154 | include $(topsrcdir)/config/rules.mk
|
---|
155 |
|
---|
156 | #
|
---|
157 | # Version information generation (begin)
|
---|
158 | #
|
---|
159 | ECHO = echo
|
---|
160 | TINC = $(OBJDIR)/_pl_bld.h
|
---|
161 | PROD = $(notdir $(SHARED_LIBRARY))
|
---|
162 | NOW = $(MOD_DEPTH)/config/$(OBJDIR)/now
|
---|
163 | SH_DATE = $(shell date "+%Y-%m-%d %T")
|
---|
164 | SH_NOW = $(shell $(NOW))
|
---|
165 |
|
---|
166 | ifeq ($(OS_ARCH), WINNT)
|
---|
167 | SUF = i64
|
---|
168 | else
|
---|
169 | SUF = LL
|
---|
170 | endif
|
---|
171 |
|
---|
172 | $(TINC):
|
---|
173 | @$(MAKE_OBJDIR)
|
---|
174 | @$(ECHO) '#define _BUILD_STRING "$(SH_DATE)"' > $(TINC)
|
---|
175 | @if test ! -z "$(SH_NOW)"; then \
|
---|
176 | $(ECHO) '#define _BUILD_TIME $(SH_NOW)$(SUF)' >> $(TINC); \
|
---|
177 | else \
|
---|
178 | true; \
|
---|
179 | fi
|
---|
180 | @$(ECHO) '#define _PRODUCTION "$(PROD)"' >> $(TINC)
|
---|
181 |
|
---|
182 |
|
---|
183 | $(OBJDIR)/plvrsion.$(OBJ_SUFFIX): plvrsion.c $(TINC)
|
---|
184 | ifeq ($(OS_ARCH), WINNT)
|
---|
185 | $(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
|
---|
186 | else
|
---|
187 | ifeq ($(MOZ_OS2_TOOLS), VACPP)
|
---|
188 | $(CC) -Fo$@ -c $(CFLAGS) -I$(OBJDIR) $<
|
---|
189 | else
|
---|
190 | $(CC) -o $@ -c $(CFLAGS) -I$(OBJDIR) $<
|
---|
191 | endif
|
---|
192 | endif
|
---|
193 | #
|
---|
194 | # Version information generation (end)
|
---|
195 | #
|
---|
196 |
|
---|
197 | export:: $(TARGETS) $(HEADERS)
|
---|
198 | $(INSTALL) -m 444 $(HEADERS) $(dist_includedir)
|
---|
199 | $(INSTALL) -m 444 $(TARGETS) $(dist_libdir)
|
---|
200 | ifeq ($(OS_ARCH),OS2)
|
---|
201 | $(INSTALL) -m 444 $(TARGETS) $(dist_bindir)
|
---|
202 | endif
|
---|
203 | ifeq ($(OS_ARCH),HP-UX)
|
---|
204 | ifdef SHARED_LIBRARY
|
---|
205 | $(INSTALL) -m 755 $(SHARED_LIBRARY) $(dist_libdir)
|
---|
206 | endif
|
---|
207 | endif
|
---|