#! gmake
#
# ***** BEGIN LICENSE BLOCK *****
# Version: MPL 1.1/GPL 2.0/LGPL 2.1
#
# The contents of this file are subject to the Mozilla Public License Version
# 1.1 (the "License"); you may not use this file except in compliance with
# the License. You may obtain a copy of the License at
#
# Software distributed under the License is distributed on an "AS IS" basis,
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
# for the specific language governing rights and limitations under the
# License.
#
# The Original Code is the Netscape Portable Runtime (NSPR).
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998-2000
# the Initial Developer. All Rights Reserved.
#
# Contributor(s):
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
# in which case the provisions of the GPL or the LGPL are applicable instead
# of those above. If you wish to allow use of your version of this file only
# under the terms of either the GPL or the LGPL, and not to allow others to
# use your version of this file under the terms of the MPL, indicate your
# decision by deleting the provisions above and replace them with the notice
# and other provisions required by the GPL or the LGPL. If you do not delete
# the provisions above, a recipient may use your version of this file under
# the terms of any one of the MPL, the GPL or the LGPL.
#
# ***** END LICENSE BLOCK *****
################################################################################
# We have a 4 pass build process:
#
# Pass 1. export - Create generated headers and stubs. Publish public headers to
# dist/<arch>/include.
#
# Pass 2. libs - Create libraries. Publish libraries to dist/<arch>/lib.
#
# Pass 3. all - Create programs.
#
# Pass 4. install - Publish programs to dist/<arch>/bin.
#
# 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)
#
################################################################################
srcdir=.
#
# 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.
#
#
# Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
# other platforms do not.
#
else
else
else
TARGETS += $(SHARED_LIB_PDB)
else
#
# 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).
#
$(NOSUCHFILE) \
ALL_TRASH += $(VMS_SYMVEC_FILE)
LOOP_OVER_DIRS = \
if test -d $$d; then \
set -e; \
$(MAKE) -C $$d $@; \
set +e; \
else \
echo "Skipping non-directory $$d..."; \
fi; \
done
################################################################################
all:: export
export::
+$(LOOP_OVER_DIRS)
libs:: export
install:: export
clean::
+$(LOOP_OVER_DIRS)
clobber::
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_DIRS)
+$(LOOP_OVER_DIRS)
release:: export
@echo "Copying executable programs and scripts to release directory"
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_BIN_DIR); then \
$(NSINSTALL) -D $(RELEASE_BIN_DIR);\
else \
true; \
fi
@echo "Copying libraries to release directory"
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_LIBS_DEST); then \
$(NSINSTALL) -D $(RELEASE_LIBS_DEST);\
else \
true; \
fi
@echo "Copying header files to release directory"
echo "BUILD_NUMBER must be defined"; \
false; \
else \
true; \
fi
@if test ! -d $(RELEASE_HEADERS_DEST); then \
$(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\
else \
true; \
fi
+$(LOOP_OVER_DIRS)
find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a
find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a
$(NFSPWD):
@$(MAKE_OBJDIR)
else
else
$(STRIP) $@
@$(MAKE_OBJDIR)
rm -f $@
else
$(RANLIB) $@
$(IMPORT_LIBRARY): $(MAPFILE)
rm -f $@
@$(MAKE_OBJDIR)
rm -f $@
| awk '/ [T,D] / {print $$3}' \
| sed -e 's/^\.//' \
else # AIX 4.1
else
else # !os2 vacpp
@if test ! -f $(VMS_SYMVEC_FILE); then \
if test -f $(VMS_SYMVEC_FILE_MODULE); then \
fi; \
fi
endif # OpenVMS
endif # OS2 vacpp
endif # WINNT
endif # AIX 4.1
$(STRIP) $@
@$(MAKE_OBJDIR)
# The resource compiler does not understand the -U option.
else
endif # GCC
@$(MAKE_OBJDIR)
grep -v ';-' $< | \
echo PROTMODE >> $@
echo EXPORTS >> $@
else
awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
#
# Translate source filenames to absolute paths. This is required for
# debuggers under Windows and OS/2 to find source files automatically.
#
@$(MAKE_OBJDIR)
else
else
else
$(OBJDIR)/%.$(OBJ_SUFFIX): %.c
@$(MAKE_OBJDIR)
else
else
else
$(OBJDIR)/%.$(OBJ_SUFFIX): %.s
@$(MAKE_OBJDIR)
@$(MAKE_OBJDIR)
%.i: %.c
%: %.pl
#
# 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.
#
# END OF HACK
################################################################################
# Special gmake rules.
################################################################################
#
# 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:
#
# name already exists.
#
#
# 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.)
#