1 | #! gmake
|
---|
2 | #
|
---|
3 | # ***** BEGIN LICENSE BLOCK *****
|
---|
4 | # Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
---|
5 | #
|
---|
6 | # The contents of this file are subject to the Mozilla Public License Version
|
---|
7 | # 1.1 (the "License"); you may not use this file except in compliance with
|
---|
8 | # the License. You may obtain a copy of the License at
|
---|
9 | # http://www.mozilla.org/MPL/
|
---|
10 | #
|
---|
11 | # Software distributed under the License is distributed on an "AS IS" basis,
|
---|
12 | # WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
---|
13 | # for the specific language governing rights and limitations under the
|
---|
14 | # License.
|
---|
15 | #
|
---|
16 | # The Original Code is the Netscape Portable Runtime (NSPR).
|
---|
17 | #
|
---|
18 | # The Initial Developer of the Original Code is
|
---|
19 | # Netscape Communications Corporation.
|
---|
20 | # Portions created by the Initial Developer are Copyright (C) 1998-2000
|
---|
21 | # the Initial Developer. All Rights Reserved.
|
---|
22 | #
|
---|
23 | # Contributor(s):
|
---|
24 | #
|
---|
25 | # Alternatively, the contents of this file may be used under the terms of
|
---|
26 | # either the GNU General Public License Version 2 or later (the "GPL"), or
|
---|
27 | # the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
---|
28 | # in which case the provisions of the GPL or the LGPL are applicable instead
|
---|
29 | # of those above. If you wish to allow use of your version of this file only
|
---|
30 | # under the terms of either the GPL or the LGPL, and not to allow others to
|
---|
31 | # use your version of this file under the terms of the MPL, indicate your
|
---|
32 | # decision by deleting the provisions above and replace them with the notice
|
---|
33 | # and other provisions required by the GPL or the LGPL. If you do not delete
|
---|
34 | # the provisions above, a recipient may use your version of this file under
|
---|
35 | # the terms of any one of the MPL, the GPL or the LGPL.
|
---|
36 | #
|
---|
37 | # ***** END LICENSE BLOCK *****
|
---|
38 |
|
---|
39 | ################################################################################
|
---|
40 | # We have a 4 pass build process:
|
---|
41 | #
|
---|
42 | # Pass 1. export - Create generated headers and stubs. Publish public headers to
|
---|
43 | # dist/<arch>/include.
|
---|
44 | #
|
---|
45 | # Pass 2. libs - Create libraries. Publish libraries to dist/<arch>/lib.
|
---|
46 | #
|
---|
47 | # Pass 3. all - Create programs.
|
---|
48 | #
|
---|
49 | # Pass 4. install - Publish programs to dist/<arch>/bin.
|
---|
50 | #
|
---|
51 | # Parameters to this makefile (set these before including):
|
---|
52 | #
|
---|
53 | # a)
|
---|
54 | # TARGETS -- the target to create
|
---|
55 | # (defaults to $LIBRARY $PROGRAM)
|
---|
56 | # b)
|
---|
57 | # DIRS -- subdirectories for make to recurse on
|
---|
58 | # (the 'all' rule builds $TARGETS $DIRS)
|
---|
59 | # c)
|
---|
60 | # CSRCS -- .c files to compile
|
---|
61 | # (used to define $OBJS)
|
---|
62 | # d)
|
---|
63 | # PROGRAM -- the target program name to create from $OBJS
|
---|
64 | # ($OBJDIR automatically prepended to it)
|
---|
65 | # e)
|
---|
66 | # LIBRARY -- the target library name to create from $OBJS
|
---|
67 | # ($OBJDIR automatically prepended to it)
|
---|
68 | #
|
---|
69 | ################################################################################
|
---|
70 |
|
---|
71 | ifndef topsrcdir
|
---|
72 | topsrcdir=$(MOD_DEPTH)
|
---|
73 | endif
|
---|
74 |
|
---|
75 | ifndef srcdir
|
---|
76 | srcdir=.
|
---|
77 | endif
|
---|
78 |
|
---|
79 | ifndef NSPR_CONFIG_MK
|
---|
80 | include $(topsrcdir)/config/config.mk
|
---|
81 | endif
|
---|
82 |
|
---|
83 | ifdef USE_AUTOCONF
|
---|
84 | ifdef CROSS_COMPILE
|
---|
85 | ifdef INTERNAL_TOOLS
|
---|
86 | CC=$(HOST_CC)
|
---|
87 | CCC=$(HOST_CXX)
|
---|
88 | CFLAGS=$(HOST_CFLAGS)
|
---|
89 | CXXFLAGS=$(HOST_CXXFLAGS)
|
---|
90 | endif
|
---|
91 | endif
|
---|
92 | endif
|
---|
93 |
|
---|
94 | #
|
---|
95 | # This makefile contains rules for building the following kinds of
|
---|
96 | # libraries:
|
---|
97 | # - LIBRARY: a static (archival) library
|
---|
98 | # - SHARED_LIBRARY: a shared (dynamic link) library
|
---|
99 | # - IMPORT_LIBRARY: an import library, used only on Windows and OS/2
|
---|
100 | #
|
---|
101 | # The names of these libraries can be generated by simply specifying
|
---|
102 | # LIBRARY_NAME and LIBRARY_VERSION.
|
---|
103 | #
|
---|
104 |
|
---|
105 | ifdef LIBRARY_NAME
|
---|
106 | ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
---|
107 |
|
---|
108 | #
|
---|
109 | # Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
|
---|
110 | # other platforms do not.
|
---|
111 | #
|
---|
112 | ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
|
---|
113 | LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
|
---|
114 | SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
---|
115 | IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
|
---|
116 | SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
|
---|
117 | else
|
---|
118 | LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
|
---|
119 | SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
---|
120 | IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
|
---|
121 | SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb
|
---|
122 | endif
|
---|
123 |
|
---|
124 | else
|
---|
125 |
|
---|
126 | LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
|
---|
127 | ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
|
---|
128 | SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
|
---|
129 | else
|
---|
130 | ifdef MKSHLIB
|
---|
131 | SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
---|
132 | endif
|
---|
133 | endif
|
---|
134 |
|
---|
135 | endif
|
---|
136 | endif
|
---|
137 |
|
---|
138 | ifndef TARGETS
|
---|
139 | ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
---|
140 | TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
|
---|
141 | ifndef BUILD_OPT
|
---|
142 | ifdef MSC_VER
|
---|
143 | ifneq ($(MSC_VER),1200)
|
---|
144 | TARGETS += $(SHARED_LIB_PDB)
|
---|
145 | endif
|
---|
146 | endif
|
---|
147 | endif
|
---|
148 | else
|
---|
149 | TARGETS = $(LIBRARY) $(SHARED_LIBRARY)
|
---|
150 | endif
|
---|
151 | endif
|
---|
152 |
|
---|
153 | #
|
---|
154 | # OBJS is the list of object files. It can be constructed by
|
---|
155 | # specifying CSRCS (list of C source files) and ASFILES (list
|
---|
156 | # of assembly language source files).
|
---|
157 | #
|
---|
158 |
|
---|
159 | ifndef OBJS
|
---|
160 | OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
|
---|
161 | $(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))
|
---|
162 | endif
|
---|
163 |
|
---|
164 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
165 | EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS))
|
---|
166 | endif
|
---|
167 |
|
---|
168 | ALL_TRASH = $(TARGETS) $(OBJS) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
|
---|
169 | $(NOSUCHFILE) \
|
---|
170 | so_locations
|
---|
171 |
|
---|
172 | ifeq ($(OS_ARCH),OpenVMS)
|
---|
173 | ALL_TRASH += $(wildcard *.c*_defines)
|
---|
174 | ifdef SHARED_LIBRARY
|
---|
175 | VMS_SYMVEC_FILE = $(SHARED_LIBRARY:.$(DLL_SUFFIX)=_symvec.opt)
|
---|
176 | VMS_SYMVEC_FILE_MODULE = $(srcdir)/$(LIBRARY_NAME)_symvec.opt
|
---|
177 | ALL_TRASH += $(VMS_SYMVEC_FILE)
|
---|
178 | endif
|
---|
179 | endif
|
---|
180 |
|
---|
181 | ifndef RELEASE_LIBS_DEST
|
---|
182 | RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR)
|
---|
183 | endif
|
---|
184 |
|
---|
185 | ifdef DIRS
|
---|
186 | LOOP_OVER_DIRS = \
|
---|
187 | @for d in $(DIRS); do \
|
---|
188 | if test -d $$d; then \
|
---|
189 | set -e; \
|
---|
190 | echo "cd $$d; $(MAKE) $@"; \
|
---|
191 | $(MAKE) -C $$d $@; \
|
---|
192 | set +e; \
|
---|
193 | else \
|
---|
194 | echo "Skipping non-directory $$d..."; \
|
---|
195 | fi; \
|
---|
196 | done
|
---|
197 | endif
|
---|
198 |
|
---|
199 | ################################################################################
|
---|
200 |
|
---|
201 | all:: export
|
---|
202 |
|
---|
203 | export::
|
---|
204 | +$(LOOP_OVER_DIRS)
|
---|
205 |
|
---|
206 | libs:: export
|
---|
207 |
|
---|
208 | install:: export
|
---|
209 |
|
---|
210 | clean::
|
---|
211 | rm -rf $(OBJS) so_locations $(NOSUCHFILE) $(GARBAGE)
|
---|
212 | +$(LOOP_OVER_DIRS)
|
---|
213 |
|
---|
214 | clobber::
|
---|
215 | rm -rf $(OBJS) $(TARGETS) $(filter-out . ..,$(OBJDIR)) $(GARBAGE) so_locations $(NOSUCHFILE)
|
---|
216 | +$(LOOP_OVER_DIRS)
|
---|
217 |
|
---|
218 | realclean clobber_all::
|
---|
219 | rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH)
|
---|
220 | +$(LOOP_OVER_DIRS)
|
---|
221 |
|
---|
222 | distclean::
|
---|
223 | rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE)
|
---|
224 | +$(LOOP_OVER_DIRS)
|
---|
225 |
|
---|
226 | real_install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
|
---|
227 | ifdef RELEASE_BINS
|
---|
228 | $(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
|
---|
229 | endif
|
---|
230 | ifdef RELEASE_HEADERS
|
---|
231 | $(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir)
|
---|
232 | endif
|
---|
233 | ifdef RELEASE_LIBS
|
---|
234 | $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
|
---|
235 | endif
|
---|
236 | +$(LOOP_OVER_DIRS)
|
---|
237 |
|
---|
238 | release:: export
|
---|
239 | ifdef RELEASE_BINS
|
---|
240 | @echo "Copying executable programs and scripts to release directory"
|
---|
241 | @if test -z "$(BUILD_NUMBER)"; then \
|
---|
242 | echo "BUILD_NUMBER must be defined"; \
|
---|
243 | false; \
|
---|
244 | else \
|
---|
245 | true; \
|
---|
246 | fi
|
---|
247 | @if test ! -d $(RELEASE_BIN_DIR); then \
|
---|
248 | rm -rf $(RELEASE_BIN_DIR); \
|
---|
249 | $(NSINSTALL) -D $(RELEASE_BIN_DIR);\
|
---|
250 | else \
|
---|
251 | true; \
|
---|
252 | fi
|
---|
253 | cp $(RELEASE_BINS) $(RELEASE_BIN_DIR)
|
---|
254 | endif
|
---|
255 | ifdef RELEASE_LIBS
|
---|
256 | @echo "Copying libraries to release directory"
|
---|
257 | @if test -z "$(BUILD_NUMBER)"; then \
|
---|
258 | echo "BUILD_NUMBER must be defined"; \
|
---|
259 | false; \
|
---|
260 | else \
|
---|
261 | true; \
|
---|
262 | fi
|
---|
263 | @if test ! -d $(RELEASE_LIBS_DEST); then \
|
---|
264 | rm -rf $(RELEASE_LIBS_DEST); \
|
---|
265 | $(NSINSTALL) -D $(RELEASE_LIBS_DEST);\
|
---|
266 | else \
|
---|
267 | true; \
|
---|
268 | fi
|
---|
269 | cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST)
|
---|
270 | endif
|
---|
271 | ifdef RELEASE_HEADERS
|
---|
272 | @echo "Copying header files to release directory"
|
---|
273 | @if test -z "$(BUILD_NUMBER)"; then \
|
---|
274 | echo "BUILD_NUMBER must be defined"; \
|
---|
275 | false; \
|
---|
276 | else \
|
---|
277 | true; \
|
---|
278 | fi
|
---|
279 | @if test ! -d $(RELEASE_HEADERS_DEST); then \
|
---|
280 | rm -rf $(RELEASE_HEADERS_DEST); \
|
---|
281 | $(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\
|
---|
282 | else \
|
---|
283 | true; \
|
---|
284 | fi
|
---|
285 | cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST)
|
---|
286 | endif
|
---|
287 | +$(LOOP_OVER_DIRS)
|
---|
288 |
|
---|
289 | alltags:
|
---|
290 | rm -f TAGS tags
|
---|
291 | find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a
|
---|
292 | find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a
|
---|
293 |
|
---|
294 | $(NFSPWD):
|
---|
295 | cd $(@D); $(MAKE) $(@F)
|
---|
296 |
|
---|
297 | $(PROGRAM): $(OBJS)
|
---|
298 | @$(MAKE_OBJDIR)
|
---|
299 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
300 | $(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
|
---|
301 | else
|
---|
302 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
303 | $(CC) $(OBJS) -Fe$@ $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
|
---|
304 | else
|
---|
305 | $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS)
|
---|
306 | endif
|
---|
307 | endif
|
---|
308 | ifdef ENABLE_STRIP
|
---|
309 | $(STRIP) $@
|
---|
310 | endif
|
---|
311 |
|
---|
312 | $(LIBRARY): $(OBJS)
|
---|
313 | @$(MAKE_OBJDIR)
|
---|
314 | rm -f $@
|
---|
315 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
316 | $(AR) $(subst /,\\,$(OBJS)) $(AR_FLAGS)
|
---|
317 | else
|
---|
318 | $(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
|
---|
319 | endif
|
---|
320 | $(RANLIB) $@
|
---|
321 |
|
---|
322 | ifeq ($(OS_TARGET), OS2)
|
---|
323 | $(IMPORT_LIBRARY): $(MAPFILE)
|
---|
324 | rm -f $@
|
---|
325 | $(IMPLIB) $@ $(MAPFILE)
|
---|
326 | endif
|
---|
327 |
|
---|
328 | $(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE)
|
---|
329 | @$(MAKE_OBJDIR)
|
---|
330 | rm -f $@
|
---|
331 | ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
|
---|
332 | echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
|
---|
333 | nm -B -C -g $(OBJS) \
|
---|
334 | | awk '/ [T,D] / {print $$3}' \
|
---|
335 | | sed -e 's/^\.//' \
|
---|
336 | | sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
|
---|
337 | $(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
|
---|
338 | -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
|
---|
339 | else # AIX 4.1
|
---|
340 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
341 | $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES)
|
---|
342 | else
|
---|
343 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
344 | $(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE)
|
---|
345 | else # !os2 vacpp
|
---|
346 | ifeq ($(OS_TARGET), OpenVMS)
|
---|
347 | @if test ! -f $(VMS_SYMVEC_FILE); then \
|
---|
348 | if test -f $(VMS_SYMVEC_FILE_MODULE); then \
|
---|
349 | echo Creating component options file $(VMS_SYMVEC_FILE); \
|
---|
350 | cp $(VMS_SYMVEC_FILE_MODULE) $(VMS_SYMVEC_FILE); \
|
---|
351 | fi; \
|
---|
352 | fi
|
---|
353 | endif # OpenVMS
|
---|
354 | $(MKSHLIB) $(OBJS) $(RES) $(EXTRA_LIBS)
|
---|
355 | endif # OS2 vacpp
|
---|
356 | endif # WINNT
|
---|
357 | endif # AIX 4.1
|
---|
358 | ifdef ENABLE_STRIP
|
---|
359 | $(STRIP) $@
|
---|
360 | endif
|
---|
361 |
|
---|
362 | ifeq ($(OS_ARCH),WINNT)
|
---|
363 | $(RES): $(RESNAME)
|
---|
364 | @$(MAKE_OBJDIR)
|
---|
365 | # The resource compiler does not understand the -U option.
|
---|
366 | ifdef NS_USE_GCC
|
---|
367 | $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
|
---|
368 | else
|
---|
369 | $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
|
---|
370 | endif # GCC
|
---|
371 | @echo $(RES) finished
|
---|
372 | endif
|
---|
373 |
|
---|
374 | $(MAPFILE): $(LIBRARY_NAME).def
|
---|
375 | @$(MAKE_OBJDIR)
|
---|
376 | ifeq ($(OS_ARCH),SunOS)
|
---|
377 | grep -v ';-' $< | \
|
---|
378 | sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
|
---|
379 | endif
|
---|
380 | ifeq ($(OS_ARCH),OS2)
|
---|
381 | echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@
|
---|
382 | echo PROTMODE >> $@
|
---|
383 | echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
|
---|
384 | echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
|
---|
385 | echo EXPORTS >> $@
|
---|
386 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
387 | grep -v ';+' $< | grep -v ';-' | \
|
---|
388 | sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' >> $@
|
---|
389 | else
|
---|
390 | grep -v ';+' $< | grep -v ';-' | \
|
---|
391 | sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
|
---|
392 | awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
|
---|
393 | $(ADD_TO_DEF_FILE)
|
---|
394 | endif
|
---|
395 | endif
|
---|
396 |
|
---|
397 | #
|
---|
398 | # Translate source filenames to absolute paths. This is required for
|
---|
399 | # debuggers under Windows and OS/2 to find source files automatically.
|
---|
400 | #
|
---|
401 |
|
---|
402 | ifeq ($(OS_ARCH),OS2)
|
---|
403 | NEED_ABSOLUTE_PATH = 1
|
---|
404 | endif
|
---|
405 |
|
---|
406 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
407 | NEED_ABSOLUTE_PATH = 1
|
---|
408 | endif
|
---|
409 |
|
---|
410 | ifdef NEED_ABSOLUTE_PATH
|
---|
411 | PWD := $(shell pwd)
|
---|
412 | abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
|
---|
413 | endif
|
---|
414 |
|
---|
415 | $(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
|
---|
416 | @$(MAKE_OBJDIR)
|
---|
417 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
418 | $(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
|
---|
419 | else
|
---|
420 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
421 | $(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
|
---|
422 | else
|
---|
423 | ifdef NEED_ABSOLUTE_PATH
|
---|
424 | $(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<)
|
---|
425 | else
|
---|
426 | $(CCC) -o $@ -c $(CCCFLAGS) $<
|
---|
427 | endif
|
---|
428 | endif
|
---|
429 | endif
|
---|
430 |
|
---|
431 | WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
|
---|
432 | WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
|
---|
433 | WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
|
---|
434 | $(OBJDIR)/%.$(OBJ_SUFFIX): %.c
|
---|
435 | @$(MAKE_OBJDIR)
|
---|
436 | ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
---|
437 | $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
|
---|
438 | else
|
---|
439 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
440 | $(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
|
---|
441 | else
|
---|
442 | ifdef NEED_ABSOLUTE_PATH
|
---|
443 | $(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
|
---|
444 | else
|
---|
445 | $(CC) -o $@ -c $(CFLAGS) $<
|
---|
446 | endif
|
---|
447 | endif
|
---|
448 | endif
|
---|
449 |
|
---|
450 |
|
---|
451 | $(OBJDIR)/%.$(OBJ_SUFFIX): %.s
|
---|
452 | @$(MAKE_OBJDIR)
|
---|
453 | $(AS) -o $@ $(ASFLAGS) -c $<
|
---|
454 |
|
---|
455 | ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
---|
456 | $(OBJDIR)/%.$(OBJ_SUFFIX): %.asm
|
---|
457 | @$(MAKE_OBJDIR)
|
---|
458 | $(AS) -Fdo:./$(OBJDIR) $(ASFLAGS) $<
|
---|
459 | endif
|
---|
460 |
|
---|
461 | %.i: %.c
|
---|
462 | $(CC) -C -E $(CFLAGS) $< > $*.i
|
---|
463 |
|
---|
464 | %: %.pl
|
---|
465 | rm -f $@; cp $< $@; chmod +x $@
|
---|
466 |
|
---|
467 | #
|
---|
468 | # HACK ALERT
|
---|
469 | #
|
---|
470 | # The only purpose of this rule is to pass Mozilla's Tinderbox depend
|
---|
471 | # builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's
|
---|
472 | # Tinderbox builds NSPR continuously as part of the Mozilla client.
|
---|
473 | # Because NSPR's make depend is not implemented, whenever we change
|
---|
474 | # an NSPR header file, the depend build does not recompile the NSPR
|
---|
475 | # files that depend on the header.
|
---|
476 | #
|
---|
477 | # This rule makes all the objects depend on a dummy header file.
|
---|
478 | # Touch this dummy header file to force the depend build to recompile
|
---|
479 | # everything.
|
---|
480 | #
|
---|
481 | # This rule should be removed when make depend is implemented.
|
---|
482 | #
|
---|
483 |
|
---|
484 | DUMMY_DEPEND_H = $(topsrcdir)/config/prdepend.h
|
---|
485 |
|
---|
486 | $(filter $(OBJDIR)/%.$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%.$(OBJ_SUFFIX): $(DUMMY_DEPEND_H)
|
---|
487 |
|
---|
488 | # END OF HACK
|
---|
489 |
|
---|
490 | ################################################################################
|
---|
491 | # Special gmake rules.
|
---|
492 | ################################################################################
|
---|
493 |
|
---|
494 | #
|
---|
495 | # Re-define the list of default suffixes, so gmake won't have to churn through
|
---|
496 | # hundreds of built-in suffix rules for stuff we don't need.
|
---|
497 | #
|
---|
498 | .SUFFIXES:
|
---|
499 | .SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl
|
---|
500 |
|
---|
501 | #
|
---|
502 | # Fake targets. Always run these rules, even if a file/directory with that
|
---|
503 | # name already exists.
|
---|
504 | #
|
---|
505 | .PHONY: all alltags clean export install libs realclean release
|
---|
506 |
|
---|
507 | #
|
---|
508 | # List the target pattern of an implicit rule as a dependency of the
|
---|
509 | # special target .PRECIOUS to preserve intermediate files made by
|
---|
510 | # implicit rules whose target patterns match that file's name.
|
---|
511 | # (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4,
|
---|
512 | # p. 107.)
|
---|
513 | #
|
---|
514 | .PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX)
|
---|