1998-03-28 05:44:41 +03:00
|
|
|
#! gmake
|
|
|
|
#
|
2000-06-14 00:59:02 +04:00
|
|
|
# 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 http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
2000-06-21 01:48:45 +04:00
|
|
|
# The Original Code is the Netscape Portable Runtime (NSPR).
|
2000-06-14 00:59:02 +04:00
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape
|
|
|
|
# Communications Corporation. Portions created by Netscape are
|
2000-06-21 01:48:45 +04:00
|
|
|
# Copyright (C) 1998-2000 Netscape Communications Corporation. All
|
2000-06-14 00:59:02 +04:00
|
|
|
# Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
|
|
|
#
|
|
|
|
# Alternatively, the contents of this file may be used under the
|
|
|
|
# terms of the GNU General Public License Version 2 or later (the
|
|
|
|
# "GPL"), in which case the provisions of the GPL are applicable
|
|
|
|
# instead of those above. If you wish to allow use of your
|
|
|
|
# version of this file only under the terms of the GPL and not to
|
|
|
|
# allow others to use your version of this file under the MPL,
|
|
|
|
# indicate your decision by deleting the provisions above and
|
|
|
|
# replace them with the notice and other provisions required by
|
|
|
|
# the GPL. If you do not delete the provisions above, a recipient
|
|
|
|
# may use your version of this file under either the MPL or the
|
|
|
|
# GPL.
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# 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)
|
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
ifndef topsrcdir
|
|
|
|
topsrcdir=$(MOD_DEPTH)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef srcdir
|
|
|
|
srcdir=.
|
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifndef NSPR_CONFIG_MK
|
1999-10-14 19:09:11 +04:00
|
|
|
include $(topsrcdir)/config/config.mk
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef USE_AUTOCONF
|
2000-08-21 03:52:43 +04:00
|
|
|
ifdef CROSS_COMPILE
|
1999-10-14 19:09:11 +04:00
|
|
|
ifdef INTERNAL_TOOLS
|
|
|
|
CC=$(HOST_CC)
|
|
|
|
CCC=$(HOST_CXX)
|
|
|
|
CFLAGS=$(HOST_CFLAGS)
|
|
|
|
CXXFLAGS=$(HOST_CXXFLAGS)
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
2000-08-21 03:52:43 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifdef LIBRARY_NAME
|
2000-01-11 23:44:12 +03:00
|
|
|
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#
|
1999-03-18 00:25:08 +03:00
|
|
|
# Win95, Win16, and OS/2 require library names conforming to the 8.3 rule.
|
1998-03-28 05:44:41 +03:00
|
|
|
# other platforms do not.
|
|
|
|
#
|
2001-05-12 04:49:17 +04:00
|
|
|
ifeq (,$(filter-out WIN95 OS2,$(OS_TARGET)))
|
1998-11-20 01:20:31 +03:00
|
|
|
LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
|
|
|
|
SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
|
|
|
IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
1998-11-20 01:20:31 +03:00
|
|
|
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX)
|
|
|
|
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
|
|
|
IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX)
|
|
|
|
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
|
|
|
|
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a
|
|
|
|
else
|
1998-09-26 00:34:39 +04:00
|
|
|
ifdef MKSHLIB
|
1998-03-28 05:44:41 +03:00
|
|
|
SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX)
|
|
|
|
endif
|
1998-09-26 00:34:39 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef TARGETS
|
2000-01-11 23:44:12 +03:00
|
|
|
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
2001-05-22 02:45:31 +04:00
|
|
|
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2001-05-22 02:45:31 +04:00
|
|
|
TARGETS = $(LIBRARY) $(SHARED_LIBRARY)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# 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).
|
|
|
|
#
|
|
|
|
|
|
|
|
ifndef OBJS
|
1998-04-21 21:21:53 +04:00
|
|
|
OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \
|
2001-06-23 08:09:19 +04:00
|
|
|
$(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX)))
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
OBJS += $(RES)
|
|
|
|
endif
|
2001-05-12 04:49:17 +04:00
|
|
|
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS))
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1999-10-14 19:09:11 +04:00
|
|
|
ALL_TRASH = $(TARGETS) $(OBJS) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \
|
2000-04-06 00:18:13 +04:00
|
|
|
$(NOSUCHFILE) \
|
1998-03-28 05:44:41 +03:00
|
|
|
so_locations
|
|
|
|
|
2002-12-12 04:41:31 +03:00
|
|
|
ifeq ($(OS_ARCH),OpenVMS)
|
|
|
|
ALL_TRASH += $(wildcard *.c*_defines)
|
|
|
|
ifdef SHARED_LIBRARY
|
|
|
|
VMS_SYMVEC_FILE = $(SHARED_LIBRARY:.$(DLL_SUFFIX)=_symvec.opt)
|
|
|
|
VMS_SYMVEC_FILE_MODULE = $(srcdir)/$(LIBRARY_NAME)_symvec.opt
|
|
|
|
ALL_TRASH += $(VMS_SYMVEC_FILE)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2003-01-07 02:42:06 +03:00
|
|
|
ifndef RELEASE_LIBS_DEST
|
|
|
|
RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR)
|
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef DIRS
|
|
|
|
LOOP_OVER_DIRS = \
|
|
|
|
@for d in $(DIRS); do \
|
|
|
|
if test -d $$d; then \
|
|
|
|
set -e; \
|
|
|
|
echo "cd $$d; $(MAKE) $@"; \
|
|
|
|
$(MAKE) -C $$d $@; \
|
|
|
|
set +e; \
|
|
|
|
else \
|
|
|
|
echo "Skipping non-directory $$d..."; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
|
2001-01-22 09:36:06 +03:00
|
|
|
all:: export
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
export::
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
2001-01-22 09:36:06 +03:00
|
|
|
libs:: export
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2001-01-22 09:36:06 +03:00
|
|
|
install:: export
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
clean::
|
2000-01-11 23:44:12 +03:00
|
|
|
rm -rf $(OBJS) so_locations $(NOSUCHFILE) $(GARBAGE)
|
1998-03-28 05:44:41 +03:00
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
|
|
|
clobber::
|
1999-10-14 19:09:11 +04:00
|
|
|
rm -rf $(OBJS) $(TARGETS) $(filter-out . ..,$(OBJDIR)) $(GARBAGE) so_locations $(NOSUCHFILE)
|
1998-03-28 05:44:41 +03:00
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
2000-04-06 00:18:13 +04:00
|
|
|
realclean clobber_all::
|
|
|
|
rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH)
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
|
|
|
distclean::
|
|
|
|
rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE)
|
1998-03-28 05:44:41 +03:00
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
2001-05-12 04:49:17 +04:00
|
|
|
real_install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS)
|
|
|
|
ifdef RELEASE_BINS
|
|
|
|
$(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir)
|
|
|
|
endif
|
|
|
|
ifdef RELEASE_HEADERS
|
2002-06-13 13:01:48 +04:00
|
|
|
$(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir)
|
2001-05-12 04:49:17 +04:00
|
|
|
endif
|
|
|
|
ifdef RELEASE_LIBS
|
2003-01-07 02:42:06 +03:00
|
|
|
$(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir)
|
2001-05-12 04:49:17 +04:00
|
|
|
endif
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
release:: export
|
1999-03-03 01:23:14 +03:00
|
|
|
ifdef RELEASE_BINS
|
|
|
|
@echo "Copying executable programs and scripts to release directory"
|
|
|
|
@if test -z "$(BUILD_NUMBER)"; then \
|
|
|
|
echo "BUILD_NUMBER must be defined"; \
|
|
|
|
false; \
|
|
|
|
else \
|
|
|
|
true; \
|
|
|
|
fi
|
|
|
|
@if test ! -d $(RELEASE_BIN_DIR); then \
|
|
|
|
rm -rf $(RELEASE_BIN_DIR); \
|
|
|
|
$(NSINSTALL) -D $(RELEASE_BIN_DIR);\
|
|
|
|
else \
|
|
|
|
true; \
|
|
|
|
fi
|
|
|
|
cp $(RELEASE_BINS) $(RELEASE_BIN_DIR)
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef RELEASE_LIBS
|
|
|
|
@echo "Copying libraries to release directory"
|
|
|
|
@if test -z "$(BUILD_NUMBER)"; then \
|
|
|
|
echo "BUILD_NUMBER must be defined"; \
|
|
|
|
false; \
|
A jumbo checkin, consisting of:
1. Ports to older revisions of some Unix variants, e.g., BSD/OS 1.1,
OSF1 V2.0, etc., contributed by Brian Ostrom <briano@netscape.com>.
2. QNX port, also contributed by Brian Ostrom.
3. New macro USE_MACH_DYLD to represent the dynamic library loading
API of NEXTSTEP and Rhapsody.
4. On platforms whose socket address has the sa_len field, make a
copy of the PRNetAddr argument for PR_Bind, PR_Connect, and PR_SendTo
and set its sa_len before passing it to the system calls. This
fix is suggested by Bert Driehuis <driehuis@playbeing.org>.
5. Removed the unused field _lockf64 of struct _MD_IOVector. Not
every Unix platform has lockf, and the POSIX file locking API
uses fcntl.
1998-11-23 09:33:00 +03:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
2003-01-07 02:42:06 +03:00
|
|
|
@if test ! -d $(RELEASE_LIBS_DEST); then \
|
|
|
|
rm -rf $(RELEASE_LIBS_DEST); \
|
|
|
|
$(NSINSTALL) -D $(RELEASE_LIBS_DEST);\
|
A jumbo checkin, consisting of:
1. Ports to older revisions of some Unix variants, e.g., BSD/OS 1.1,
OSF1 V2.0, etc., contributed by Brian Ostrom <briano@netscape.com>.
2. QNX port, also contributed by Brian Ostrom.
3. New macro USE_MACH_DYLD to represent the dynamic library loading
API of NEXTSTEP and Rhapsody.
4. On platforms whose socket address has the sa_len field, make a
copy of the PRNetAddr argument for PR_Bind, PR_Connect, and PR_SendTo
and set its sa_len before passing it to the system calls. This
fix is suggested by Bert Driehuis <driehuis@playbeing.org>.
5. Removed the unused field _lockf64 of struct _MD_IOVector. Not
every Unix platform has lockf, and the POSIX file locking API
uses fcntl.
1998-11-23 09:33:00 +03:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
2003-01-07 02:42:06 +03:00
|
|
|
cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
ifdef RELEASE_HEADERS
|
|
|
|
@echo "Copying header files to release directory"
|
|
|
|
@if test -z "$(BUILD_NUMBER)"; then \
|
|
|
|
echo "BUILD_NUMBER must be defined"; \
|
|
|
|
false; \
|
A jumbo checkin, consisting of:
1. Ports to older revisions of some Unix variants, e.g., BSD/OS 1.1,
OSF1 V2.0, etc., contributed by Brian Ostrom <briano@netscape.com>.
2. QNX port, also contributed by Brian Ostrom.
3. New macro USE_MACH_DYLD to represent the dynamic library loading
API of NEXTSTEP and Rhapsody.
4. On platforms whose socket address has the sa_len field, make a
copy of the PRNetAddr argument for PR_Bind, PR_Connect, and PR_SendTo
and set its sa_len before passing it to the system calls. This
fix is suggested by Bert Driehuis <driehuis@playbeing.org>.
5. Removed the unused field _lockf64 of struct _MD_IOVector. Not
every Unix platform has lockf, and the POSIX file locking API
uses fcntl.
1998-11-23 09:33:00 +03:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
|
|
|
@if test ! -d $(RELEASE_HEADERS_DEST); then \
|
|
|
|
rm -rf $(RELEASE_HEADERS_DEST); \
|
|
|
|
$(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\
|
A jumbo checkin, consisting of:
1. Ports to older revisions of some Unix variants, e.g., BSD/OS 1.1,
OSF1 V2.0, etc., contributed by Brian Ostrom <briano@netscape.com>.
2. QNX port, also contributed by Brian Ostrom.
3. New macro USE_MACH_DYLD to represent the dynamic library loading
API of NEXTSTEP and Rhapsody.
4. On platforms whose socket address has the sa_len field, make a
copy of the PRNetAddr argument for PR_Bind, PR_Connect, and PR_SendTo
and set its sa_len before passing it to the system calls. This
fix is suggested by Bert Driehuis <driehuis@playbeing.org>.
5. Removed the unused field _lockf64 of struct _MD_IOVector. Not
every Unix platform has lockf, and the POSIX file locking API
uses fcntl.
1998-11-23 09:33:00 +03:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
|
|
|
cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST)
|
|
|
|
endif
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
|
|
|
alltags:
|
|
|
|
rm -f TAGS tags
|
|
|
|
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):
|
|
|
|
cd $(@D); $(MAKE) $(@F)
|
|
|
|
|
|
|
|
$(PROGRAM): $(OBJS)
|
|
|
|
@$(MAKE_OBJDIR)
|
2003-01-20 19:26:24 +03:00
|
|
|
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
1998-03-28 05:44:41 +03:00
|
|
|
$(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
|
2000-01-11 23:44:12 +03:00
|
|
|
else
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
$(CC) $(OBJS) -Fe$@ $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
|
|
|
$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS)
|
|
|
|
endif
|
2000-01-11 23:44:12 +03:00
|
|
|
endif
|
2001-08-12 07:40:04 +04:00
|
|
|
ifdef ENABLE_STRIP
|
2000-09-28 21:47:22 +04:00
|
|
|
$(STRIP) $@
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
$(LIBRARY): $(OBJS)
|
|
|
|
@$(MAKE_OBJDIR)
|
|
|
|
rm -f $@
|
2000-01-11 23:44:12 +03:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
2001-02-24 08:39:43 +03:00
|
|
|
$(AR) $(subst /,\\,$(OBJS)) $(AR_FLAGS)
|
1999-11-23 09:23:52 +03:00
|
|
|
else
|
|
|
|
$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
|
1998-11-20 01:20:31 +03:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
ifeq ($(OS_TARGET), OS2)
|
2003-05-14 05:24:08 +04:00
|
|
|
$(IMPORT_LIBRARY): $(MAPFILE)
|
|
|
|
rm -f $@
|
|
|
|
$(IMPLIB) $@ $(MAPFILE)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
2003-01-20 19:26:24 +03:00
|
|
|
|
2003-01-04 05:14:13 +03:00
|
|
|
$(SHARED_LIBRARY): $(OBJS) $(MAPFILE)
|
1998-03-28 05:44:41 +03:00
|
|
|
@$(MAKE_OBJDIR)
|
|
|
|
rm -f $@
|
|
|
|
ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
|
|
|
|
echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms
|
|
|
|
nm -B -C -g $(OBJS) \
|
|
|
|
| awk '/ [T,D] / {print $$3}' \
|
|
|
|
| sed -e 's/^\.//' \
|
|
|
|
| sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms
|
|
|
|
$(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \
|
|
|
|
-bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
|
1999-07-15 16:37:21 +04:00
|
|
|
else # AIX 4.1
|
2003-01-20 19:26:24 +03:00
|
|
|
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
2001-05-12 04:49:17 +04:00
|
|
|
$(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS)
|
2000-01-11 23:44:12 +03:00
|
|
|
else
|
2003-05-14 05:24:08 +04:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $(MAPFILE)
|
|
|
|
else # !os2 vacpp
|
1999-07-15 16:37:21 +04:00
|
|
|
ifeq ($(OS_TARGET), OpenVMS)
|
2002-12-12 04:41:31 +03:00
|
|
|
@if test ! -f $(VMS_SYMVEC_FILE); then \
|
|
|
|
if test -f $(VMS_SYMVEC_FILE_MODULE); then \
|
|
|
|
echo Creating component options file $(VMS_SYMVEC_FILE); \
|
|
|
|
cp $(VMS_SYMVEC_FILE_MODULE) $(VMS_SYMVEC_FILE); \
|
|
|
|
fi; \
|
1999-07-15 16:37:21 +04:00
|
|
|
fi
|
|
|
|
endif # OpenVMS
|
2002-12-12 04:41:31 +03:00
|
|
|
$(MKSHLIB) $(OBJS) $(EXTRA_LIBS)
|
2003-05-14 05:24:08 +04:00
|
|
|
endif # OS2 vacpp
|
1999-07-15 16:37:21 +04:00
|
|
|
endif # WINNT
|
|
|
|
endif # AIX 4.1
|
2001-08-12 07:40:04 +04:00
|
|
|
ifdef ENABLE_STRIP
|
2000-09-28 21:47:22 +04:00
|
|
|
$(STRIP) $@
|
|
|
|
endif
|
1999-10-14 19:09:11 +04:00
|
|
|
|
2000-01-11 23:44:12 +03:00
|
|
|
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
1998-03-28 05:44:41 +03:00
|
|
|
$(RES): $(RESNAME)
|
|
|
|
@$(MAKE_OBJDIR)
|
|
|
|
ifeq ($(OS_TARGET),OS2)
|
2000-12-30 09:36:06 +03:00
|
|
|
$(RC) -DOS2 -r $< $@
|
1999-03-02 03:58:34 +03:00
|
|
|
else
|
Bugsplat bug #358401: created a separate .rc file for each DLL. The
product name is "Netscape Portable Runtime" and the file descriptions
are "NSPR Library", "PLDS Library", "PLC Library", and "PRSTRMS Library".
A debug build is indicated in the file description. The copyright years
changed to 1996-1999.
Modified files: rules.mk, lib/ds/Makefile, lib/ds/Makefile.in,
lib/libc/src/Makefile, lib/libc/src/Makefile.in,
lib/prstreams/Makefile, lib/prstreams/Makefile.in,
prinit.h, nspr.rc
Added files: plds.rc, plc.rc, prstrms.rc
Removed file: resource.h
1999-10-15 04:51:41 +04:00
|
|
|
# The resource compiler does not understand the -U option.
|
2003-01-20 19:26:24 +03:00
|
|
|
ifdef NS_USE_GCC
|
|
|
|
$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
|
|
|
|
else
|
|
|
|
$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
|
|
|
|
endif # GCC
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
@echo $(RES) finished
|
|
|
|
endif
|
|
|
|
|
2003-01-04 05:14:13 +03:00
|
|
|
$(MAPFILE): $(LIBRARY_NAME).def
|
|
|
|
@$(MAKE_OBJDIR)
|
|
|
|
ifeq ($(OS_ARCH),SunOS)
|
|
|
|
grep -v ';-' $< | \
|
|
|
|
sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@
|
|
|
|
endif
|
2003-05-14 05:24:08 +04:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@
|
|
|
|
echo PROTMODE >> $@
|
|
|
|
echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@
|
|
|
|
echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@
|
|
|
|
echo EXPORTS >> $@
|
|
|
|
grep -v ';+' $< | grep -v ';-' | \
|
2003-09-16 05:58:03 +04:00
|
|
|
sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \
|
|
|
|
awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@
|
|
|
|
$(ADD_TO_DEF_FILE)
|
2003-05-14 05:24:08 +04:00
|
|
|
endif
|
2003-01-04 05:14:13 +03:00
|
|
|
|
2003-04-16 05:23:52 +04:00
|
|
|
#
|
|
|
|
# Translate source filenames to absolute paths. This is required for
|
|
|
|
# debuggers under Windows and OS/2 to find source files automatically.
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
NEED_ABSOLUTE_PATH = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
|
|
|
NEED_ABSOLUTE_PATH = 1
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef NEED_ABSOLUTE_PATH
|
|
|
|
PWD := $(shell pwd)
|
|
|
|
abspath = $(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))
|
|
|
|
endif
|
|
|
|
|
1998-04-21 21:21:53 +04:00
|
|
|
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
|
1998-03-28 05:44:41 +03:00
|
|
|
@$(MAKE_OBJDIR)
|
2003-01-20 19:26:24 +03:00
|
|
|
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
2003-04-16 05:23:52 +04:00
|
|
|
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2000-01-11 23:44:12 +03:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
2003-04-16 05:23:52 +04:00
|
|
|
$(CCC) -Fo$@ -c $(CCCFLAGS) $(call abspath,$<)
|
|
|
|
else
|
|
|
|
ifdef NEED_ABSOLUTE_PATH
|
|
|
|
$(CCC) -o $@ -c $(CCCFLAGS) $(call abspath,$<)
|
1998-11-21 02:19:54 +03:00
|
|
|
else
|
|
|
|
$(CCC) -o $@ -c $(CCCFLAGS) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
2000-01-11 23:44:12 +03:00
|
|
|
endif
|
2003-04-16 05:23:52 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
WCCFLAGS1 = $(subst /,\\,$(CFLAGS))
|
|
|
|
WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1))
|
|
|
|
WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2))
|
1998-04-21 21:21:53 +04:00
|
|
|
$(OBJDIR)/%.$(OBJ_SUFFIX): %.c
|
1998-03-28 05:44:41 +03:00
|
|
|
@$(MAKE_OBJDIR)
|
2003-01-20 19:26:24 +03:00
|
|
|
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
|
2003-04-16 05:23:52 +04:00
|
|
|
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
|
2000-01-11 23:44:12 +03:00
|
|
|
else
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
2003-04-16 05:23:52 +04:00
|
|
|
$(CC) -Fo$@ -c $(CFLAGS) $(call abspath,$<)
|
|
|
|
else
|
|
|
|
ifdef NEED_ABSOLUTE_PATH
|
|
|
|
$(CC) -o $@ -c $(CFLAGS) $(call abspath,$<)
|
2000-01-11 01:20:41 +03:00
|
|
|
else
|
|
|
|
$(CC) -o $@ -c $(CFLAGS) $<
|
|
|
|
endif
|
2000-01-11 23:44:12 +03:00
|
|
|
endif
|
2003-04-16 05:23:52 +04:00
|
|
|
endif
|
2000-01-11 23:44:12 +03:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1998-04-21 21:21:53 +04:00
|
|
|
$(OBJDIR)/%.$(OBJ_SUFFIX): %.s
|
1998-03-28 05:44:41 +03:00
|
|
|
@$(MAKE_OBJDIR)
|
1999-10-14 19:09:11 +04:00
|
|
|
$(AS) -o $@ $(ASFLAGS) -c $<
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2001-06-23 08:09:19 +04:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
$(OBJDIR)/%.$(OBJ_SUFFIX): %.asm
|
|
|
|
@$(MAKE_OBJDIR)
|
|
|
|
$(AS) -Fdo:./$(OBJDIR) $(ASFLAGS) $<
|
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
%.i: %.c
|
|
|
|
$(CC) -C -E $(CFLAGS) $< > $*.i
|
|
|
|
|
|
|
|
%: %.pl
|
1999-10-14 19:09:11 +04:00
|
|
|
rm -f $@; cp $< $@; chmod +x $@
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2000-02-24 02:38:19 +03:00
|
|
|
#
|
|
|
|
# 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.
|
|
|
|
#
|
|
|
|
|
|
|
|
DUMMY_DEPEND_H = $(topsrcdir)/config/prdepend.h
|
|
|
|
|
|
|
|
$(filter $(OBJDIR)/%.$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%.$(OBJ_SUFFIX): $(DUMMY_DEPEND_H)
|
|
|
|
|
|
|
|
# END OF HACK
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
################################################################################
|
|
|
|
# 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:
|
1998-04-21 21:21:53 +04:00
|
|
|
.SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Fake targets. Always run these rules, even if a file/directory with that
|
|
|
|
# name already exists.
|
|
|
|
#
|
|
|
|
.PHONY: all alltags clean export install libs realclean release
|
1998-09-26 00:34:39 +04:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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)
|