#! gmake # # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/.
################################################################################ # We used to have a 4 pass build process. Now we do everything in one pass. # # export - Create generated headers and stubs. Publish public headers to # dist/<arch>/include. # Create libraries. Publish libraries to dist/<arch>/lib. # Create programs. # # libs - obsolete. Now a synonym of "export". # # all - the default makefile target. Now a synonym of "export". # # install - Install headers, libraries, and programs on the system. # # Parameters to this makefile (set these before including): # # a) # TARGETS -- the target to create # (defaults to $LIBRARY $PROGRAM) # b) # DIRS -- subdirectories for make to recurse on # (the 'all' rule builds $TARGETS $DIRS) # c) # CSRCS -- .c files to compile # (used to define $OBJS) # d) # PROGRAM -- the target program name to create from $OBJS # ($OBJDIR automatically prepended to it) # e) # LIBRARY -- the target library name to create from $OBJS # ($OBJDIR automatically prepended to it) # ################################################################################
ifndef topsrcdir
topsrcdir=$(MOD_DEPTH) endif
ifndef srcdir
srcdir=. endif
ifndef NSPR_CONFIG_MK include $(topsrcdir)/config/config.mk endif
# # This makefile contains rules for building the following kinds of # libraries: # - LIBRARY: a static (archival) library # - SHARED_LIBRARY: a shared (dynamic link) library # - IMPORT_LIBRARY: an import library, used only on Windows and OS/2 # # The names of these libraries can be generated by simply specifying # LIBRARY_NAME and LIBRARY_VERSION. #
# # OBJS is the list of object files. It can be constructed by # specifying CSRCS (list of C source files) and ASFILES (list # of assembly language source files). #
$(PROGRAM): $(OBJS)
@$(MAKE_OBJDIR) ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
ifdef MOZ_PROFILE_USE # In the second pass, we need to merge the pgc files into the pgd file. # The compiler would do this for us automatically if they were in the right # place, but they're in dist/bin.
python $(topsrcdir)/build/win32/pgomerge.py \
$(notdir $(PROGRAM:.exe=)) $(DIST)/bin endif# MOZ_PROFILE_USE
$(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
ifdef MT
@if test -f $@.manifest; then \
$(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ rm -f $@.manifest; \ fi endif# MSVC with manifest tool
ifdef MOZ_PROFILE_GENERATE # touch it a few seconds into the future to work around FAT's # 2-second granularity
touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink endif# MOZ_PROFILE_GENERATE else# WINNT && !GCC
$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(WRAP_LDFLAGS) endif# WINNT && !GCC
ifdef ENABLE_STRIP
$(STRIP) $@ endif
# Same as OBJS, but without any file that matches p*vrsion.o, since these # collide for static libraries, and are not useful for that case anyway.
STATICLIB_OBJS = $(filter-out $(OBJDIR)/p%vrsion.$(OBJ_SUFFIX),$(OBJS))
$(LIBRARY): $(STATICLIB_OBJS)
@$(MAKE_OBJDIR) rm -f $@
$(AR) $(AR_FLAGS) $(STATICLIB_OBJS) $(AR_EXTRA_ARGS)
$(RANLIB) $@
ifeq (,$(filter-out WIN95 WINCE WINMO,$(OS_TARGET))) # PDBs and import libraries need to depend on the shared library to # order dependencies properly.
$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
$(SHARED_LIB_PDB): $(SHARED_LIBRARY) endif
ifdef MOZ_PROFILE_USE ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) # When building with PGO, we have to make sure to re-link # in the MOZ_PROFILE_USE phase if we linked in the # MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink # file in the link rule in the GENERATE phase to indicate # that we need a relink.
$(SHARED_LIBRARY): pgo.relink
$(PROGRAM): pgo.relink
endif# WINNT && !GCC endif# MOZ_PROFILE_USE
ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE))
ifdef NS_USE_GCC # Force rebuilding libraries and programs in both passes because each # pass uses different object files.
$(PROGRAM) $(SHARED_LIBRARY) $(LIBRARY): FORCE
.PHONY: FORCE endif endif
# # HACK ALERT # # The only purpose of this rule is to pass Mozilla's Tinderbox depend # builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's # Tinderbox builds NSPR continuously as part of the Mozilla client. # Because NSPR's make depend is not implemented, whenever we change # an NSPR header file, the depend build does not recompile the NSPR # files that depend on the header. # # This rule makes all the objects depend on a dummy header file. # Touch this dummy header file to force the depend build to recompile # everything. # # This rule should be removed when make depend is implemented. #
################################################################################ # Special gmake rules. ################################################################################
# # Disallow parallel builds with MSVC < 8 since it can't open the PDB file in # parallel. # ifeq (,$(filter-out 120013001310,$(MSC_VER)))
.NOTPARALLEL: endif
# # Re-define the list of default suffixes, so gmake won't have to churn through # hundreds of built-in suffix rules for stuff we don't need. #
.SUFFIXES:
.SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl
# # Fake targets. Always run these rules, even if a file/directory with that # name already exists. #
.PHONY: all alltags cleanexport install libs realclean release
# # List the target pattern of an implicit rule as a dependency of the # special target .PRECIOUS to preserve intermediate files made by # implicit rules whose target patterns match that file's name. # (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4, # p. 107.) #
.PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX)
Messung V0.5 in Prozent
¤ Dauer der Verarbeitung: 0.9 Sekunden
(vorverarbeitet am 2026-06-05)
¤
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.