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.
|
|
|
|
#
|
1999-03-18 00:25:08 +03:00
|
|
|
ifeq (,$(filter-out WIN95 WIN16 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-12-16 21:09:00 +03:00
|
|
|
ifdef SHARED_LIBRARY
|
2000-01-11 23:44:12 +03:00
|
|
|
ifeq (,$(filter-out WINNT OS2,$(OS_ARCH)))
|
2000-12-16 21:09:00 +03:00
|
|
|
TARGETS = $(SHARED_LIBRARY) $(IMPORT_LIBRARY)
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2000-12-16 21:09:00 +03:00
|
|
|
TARGETS = $(SHARED_LIBRARY)
|
|
|
|
endif
|
|
|
|
else
|
|
|
|
TARGETS = $(LIBRARY)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2001-02-24 08:43:14 +03:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
EXTRA_LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_LIBS))
|
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
# 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))) \
|
|
|
|
$(addprefix $(OBJDIR)/,$(ASFILES:.s=.$(OBJ_SUFFIX)))
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_TARGET), WIN16)
|
|
|
|
comma := ,
|
|
|
|
empty :=
|
|
|
|
space := $(empty) $(empty)
|
|
|
|
W16OBJS = $(subst $(space),$(comma)$(space),$(strip $(OBJS)))
|
|
|
|
W16TEMP =$(OS_LIBS) $(EXTRA_LIBS)
|
|
|
|
ifeq ($(strip $(W16TEMP)),)
|
|
|
|
W16LIBS =
|
|
|
|
else
|
1998-05-06 03:28:45 +04:00
|
|
|
W16LIBS = library $(subst $(space),$(comma)$(space),$(strip $(W16TEMP)))
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
W16DEF = $(notdir $(basename $(SHARED_LIBRARY))).DEF
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
ifneq ($(OS_TARGET), WIN16)
|
|
|
|
OBJS += $(RES)
|
|
|
|
endif
|
|
|
|
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
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
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
|
|
|
|
@if test ! -d $(RELEASE_LIB_DIR); then \
|
1998-04-25 20:14:33 +04:00
|
|
|
rm -rf $(RELEASE_LIB_DIR); \
|
1998-03-28 05:44:41 +03:00
|
|
|
$(NSINSTALL) -D $(RELEASE_LIB_DIR);\
|
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_LIBS) $(RELEASE_LIB_DIR)
|
|
|
|
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)
|
|
|
|
ifeq ($(OS_ARCH),WINNT)
|
|
|
|
$(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
|
2000-09-28 21:47:22 +04:00
|
|
|
ifdef BUILD_OPT
|
|
|
|
$(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
|
|
|
|
ifdef USE_AUTOCONF
|
|
|
|
$(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS)
|
1998-11-20 01:20:31 +03:00
|
|
|
else
|
1998-03-28 05:44:41 +03:00
|
|
|
$(AR) $(OBJS) $(AR_EXTRA_ARGS)
|
1999-11-23 09:23:52 +03:00
|
|
|
endif # USE_AUTOCONF
|
1998-11-20 01:20:31 +03:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
$(RANLIB) $@
|
|
|
|
|
|
|
|
ifeq ($(OS_TARGET), WIN16)
|
|
|
|
$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
|
|
|
|
wlib $(OS_LIB_FLAGS) $@ +$(SHARED_LIBRARY)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(OS_TARGET), OS2)
|
|
|
|
$(IMPORT_LIBRARY): $(SHARED_LIBRARY)
|
|
|
|
$(IMPLIB) $@ $(SHARED_LIBRARY).def
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(SHARED_LIBRARY): $(OBJS)
|
|
|
|
@$(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
|
1998-03-28 05:44:41 +03:00
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
ifeq ($(OS_TARGET), WIN16)
|
|
|
|
echo system windows dll initinstance >w16link
|
|
|
|
echo option map >>w16link
|
|
|
|
echo option oneautodata >>w16link
|
|
|
|
echo option heapsize=32K >>w16link
|
|
|
|
echo option $(OS_DLL_OPTION) >>w16link
|
|
|
|
echo debug $(DEBUGTYPE) all >>w16link
|
|
|
|
echo name $@ >>w16link
|
|
|
|
echo file >>w16link
|
|
|
|
echo $(W16OBJS) >>w16link
|
|
|
|
echo $(W16IMPORTS) >>w16link
|
|
|
|
echo $(W16LIBS) >>w16link
|
|
|
|
echo $(W16_EXPORTS) >>w16link
|
|
|
|
echo libfile libentry >>w16link
|
|
|
|
$(LINK) @w16link.
|
|
|
|
rm w16link
|
1999-07-15 16:37:21 +04:00
|
|
|
else # WIN16
|
2000-01-11 23:44:12 +03:00
|
|
|
$(LINK_DLL) -MAP $(DLLBASE) $(OS_LIBS) $(EXTRA_LIBS) $(OBJS)
|
|
|
|
endif # WINNT
|
|
|
|
else
|
|
|
|
ifeq ($(OS_ARCH),OS2)
|
1998-03-28 05:44:41 +03:00
|
|
|
# append ( >> ) doesn't seem to be working under OS/2 gmake. Run through OS/2 shell instead.
|
|
|
|
@cmd /C "echo LIBRARY $(notdir $(basename $(SHARED_LIBRARY))) INITINSTANCE TERMINSTANCE >$@.def"
|
|
|
|
@cmd /C "echo PROTMODE >>$@.def"
|
|
|
|
@cmd /C "echo CODE LOADONCALL MOVEABLE DISCARDABLE >>$@.def"
|
|
|
|
@cmd /C "echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >>$@.def"
|
|
|
|
@cmd /C "echo EXPORTS >>$@.def"
|
2000-01-11 23:44:12 +03:00
|
|
|
@cmd /C "$(FILTER) $(LIBRARY) | grep -v _DLL_InitTerm >>$@.def"
|
1998-11-20 01:20:31 +03:00
|
|
|
$(LINK_DLL) $(DLLBASE) $(OBJS) $(OS_LIBS) $(EXTRA_LIBS) $@.def
|
2000-01-11 23:44:12 +03:00
|
|
|
else # OS2
|
1999-07-15 16:37:21 +04:00
|
|
|
ifeq ($(OS_TARGET), OpenVMS)
|
|
|
|
@if test ! -f $(OBJDIR)/VMSuni.opt; then \
|
|
|
|
echo "Creating universal symbol option file $(OBJDIR)/VMSuni.opt";\
|
|
|
|
create_opt_uni $(OBJS); \
|
|
|
|
mv VMSuni.opt $(OBJDIR); \
|
|
|
|
fi
|
|
|
|
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS) $(OBJDIR)/VMSuni.opt
|
|
|
|
@echo "`translate $@`" > $(@:.$(DLL_SUFFIX)=.vms)
|
|
|
|
else # OpenVMS
|
2000-12-30 08:44:01 +03:00
|
|
|
ifdef USE_AUTOCONF
|
2001-01-17 22:14:16 +03:00
|
|
|
$(MKSHLIB) $(OBJS) $(EXTRA_LIBS)
|
2000-12-30 08:44:01 +03:00
|
|
|
else
|
1998-04-21 21:21:53 +04:00
|
|
|
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
|
2000-12-30 08:44:01 +03:00
|
|
|
endif # USE_AUTOCONF
|
1999-07-15 16:37:21 +04:00
|
|
|
endif # OpenVMS
|
2000-01-11 23:44:12 +03:00
|
|
|
endif # OS2
|
1999-07-15 16:37:21 +04:00
|
|
|
endif # WINNT
|
|
|
|
endif # AIX 4.1
|
2000-09-28 21:47:22 +04:00
|
|
|
ifdef BUILD_OPT
|
|
|
|
$(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.
|
2000-12-30 09:36:06 +03:00
|
|
|
$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
@echo $(RES) finished
|
|
|
|
endif
|
|
|
|
|
1998-04-21 21:21:53 +04:00
|
|
|
$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp
|
1998-03-28 05:44:41 +03:00
|
|
|
@$(MAKE_OBJDIR)
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
1998-09-26 00:34:39 +04:00
|
|
|
$(CCC) -Fo$@ -c $(CCCFLAGS) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2000-01-11 23:44:12 +03:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
$(CCC) -Fo$@ -c $(CCCFLAGS) $<
|
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
|
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)
|
|
|
|
ifeq ($(OS_ARCH), WINNT)
|
|
|
|
ifeq ($(OS_TARGET), WIN16)
|
|
|
|
# $(MOD_DEPTH)/config/w16opt $(WCCFLAGS3)
|
|
|
|
echo $(WCCFLAGS3) >w16wccf
|
1998-04-21 21:21:53 +04:00
|
|
|
$(CC) -zq -fo$(OBJDIR)\\$*.$(OBJ_SUFFIX) @w16wccf $*.c
|
1998-03-28 05:44:41 +03:00
|
|
|
rm w16wccf
|
|
|
|
else
|
2000-01-11 00:08:45 +03:00
|
|
|
$(CC) -Fo$@ -c $(CFLAGS) $<
|
|
|
|
endif
|
2000-01-11 23:44:12 +03:00
|
|
|
else
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
$(CC) -Fo$@ -c $(CFLAGS) $<
|
2000-01-11 01:20:41 +03:00
|
|
|
else
|
|
|
|
$(CC) -o $@ -c $(CFLAGS) $<
|
|
|
|
endif
|
2000-01-11 23:44:12 +03:00
|
|
|
endif
|
|
|
|
|
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
|
|
|
|
|
|
|
%.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)
|