1998-03-28 05:44:41 +03:00
|
|
|
#
|
1999-11-06 06:40:37 +03:00
|
|
|
# The contents of this file are subject to the Netscape 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/NPL/
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
1999-11-06 06:40:37 +03:00
|
|
|
# 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.
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
1999-11-06 06:40:37 +03:00
|
|
|
# The Original Code is mozilla.org code.
|
|
|
|
#
|
|
|
|
# The Initial Developer of the Original Code is Netscape
|
1998-03-28 05:44:41 +03:00
|
|
|
# Communications Corporation. Portions created by Netscape are
|
1999-11-06 06:40:37 +03:00
|
|
|
# Copyright (C) 1998 Netscape Communications Corporation. All
|
|
|
|
# Rights Reserved.
|
|
|
|
#
|
|
|
|
# Contributor(s):
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
################################################################################
|
|
|
|
#
|
2000-04-01 12:37:30 +04:00
|
|
|
# We now use a 2-pass build system. This needs to be re-thought....
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
# Pass 1. export - Create generated headers and stubs. Publish public headers
|
1999-09-09 13:24:58 +04:00
|
|
|
# to dist/include.
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
2000-04-01 12:37:30 +04:00
|
|
|
# Pass 2. install - Create libraries & programs. Publish them to dist/bin.
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
2000-04-01 12:37:30 +04:00
|
|
|
# `gmake` will build each of these properly, but `gmake -jN` may break
|
|
|
|
# use `gmake MAKE='gmake -jN'` instead
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
# 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, CPPSRCS -- .c and .cpp files to compile
|
|
|
|
# (used to define $OBJS)
|
|
|
|
# d)
|
|
|
|
# PROGRAM -- the target program name to create from $OBJS
|
1999-01-23 14:41:15 +03:00
|
|
|
# d2)
|
|
|
|
# SIMPLE_PROGRAMS -- Compiles Foo.cpp Bar.cpp into Foo, Bar executables.
|
1998-03-28 05:44:41 +03:00
|
|
|
# e)
|
|
|
|
# LIBRARY_NAME -- the target library name to create from $OBJS
|
|
|
|
# f)
|
|
|
|
# JSRCS -- java source files to compile into class files
|
|
|
|
# (if you don't specify this it will default to *.java)
|
|
|
|
# g)
|
|
|
|
# PACKAGE -- the package to put the .class files into
|
|
|
|
# (e.g. netscape/applet)
|
|
|
|
# h)
|
|
|
|
# JMC_EXPORT -- java files to be exported for use by JMC_GEN
|
|
|
|
# (this is a list of Class names)
|
|
|
|
# i)
|
|
|
|
# JRI_GEN -- files to run through javah to generate headers and stubs
|
|
|
|
# (output goes into the _jri sub-dir)
|
|
|
|
# j)
|
1998-08-01 00:19:50 +04:00
|
|
|
# JNI_GEN -- files to run through javah to generate headers and stubs
|
|
|
|
# (output goes into the _jni sub-dir)
|
|
|
|
# k)
|
1998-03-28 05:44:41 +03:00
|
|
|
# JMC_GEN -- files to run through jmc to generate headers and stubs
|
|
|
|
# (output goes into the _jmc sub-dir)
|
|
|
|
#
|
|
|
|
################################################################################
|
1998-08-20 00:42:14 +04:00
|
|
|
ifndef topsrcdir
|
1999-09-09 13:24:58 +04:00
|
|
|
topsrcdir = $(DEPTH)
|
1998-08-20 00:42:14 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2000-09-20 23:35:24 +04:00
|
|
|
ifndef MOZILLA_DIR
|
2000-10-27 12:47:51 +04:00
|
|
|
MOZILLA_DIR = $(topsrcdir)
|
2000-09-20 23:35:24 +04:00
|
|
|
endif
|
|
|
|
|
2000-03-14 06:00:52 +03:00
|
|
|
ifndef INCLUDED_CONFIG_MK
|
1998-08-20 00:42:14 +04:00
|
|
|
include $(topsrcdir)/config/config.mk
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1999-09-04 02:11:18 +04:00
|
|
|
ifdef CROSS_COMPILE
|
2000-03-31 11:18:52 +04:00
|
|
|
HOST_AR_FLAGS = $(AR_FLAGS)
|
1999-09-01 18:43:44 +04:00
|
|
|
endif
|
|
|
|
|
2000-02-25 06:55:50 +03:00
|
|
|
REPORT_BUILD = @echo $(notdir $<)
|
|
|
|
|
2000-06-21 04:54:56 +04:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
EXEC =
|
|
|
|
else
|
|
|
|
EXEC = exec
|
|
|
|
endif
|
|
|
|
|
2000-03-14 06:00:52 +03:00
|
|
|
# ELOG prints out failed command when building silently (gmake -s).
|
2000-02-26 07:21:53 +03:00
|
|
|
ifneq (,$(findstring s,$(MAKEFLAGS)))
|
2000-06-21 04:54:56 +04:00
|
|
|
ELOG := $(EXEC) sh $(BUILD_TOOLS)/print-failed-commands.sh
|
2000-02-26 07:21:53 +03:00
|
|
|
else
|
2000-03-14 06:00:52 +03:00
|
|
|
ELOG :=
|
2000-02-26 07:21:53 +03:00
|
|
|
endif
|
|
|
|
|
1998-07-08 07:49:31 +04:00
|
|
|
#
|
|
|
|
# Library rules
|
|
|
|
#
|
|
|
|
# If NO_STATIC_LIB is set, the static library will not be built.
|
|
|
|
# If NO_SHARED_LIB is set, the shared library will not be built.
|
|
|
|
#
|
2000-03-31 05:24:48 +04:00
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
STATIC_LIBS = $(filter %_s, $(EXTRA_DSO_LIBS))
|
|
|
|
SHARED_LIBS = $(filter-out %_s, $(EXTRA_DSO_LIBS))
|
|
|
|
EXTRA_DSO_LIBS := $(addprefix lib,$(STATIC_LIBS)) $(SHARED_LIBS)
|
1999-09-09 13:24:58 +04:00
|
|
|
endif
|
2000-03-31 05:24:48 +04:00
|
|
|
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
EXTRA_DSO_LIBS := $(addsuffix .$(LIB_SUFFIX),$(addprefix $(DIST)/lib/,$(EXTRA_DSO_LIBS)))
|
2000-05-16 08:41:54 +04:00
|
|
|
EXTRA_DSO_LIBS := $(filter-out %/bin %/lib,$(EXTRA_DSO_LIBS))
|
2000-07-19 17:58:45 +04:00
|
|
|
EXTRA_DSO_LDOPTS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(EXTRA_DSO_LDOPTS))
|
|
|
|
LIBS := $(patsubst -l%,$(DIST)/lib/%.$(LIB_SUFFIX),$(LIBS))
|
2000-03-31 05:24:48 +04:00
|
|
|
else
|
2000-04-04 11:37:50 +04:00
|
|
|
EXTRA_DSO_LIBS := $(addprefix -l,$(EXTRA_DSO_LIBS))
|
1999-09-09 13:24:58 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2000-03-31 05:24:48 +04:00
|
|
|
ifndef LIBRARY
|
|
|
|
ifdef LIBRARY_NAME
|
1998-03-28 05:44:41 +03:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
2000-03-31 05:24:48 +04:00
|
|
|
ifdef SHORT_LIBNAME
|
|
|
|
LIBRARY_NAME := $(SHORT_LIBNAME)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
LIBRARY := lib$(LIBRARY_NAME).$(LIB_SUFFIX)
|
1999-09-09 13:24:58 +04:00
|
|
|
endif
|
|
|
|
endif
|
1999-02-19 06:06:32 +03:00
|
|
|
|
2000-03-31 11:18:52 +04:00
|
|
|
ifndef HOST_LIBRARY
|
|
|
|
ifdef HOST_LIBRARY_NAME
|
|
|
|
HOST_LIBRARY := lib$(HOST_LIBRARY_NAME).$(LIB_SUFFIX)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2000-03-31 05:24:48 +04:00
|
|
|
ifdef LIBRARY
|
1998-07-08 07:49:31 +04:00
|
|
|
ifndef NO_SHARED_LIB
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef MKSHLIB
|
1999-05-06 03:38:15 +04:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
2000-03-31 05:24:48 +04:00
|
|
|
DEF_OBJS = $(OBJS)
|
2000-04-01 12:37:30 +04:00
|
|
|
ifneq ($(EXPORT_OBJS),1)
|
2000-03-31 05:24:48 +04:00
|
|
|
DEF_OBJS += $(SHARED_LIBRARY_LIBS)
|
|
|
|
endif
|
2000-04-02 11:46:23 +04:00
|
|
|
SHARED_LIBRARY := $(LIBRARY_NAME)$(DLL_SUFFIX)
|
2000-03-31 05:24:48 +04:00
|
|
|
DEF_FILE := $(SHARED_LIBRARY:.dll=.def)
|
|
|
|
IMPORT_LIBRARY := $(SHARED_LIBRARY:.dll=.lib)
|
1999-02-19 06:06:32 +03:00
|
|
|
else # OS2
|
1999-05-06 03:38:15 +04:00
|
|
|
|
2000-03-31 14:49:39 +04:00
|
|
|
|
|
|
|
ifeq (,$(filter-out BeOS, $(OS_ARCH)))
|
1999-05-06 03:38:15 +04:00
|
|
|
# Unix only
|
|
|
|
ifdef LIB_IS_C_ONLY
|
|
|
|
MKSHLIB = $(MKCSHLIB)
|
|
|
|
endif
|
2000-03-31 14:49:39 +04:00
|
|
|
endif
|
1999-05-06 03:38:15 +04:00
|
|
|
|
2000-03-31 14:49:39 +04:00
|
|
|
SHARED_LIBRARY := $(LIBRARY:.$(LIB_SUFFIX)=$(DLL_SUFFIX))
|
2000-06-23 02:11:45 +04:00
|
|
|
IMPORT_LIBRARY :=
|
1999-06-26 12:16:01 +04:00
|
|
|
|
1999-02-19 06:06:32 +03:00
|
|
|
endif # OS2
|
|
|
|
endif # MKSHLIB
|
|
|
|
endif # !NO_SHARED_LIB
|
2000-03-31 14:49:39 +04:00
|
|
|
endif # LIBRARY
|
1998-07-08 07:49:31 +04:00
|
|
|
|
|
|
|
ifdef NO_STATIC_LIB
|
|
|
|
LIBRARY = $(NULL)
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1998-08-20 00:42:14 +04:00
|
|
|
ifdef NO_SHARED_LIB
|
2000-04-02 11:46:23 +04:00
|
|
|
DLL_SUFFIX = .$(LIB_SUFFIX)
|
1998-08-20 00:42:14 +04:00
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifndef TARGETS
|
2000-03-31 11:18:52 +04:00
|
|
|
TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(HOST_PROGRAM) $(HOST_SIMPLE_PROGRAMS)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef OBJS
|
|
|
|
OBJS = $(JRI_STUB_CFILES) $(addsuffix .o, $(JMC_GEN)) $(CSRCS:.c=.o) $(CPPSRCS:.cpp=.o) $(ASFILES:.s=.o)
|
|
|
|
endif
|
|
|
|
|
2000-03-31 11:18:52 +04:00
|
|
|
ifndef HOST_OBJS
|
|
|
|
HOST_OBJS = $(HOST_CSRCS:.c=.ho)
|
|
|
|
endif
|
|
|
|
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
LIBOBJS := $(OBJS)
|
|
|
|
else
|
1998-03-28 05:44:41 +03:00
|
|
|
LIBOBJS := $(addprefix \", $(OBJS))
|
|
|
|
LIBOBJS := $(addsuffix \", $(LIBOBJS))
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifndef PACKAGE
|
|
|
|
PACKAGE = .
|
|
|
|
endif
|
|
|
|
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
2000-03-14 06:00:52 +03:00
|
|
|
ALL_TRASH = \
|
|
|
|
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
|
|
|
|
$(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \
|
|
|
|
$(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) $(JMC_STUBS) \
|
|
|
|
$(JMC_HEADERS) $(JMC_EXPORT_FILES) \
|
|
|
|
so_locations _gen _stubs _jmc _jri \
|
|
|
|
$(wildcard gts_tmp_*) \
|
2000-03-31 11:18:52 +04:00
|
|
|
$(wildcard $(JAVA_DESTPATH)/$(PACKAGE)/*.class)
|
2000-08-30 05:15:32 +04:00
|
|
|
ALL_TRASH_DIRS = \
|
|
|
|
$(GARBAGE_DIRS)
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2000-03-14 06:00:52 +03:00
|
|
|
ALL_TRASH = \
|
|
|
|
$(GARBAGE) $(TARGETS) $(OBJS) $(PROGOBJS) LOGS TAGS a.out \
|
2000-07-19 18:03:25 +04:00
|
|
|
$(HOST_PROGOBJS) $(HOST_OBJS) $(IMPORT_LIBRARY) $(DEF_FILE)\
|
|
|
|
so_locations _gen _stubs $(wildcard *.res) \
|
2000-03-14 06:00:52 +03:00
|
|
|
$(wildcard gts_tmp_*) $(LIBRARY:%.a=.%.timestamp)
|
2000-08-30 05:15:32 +04:00
|
|
|
ALL_TRASH_DIRS = \
|
|
|
|
$(GARBAGE_DIRS)
|
1999-03-22 23:43:05 +03:00
|
|
|
endif
|
|
|
|
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef JDIRS
|
2000-03-14 06:00:52 +03:00
|
|
|
GARBAGE += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS))
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1999-08-09 18:55:56 +04:00
|
|
|
ifdef QTDIR
|
2000-03-14 06:00:52 +03:00
|
|
|
GARBAGE += $(MOCSRCS)
|
1999-08-09 18:55:56 +04:00
|
|
|
endif
|
|
|
|
|
2000-06-12 04:49:01 +04:00
|
|
|
ifdef SIMPLE_PROGRAMS
|
|
|
|
GARBAGE += $(SIMPLE_PROGRAMS:%=%.o)
|
|
|
|
endif
|
|
|
|
|
|
|
|
ifdef HOST_SIMPLE_PROGRAMS
|
|
|
|
GARBAGE += $(HOST_SIMPLE_PROGRAMS:%=%.ho)
|
|
|
|
endif
|
|
|
|
|
2000-01-12 01:11:02 +03:00
|
|
|
#
|
|
|
|
# the Solaris WorkShop template repository cache. it occasionally can get
|
|
|
|
# out of sync, so targets like clobber should kill it.
|
|
|
|
#
|
|
|
|
ifeq ($(OS_ARCH),SunOS)
|
|
|
|
ifeq ($(GNU_CXX),)
|
2000-09-13 11:36:37 +04:00
|
|
|
GARBAGE_DIRS += SunWS_cache
|
2000-01-12 01:11:02 +03:00
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
JMC_SUBDIR = _jmc
|
|
|
|
else
|
|
|
|
JMC_SUBDIR = $(LOCAL_JMC_SUBDIR)
|
|
|
|
endif
|
|
|
|
|
|
|
|
JDK_GEN_DIR = _gen
|
|
|
|
JMC_GEN_DIR = $(JMC_SUBDIR)
|
|
|
|
JRI_GEN_DIR = _jri
|
1998-08-01 00:19:50 +04:00
|
|
|
JNI_GEN_DIR = _jni
|
1998-03-28 05:44:41 +03:00
|
|
|
JDK_STUB_DIR = _stubs
|
1999-05-08 06:06:15 +04:00
|
|
|
XPIDL_GEN_DIR = _xpidlgen
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2000-03-02 06:39:19 +03:00
|
|
|
ifdef MOZ_UPDATE_XTERM
|
2000-04-18 05:27:01 +04:00
|
|
|
# Its good not to have a newline at the end of the titlebar string because it
|
|
|
|
# makes the make -s output easier to read. Echo -n does not work on all
|
|
|
|
# platforms, but we can trick sed into doing it.
|
|
|
|
UPDATE_TITLE = sed -e "s!Y!$@ in $(shell $(BUILD_TOOLS)/print-depth-path.sh)/$$d!" $(topsrcdir)/config/xterm.str;
|
1999-02-08 22:59:25 +03:00
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef DIRS
|
2000-03-14 06:00:52 +03:00
|
|
|
EXIT_ON_ERROR := set -e; # Shell loops continue past errors without this.
|
2000-03-02 06:39:19 +03:00
|
|
|
LOOP_OVER_DIRS = \
|
2000-03-02 23:45:23 +03:00
|
|
|
@$(EXIT_ON_ERROR) \
|
|
|
|
for d in $(DIRS); do \
|
2000-03-02 06:39:19 +03:00
|
|
|
$(UPDATE_TITLE) \
|
|
|
|
$(MAKE) -C $$d $@; \
|
|
|
|
done
|
2000-11-10 03:55:44 +03:00
|
|
|
|
|
|
|
LOOP_OVER_MOZ_DIRS = \
|
|
|
|
@$(EXIT_ON_ERROR) \
|
|
|
|
for d in $(filter-out $(STATIC_MAKEFILES), $(DIRS)); do \
|
|
|
|
$(UPDATE_TITLE) \
|
|
|
|
$(MAKE) -C $$d $@; \
|
|
|
|
done
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1998-07-08 07:49:31 +04:00
|
|
|
#
|
|
|
|
# Now we can differentiate between objects used to build a library, and
|
|
|
|
# objects used to build an executable in the same directory.
|
|
|
|
#
|
|
|
|
ifndef PROGOBJS
|
|
|
|
PROGOBJS = $(OBJS)
|
|
|
|
endif
|
|
|
|
|
2000-03-31 11:18:52 +04:00
|
|
|
ifndef HOST_PROGOBJS
|
|
|
|
HOST_PROGOBJS = $(HOST_OBJS)
|
|
|
|
endif
|
|
|
|
|
1999-08-25 01:45:06 +04:00
|
|
|
# SUBMAKEFILES: List of Makefiles for next level down.
|
|
|
|
# This is used to update or create the Makefiles before invoking them.
|
1999-09-09 13:24:58 +04:00
|
|
|
ifneq ($(DIRS),)
|
|
|
|
SUBMAKEFILES := $(addsuffix /Makefile, $(filter-out $(STATIC_MAKEFILES), $(DIRS)))
|
1999-08-25 01:45:06 +04:00
|
|
|
endif
|
|
|
|
|
|
|
|
# MAKE_DIRS: List of directories to build while looping over directories.
|
1999-09-09 13:24:58 +04:00
|
|
|
MAKE_DIRS =
|
1999-08-25 01:45:06 +04:00
|
|
|
|
|
|
|
ifdef COMPILER_DEPEND
|
|
|
|
ifdef OBJS
|
1999-09-09 13:24:58 +04:00
|
|
|
MAKE_DIRS += $(MDDEPDIR)
|
2000-08-30 05:15:32 +04:00
|
|
|
GARBAGE_DIRS += $(MDDEPDIR)
|
1999-09-09 13:24:58 +04:00
|
|
|
endif
|
1999-08-25 01:45:06 +04:00
|
|
|
endif
|
1999-09-09 13:24:58 +04:00
|
|
|
|
|
|
|
ifneq ($(XPIDLSRCS),)
|
2000-08-30 05:15:32 +04:00
|
|
|
GARBAGE_DIRS += $(XPIDL_GEN_DIR)
|
1999-08-25 01:45:06 +04:00
|
|
|
endif
|
|
|
|
|
1999-09-09 13:24:58 +04:00
|
|
|
#
|
|
|
|
# Tags: emacs (etags), vi (ctags)
|
|
|
|
# TAG_PROGRAM := ctags -L -
|
|
|
|
#
|
|
|
|
TAG_PROGRAM = xargs etags -a
|
|
|
|
|
|
|
|
#
|
|
|
|
# Turn on C++ linking if we have any .cpp files
|
|
|
|
# (moved this from config.mk so that config.mk can be included
|
|
|
|
# before the CPPSRCS are defined)
|
|
|
|
#
|
|
|
|
ifdef CPPSRCS
|
|
|
|
CPP_PROG_LINK = 1
|
|
|
|
endif
|
|
|
|
|
2000-04-23 21:48:04 +04:00
|
|
|
#
|
|
|
|
# Make sure to wrap static libs inside linker specific flags to turn on & off
|
|
|
|
# inclusion of all symbols inside the static libs
|
|
|
|
#
|
2000-11-15 06:37:45 +03:00
|
|
|
ifndef NO_LD_ARCHIVE_FLAGS
|
2000-04-23 21:48:04 +04:00
|
|
|
ifdef SHARED_LIBRARY_LIBS
|
|
|
|
EXTRA_DSO_LDOPTS := $(MKSHLIB_FORCE_ALL) $(SHARED_LIBRARY_LIBS) $(MKSHLIB_UNFORCE_ALL) $(EXTRA_DSO_LDOPTS)
|
|
|
|
endif
|
2000-11-15 06:37:45 +03:00
|
|
|
endif
|
2000-04-23 21:48:04 +04:00
|
|
|
|
1999-09-22 13:54:00 +04:00
|
|
|
#
|
|
|
|
# This will strip out symbols that the component shouldnt be
|
|
|
|
# exporting from the .dynsym section.
|
|
|
|
#
|
1999-09-16 17:43:15 +04:00
|
|
|
ifdef IS_COMPONENT
|
1999-09-22 13:54:00 +04:00
|
|
|
EXTRA_DSO_LDOPTS += $(MOZ_COMPONENTS_VERSION_SCRIPT_LDFLAGS)
|
1999-09-16 17:43:15 +04:00
|
|
|
endif # IS_COMPONENT
|
|
|
|
|
2000-03-11 06:08:04 +03:00
|
|
|
#
|
|
|
|
# MacOS X specific stuff
|
|
|
|
#
|
|
|
|
|
|
|
|
ifeq ($(OS_ARCH),Rhapsody)
|
|
|
|
ifdef IS_COMPONENT
|
|
|
|
EXTRA_DSO_LDOPTS += -bundle
|
|
|
|
else
|
|
|
|
EXTRA_DSO_LDOPTS += -dynamiclib
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1999-11-18 05:49:30 +03:00
|
|
|
#
|
|
|
|
# HP-UXBeOS specific section: for COMPONENTS only, add -Bsymbolic flag
|
|
|
|
# which uses internal symbols first
|
|
|
|
#
|
|
|
|
ifeq ($(OS_ARCH),HP-UX)
|
|
|
|
ifdef IS_COMPONENT
|
|
|
|
ifeq ($(GNU_CC)$(GNU_CXX),)
|
|
|
|
EXTRA_DSO_LDOPTS += -Wl,-Bsymbolic
|
|
|
|
endif # non-gnu compilers
|
|
|
|
endif # IS_COMPONENT
|
|
|
|
endif # HP-UX
|
|
|
|
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(USE_TVFS),1)
|
|
|
|
IFLAGS1 = -rb
|
|
|
|
IFLAGS2 = -rb
|
|
|
|
else
|
|
|
|
IFLAGS1 = -m 444
|
|
|
|
IFLAGS2 = -m 555
|
|
|
|
endif
|
1999-11-18 05:49:30 +03:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
################################################################################
|
|
|
|
|
2000-03-14 07:57:13 +03:00
|
|
|
all:: export install
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-01-21 10:42:44 +03:00
|
|
|
# Do depend as well
|
|
|
|
alldep:: export depend libs install
|
|
|
|
|
|
|
|
# Do everything from scratch
|
2000-03-14 06:00:52 +03:00
|
|
|
everything:: clean alldep
|
1999-01-21 10:42:44 +03:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef ALL_PLATFORMS
|
|
|
|
all_platforms:: $(NFSPWD)
|
|
|
|
@d=`$(NFSPWD)`; \
|
1999-08-25 01:45:06 +04:00
|
|
|
if test ! -d LOGS; then rm -rf LOGS; mkdir LOGS; else true; fi; \
|
1998-03-28 05:44:41 +03:00
|
|
|
for h in $(PLATFORM_HOSTS); do \
|
|
|
|
echo "On $$h: $(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log";\
|
|
|
|
rsh $$h -n "(chdir $$d; \
|
|
|
|
$(MAKE) $(ALL_PLATFORMS) >& LOGS/$$h.log; \
|
|
|
|
echo DONE) &" 2>&1 > LOGS/$$h.pid & \
|
|
|
|
sleep 1; \
|
|
|
|
done
|
|
|
|
|
|
|
|
$(NFSPWD):
|
|
|
|
cd $(@D); $(MAKE) $(@F)
|
|
|
|
endif
|
|
|
|
|
2000-03-09 05:08:23 +03:00
|
|
|
#
|
|
|
|
# JDIRS -- like JSRCS, except you can give a list of directories and it will
|
|
|
|
# compile all the out-of-date java files in those directories.
|
|
|
|
#
|
|
|
|
# NOTE: recursing through these can speed things up, but they also cause
|
|
|
|
# some builds to run out of memory
|
|
|
|
#
|
|
|
|
ifneq ($(JDIRS),)
|
|
|
|
ifeq ($(JAVA_OR_NSJVM),1)
|
|
|
|
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
|
|
|
@for d in $(JDIRS); do \
|
|
|
|
if test -d $$d; then \
|
|
|
|
$(EXIT_ON_ERROR) \
|
|
|
|
files=`echo $$d/*.java`; \
|
|
|
|
list=`$(PERL) $(topsrcdir)/config/outofdate.pl $(PERLARG) \
|
|
|
|
-d $(JAVA_DESTPATH)/$(PACKAGE) $$files`; \
|
|
|
|
if test "$${list}x" != "x"; then \
|
|
|
|
echo Building all java files in $$d; \
|
|
|
|
echo $(JAVAC) $$list; \
|
|
|
|
$(JAVAC) $$list; \
|
|
|
|
else \
|
|
|
|
true; \
|
|
|
|
fi; \
|
|
|
|
set +e; \
|
|
|
|
else \
|
|
|
|
echo "Skipping non-directory $$d..."; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
|
|
|
|
ifneq ($(JDIRS),)
|
|
|
|
ifeq ($(JAVA_OR_NSJVM),1)
|
|
|
|
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
|
|
|
@for d in $(JDIRS); do \
|
|
|
|
if test -d $$d; then \
|
|
|
|
$(EXIT_ON_ERROR) \
|
|
|
|
files=`echo $$d/*.java`; \
|
|
|
|
list=`$(PERL) $(topsrcdir)/config/outofdate.pl $(PERLARG) \
|
|
|
|
-d $(JAVA_DESTPATH)/$(PACKAGE) $$files`; \
|
|
|
|
if test "$${list}x" != "x"; then \
|
|
|
|
echo Building all java files in $$d; \
|
|
|
|
echo $(JAVAC) $$list; \
|
|
|
|
$(JAVAC) $$list; \
|
|
|
|
else \
|
|
|
|
true; \
|
|
|
|
fi; \
|
|
|
|
set +e; \
|
|
|
|
else \
|
|
|
|
echo "Skipping non-directory $$d..."; \
|
|
|
|
fi; \
|
|
|
|
done
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
1999-09-04 02:18:30 +04:00
|
|
|
# Target to only regenerate makefiles
|
|
|
|
makefiles: $(SUBMAKEFILES)
|
|
|
|
ifdef DIRS
|
|
|
|
@for d in $(filter-out $(STATIC_MAKEFILES), $(DIRS)); do\
|
2000-04-21 05:14:45 +04:00
|
|
|
$(UPDATE_TITLE) \
|
2000-03-02 15:41:47 +03:00
|
|
|
$(MAKE) -C $$d $@ \
|
1999-09-04 02:18:30 +04:00
|
|
|
done
|
|
|
|
endif
|
|
|
|
|
1999-08-25 01:45:06 +04:00
|
|
|
export:: $(SUBMAKEFILES) $(MAKE_DIRS)
|
1998-03-28 05:44:41 +03:00
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
2000-03-31 05:24:48 +04:00
|
|
|
##############################################
|
2000-06-23 02:11:45 +04:00
|
|
|
install:: $(SUBMAKEFILES) $(MAKE_DIRS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) $(HOST_PROGRAM) $(PROGRAM) $(HOST_SIMPLE_PROGRAMS) $(SIMPLE_PROGRAMS) $(MAPS)
|
1998-07-08 07:49:31 +04:00
|
|
|
ifndef NO_STATIC_LIB
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef LIBRARY
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
2000-06-21 04:54:56 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $(LIBRARY) $(DIST)/lib
|
2000-03-31 05:24:48 +04:00
|
|
|
else
|
1999-05-27 08:25:42 +04:00
|
|
|
ifdef IS_COMPONENT
|
2000-06-21 04:54:56 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $(LIBRARY) $(DIST)/lib/components
|
1999-05-27 08:25:42 +04:00
|
|
|
else
|
2000-06-21 04:54:56 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $(LIBRARY) $(DIST)/lib
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
2000-03-31 05:24:48 +04:00
|
|
|
endif # OS2
|
1998-07-08 07:49:31 +04:00
|
|
|
endif
|
1999-05-27 08:25:42 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef MAPS
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $(MAPS) $(DIST)/bin
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
ifdef SHARED_LIBRARY
|
1999-03-03 04:25:21 +03:00
|
|
|
ifdef IS_COMPONENT
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
2000-07-19 17:58:45 +04:00
|
|
|
$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib/components
|
2000-03-31 05:24:48 +04:00
|
|
|
else
|
2000-06-21 04:54:56 +04:00
|
|
|
$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib/components
|
2000-06-28 08:32:15 +04:00
|
|
|
$(ELF_DYNSTR_GC) $(DIST)/lib/components/$(SHARED_LIBRARY)
|
2000-06-21 04:54:56 +04:00
|
|
|
endif
|
|
|
|
$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/bin/components
|
2000-06-29 02:29:38 +04:00
|
|
|
$(ELF_DYNSTR_GC) $(DIST)/bin/components/$(SHARED_LIBRARY)
|
1999-07-22 07:33:24 +04:00
|
|
|
ifeq ($(OS_ARCH),OpenVMS)
|
2000-06-13 04:40:16 +04:00
|
|
|
$(INSTALL) -m 555 $(SHARED_LIBRARY:$(DLL_SUFFIX)=.vms) $(DIST)/lib/components
|
2000-04-02 11:46:23 +04:00
|
|
|
$(INSTALL) -m 555 $(SHARED_LIBRARY:$(DLL_SUFFIX)=.vms) $(DIST)/bin/components
|
1999-07-22 07:33:24 +04:00
|
|
|
endif
|
2000-09-17 22:40:42 +04:00
|
|
|
ifdef BEOS_ADDON_WORKAROUND
|
|
|
|
( cd $(DIST)/bin/components && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) )
|
|
|
|
endif
|
2000-03-31 05:24:48 +04:00
|
|
|
else # ! IS_COMPONENT
|
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
$(INSTALL) $(IFLAGS2) $(IMPORT_LIBRARY) $(DIST)/lib
|
1999-03-03 04:25:21 +03:00
|
|
|
else
|
2000-06-21 04:54:56 +04:00
|
|
|
$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/lib
|
|
|
|
endif
|
|
|
|
$(INSTALL) $(IFLAGS2) $(SHARED_LIBRARY) $(DIST)/bin
|
1999-07-22 07:33:24 +04:00
|
|
|
ifeq ($(OS_ARCH),OpenVMS)
|
2000-06-13 04:40:16 +04:00
|
|
|
$(INSTALL) -m 555 $(SHARED_LIBRARY:$(DLL_SUFFIX)=.vms) $(DIST)/lib
|
2000-04-02 11:46:23 +04:00
|
|
|
$(INSTALL) -m 555 $(SHARED_LIBRARY:$(DLL_SUFFIX)=.vms) $(DIST)/bin
|
1999-07-22 07:33:24 +04:00
|
|
|
endif
|
2000-09-17 09:32:36 +04:00
|
|
|
ifdef BEOS_ADDON_WORKAROUND
|
2000-09-17 22:40:42 +04:00
|
|
|
( cd $(DIST)/bin && $(CC) -nostart -o $(SHARED_LIBRARY).stub $(SHARED_LIBRARY) )
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
2000-09-17 22:40:42 +04:00
|
|
|
endif # IS_COMPONENT
|
2000-09-17 09:32:36 +04:00
|
|
|
endif # SHARED_LIBRARY
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef PROGRAM
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS2) $(PROGRAM) $(DIST)/bin
|
1999-01-23 14:41:15 +03:00
|
|
|
endif
|
|
|
|
ifdef SIMPLE_PROGRAMS
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS2) $(SIMPLE_PROGRAMS) $(DIST)/bin
|
2000-03-31 11:18:52 +04:00
|
|
|
endif
|
|
|
|
ifdef HOST_PROGRAM
|
|
|
|
$(INSTALL) $(IFLAGS2) $(HOST_PROGRAM) $(DIST)/host/bin
|
|
|
|
endif
|
|
|
|
ifdef HOST_SIMPLE_PROGRAMS
|
|
|
|
$(INSTALL) $(IFLAGS2) $(HOST_SIMPLE_PROGRAMS) $(DIST)/host/bin
|
|
|
|
endif
|
|
|
|
ifdef HOST_LIBRARY
|
|
|
|
$(INSTALL) $(IFLAGS1) $(HOST_LIBRARY) $(DIST)/host/lib
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
1999-02-17 20:33:07 +03:00
|
|
|
checkout:
|
2000-03-31 05:24:48 +04:00
|
|
|
$(MAKE) -C $(topsrcdir) -f client.mk checkout
|
1999-02-17 20:33:07 +03:00
|
|
|
|
1999-02-18 21:44:48 +03:00
|
|
|
run_viewer: $(DIST)/bin/viewer
|
|
|
|
cd $(DIST)/bin; \
|
1999-03-31 23:07:29 +04:00
|
|
|
MOZILLA_FIVE_HOME=`pwd` \
|
1999-02-18 21:44:48 +03:00
|
|
|
LD_LIBRARY_PATH=".:$(LIBS_PATH):$$LD_LIBRARY_PATH" \
|
|
|
|
viewer
|
|
|
|
|
2000-03-14 06:00:52 +03:00
|
|
|
clean clobber realclean clobber_all:: $(SUBMAKEFILES)
|
2000-08-30 05:15:32 +04:00
|
|
|
rm -f $(ALL_TRASH); \
|
|
|
|
rm -rf $(ALL_TRASH_DIRS)
|
1998-03-28 05:44:41 +03:00
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
1999-08-25 01:45:06 +04:00
|
|
|
distclean:: $(SUBMAKEFILES)
|
2000-03-14 09:16:27 +03:00
|
|
|
+$(LOOP_OVER_DIRS)
|
2000-08-30 05:15:32 +04:00
|
|
|
rm -f $(ALL_TRASH) ; \
|
|
|
|
rm -rf $(ALL_TRASH_DIRS) \
|
2000-03-14 06:00:52 +03:00
|
|
|
$(wildcard *.map) \
|
2000-06-12 04:49:01 +04:00
|
|
|
Makefile .HSancillary $(DIST_GARBAGE) \
|
2000-07-02 22:44:42 +04:00
|
|
|
$(wildcard *.$(OBJ_SUFFIX)) $(wildcard *.ho) \
|
|
|
|
$(wildcard *.$(LIB_SUFFIX)) $(wildcard *$(DLL_SUFFIX))
|
1999-06-04 02:23:06 +04:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
alltags:
|
|
|
|
rm -f TAGS
|
1999-06-12 00:21:48 +04:00
|
|
|
find $(topsrcdir) -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' -o -name '*.idl' \) -print | $(TAG_PROGRAM)
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-01-23 14:41:15 +03:00
|
|
|
#
|
|
|
|
# PROGRAM = Foo
|
|
|
|
# creates OBJS, links with LIBS to create Foo
|
|
|
|
#
|
1999-08-17 17:08:51 +04:00
|
|
|
$(PROGRAM): $(PROGOBJS) $(EXTRA_DEPS) Makefile Makefile.in
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
2000-06-01 18:17:35 +04:00
|
|
|
$(LD) -OUT:$@ $(LDFLAGS) $(OS_LFLAGS) $(PROGOBJS) $(LIBS) $(EXTRA_LIBS) -MAP:$(@:.exe=.map) $(OS_LIBS) /ST:0x1000000
|
2000-09-15 23:14:14 +04:00
|
|
|
ifdef OS2_PROGRAM_RESOURCE
|
|
|
|
rc -n -x2 -r $(OS2_PROGRAM_RESOURCE)
|
|
|
|
rc -n -x2 $(patsubst %.rc,%.res,$(OS2_PROGRAM_RESOURCE)) $@
|
|
|
|
endif # os2_prog_rsrc
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
1999-02-17 03:32:17 +03:00
|
|
|
ifeq ($(CPP_PROG_LINK),1)
|
2000-10-20 18:59:13 +04:00
|
|
|
$(CCC) -o $@ $(CXXFLAGS) $(WRAP_MALLOC_CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS)
|
1999-09-17 04:53:36 +04:00
|
|
|
$(MOZ_POST_PROGRAM_COMMAND) $@
|
1999-06-26 12:16:01 +04:00
|
|
|
ifeq ($(OS_ARCH),BeOS)
|
|
|
|
ifdef BEOS_PROGRAM_RESOURCE
|
|
|
|
xres -o $@ $(BEOS_PROGRAM_RESOURCE)
|
|
|
|
mimeset $@
|
|
|
|
endif
|
2000-03-31 14:49:39 +04:00
|
|
|
endif # BeOS
|
|
|
|
else # ! CPP_PROG_LINK
|
2000-03-31 05:24:48 +04:00
|
|
|
$(CC) -o $@ $(CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(BIN_FLAGS)
|
1999-06-26 12:16:01 +04:00
|
|
|
ifeq ($(OS_ARCH),BeOS)
|
|
|
|
ifdef BEOS_PROGRAM_RESOURCE
|
|
|
|
xres -o $@ $(BEOS_PROGRAM_RESOURCE)
|
|
|
|
mimeset $@
|
|
|
|
endif
|
2000-03-31 14:49:39 +04:00
|
|
|
endif # BeOS
|
|
|
|
endif # CPP_PROG_LINK
|
|
|
|
endif # OS2
|
1999-01-23 12:36:40 +03:00
|
|
|
|
2000-03-31 11:18:52 +04:00
|
|
|
$(HOST_PROGRAM): $(HOST_PROGOBJS) $(HOST_EXTRA_DEPS) Makefile Makefile.in
|
|
|
|
$(HOST_CC) -o $@ $(HOST_CFLAGS) $(HOST_PROGOBJS) $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
|
|
|
|
1999-01-23 14:41:15 +03:00
|
|
|
#
|
|
|
|
# This is an attempt to support generation of multiple binaries
|
|
|
|
# in one directory, it assumes everything to compile Foo is in
|
|
|
|
# Foo.o (from either Foo.c or Foo.cpp).
|
|
|
|
#
|
|
|
|
# SIMPLE_PROGRAMS = Foo Bar
|
|
|
|
# creates Foo.o Bar.o, links with LIBS to create Foo, Bar.
|
|
|
|
#
|
2000-03-31 05:24:48 +04:00
|
|
|
$(SIMPLE_PROGRAMS): %$(BIN_SUFFIX): %.o $(EXTRA_DEPS) Makefile Makefile.in
|
1999-02-17 03:32:17 +03:00
|
|
|
ifeq ($(CPP_PROG_LINK),1)
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
2000-10-20 18:59:13 +04:00
|
|
|
$(LD) /Out:$@ $< $(LDFLAGS) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(OS_LFLAGS) $(PROFILER_LIBS)
|
2000-03-31 05:24:48 +04:00
|
|
|
else
|
2000-10-20 18:59:13 +04:00
|
|
|
$(CCC) $(WRAP_MALLOC_CFLAGS) $(CXXFLAGS) -o $@ $< $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS)
|
2000-03-31 05:24:48 +04:00
|
|
|
endif
|
1999-06-10 20:27:39 +04:00
|
|
|
$(MOZ_POST_PROGRAM_COMMAND) $@
|
2000-03-31 05:24:48 +04:00
|
|
|
else
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
2000-10-20 18:59:13 +04:00
|
|
|
$(LD) /Out:$@ $< $(LDFLAGS) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS) $(OS_LFLAGS)
|
1999-01-23 15:20:00 +03:00
|
|
|
else
|
2000-10-20 18:59:13 +04:00
|
|
|
$(CC) $(WRAP_MALLOC_CFLAGS) $(CFLAGS) -o $@ $< $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS) $(WRAP_MALLOC_LIB) $(PROFILER_LIBS)
|
2000-03-31 05:24:48 +04:00
|
|
|
endif
|
1999-06-10 20:27:39 +04:00
|
|
|
$(MOZ_POST_PROGRAM_COMMAND) $@
|
1999-01-23 15:20:00 +03:00
|
|
|
endif
|
1999-01-23 14:41:15 +03:00
|
|
|
|
2000-03-31 11:18:52 +04:00
|
|
|
$(HOST_SIMPLE_PROGRAMS): host_%$(BIN_SUFFIX): %.ho $(HOST_EXTRA_DEPS) Makefile Makefile.in
|
2000-04-02 20:15:42 +04:00
|
|
|
$(HOST_CC) -o $@ $(HOST_CFLAGS) $< $(HOST_LIBS) $(HOST_EXTRA_LIBS)
|
2000-03-31 11:18:52 +04:00
|
|
|
|
1999-01-27 10:17:32 +03:00
|
|
|
#
|
|
|
|
# Purify target. Solaris/sparc only to start.
|
|
|
|
# Purify does not recognize "egcs" or "c++" so we go with
|
|
|
|
# "gcc" and "g++" for now.
|
|
|
|
#
|
|
|
|
pure: $(PROGRAM)
|
1999-02-17 03:32:17 +03:00
|
|
|
ifeq ($(CPP_PROG_LINK),1)
|
1999-12-22 06:40:16 +03:00
|
|
|
$(PURIFY) $(CCC) -o $^.pure $(CXXFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS)
|
1999-01-27 10:17:32 +03:00
|
|
|
else
|
1999-12-22 06:40:16 +03:00
|
|
|
$(PURIFY) $(CC) -o $^.pure $(CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS)
|
1999-01-27 10:17:32 +03:00
|
|
|
endif
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS2) $^.pure $(DIST)/bin
|
1999-01-23 14:41:15 +03:00
|
|
|
|
1999-03-10 11:32:42 +03:00
|
|
|
quantify: $(PROGRAM)
|
|
|
|
ifeq ($(CPP_PROG_LINK),1)
|
1999-12-22 06:40:16 +03:00
|
|
|
$(QUANTIFY) $(CCC) -o $^.quantify $(CXXFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS)
|
1999-03-10 11:32:42 +03:00
|
|
|
else
|
1999-12-22 06:40:16 +03:00
|
|
|
$(QUANTIFY) $(CC) -o $^.quantify $(CFLAGS) $(PROGOBJS) $(LDFLAGS) $(LIBS_DIR) $(LIBS) $(OS_LIBS) $(EXTRA_LIBS)
|
1999-03-10 11:32:42 +03:00
|
|
|
endif
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS2) $^.quantify $(DIST)/bin
|
1999-03-10 11:32:42 +03:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifneq ($(OS_ARCH),OS2)
|
1999-03-26 00:01:59 +03:00
|
|
|
#
|
|
|
|
# This allows us to create static versions of the shared libraries
|
|
|
|
# that are built using other static libraries. Confused...?
|
|
|
|
#
|
|
|
|
ifdef SHARED_LIBRARY_LIBS
|
2000-03-11 06:08:04 +03:00
|
|
|
ifneq (,$(filter OSF1 BSD_OS FreeBSD NetBSD OpenBSD SunOS Rhapsody,$(OS_ARCH)))
|
1999-05-20 07:27:20 +04:00
|
|
|
CLEANUP1 := | egrep -v '(________64ELEL_|__.SYMDEF)'
|
|
|
|
CLEANUP2 := rm -f ________64ELEL_ __.SYMDEF
|
1999-04-07 03:26:00 +04:00
|
|
|
else
|
|
|
|
CLEANUP2 := true
|
|
|
|
endif
|
|
|
|
SUB_LOBJS = $(shell for lib in $(SHARED_LIBRARY_LIBS); do $(AR_LIST) $${lib} $(CLEANUP1); done;)
|
1999-03-26 00:01:59 +03:00
|
|
|
endif
|
|
|
|
|
2000-04-23 21:48:04 +04:00
|
|
|
$(LIBRARY): $(OBJS) $(LOBJS) $(SHARED_LIBRARY_LIBS) Makefile Makefile.in
|
1998-03-28 05:44:41 +03:00
|
|
|
rm -f $@
|
1999-03-26 00:01:59 +03:00
|
|
|
ifdef SHARED_LIBRARY_LIBS
|
|
|
|
@rm -f $(SUB_LOBJS)
|
1999-04-07 03:26:00 +04:00
|
|
|
@for lib in $(SHARED_LIBRARY_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done
|
1999-03-26 00:01:59 +03:00
|
|
|
endif
|
1999-08-29 22:10:23 +04:00
|
|
|
$(AR) $(AR_FLAGS) $(OBJS) $(LOBJS) $(SUB_LOBJS)
|
1998-03-28 05:44:41 +03:00
|
|
|
$(RANLIB) $@
|
1999-03-26 00:01:59 +03:00
|
|
|
@rm -f foodummyfilefoo $(SUB_LOBJS)
|
1999-10-08 09:18:46 +04:00
|
|
|
|
1999-10-12 16:36:07 +04:00
|
|
|
else # OS2
|
2000-03-31 05:24:48 +04:00
|
|
|
ifdef SHARED_LIBRARY
|
|
|
|
$(DEF_FILE): $(DEF_OBJS)
|
1998-03-28 05:44:41 +03:00
|
|
|
rm -f $@
|
2000-03-31 05:24:48 +04:00
|
|
|
@cmd /C "echo LIBRARY $(LIBRARY_NAME) INITINSTANCE TERMINSTANCE >$(DEF_FILE)"
|
|
|
|
@cmd /C "echo PROTMODE >>$(DEF_FILE)"
|
|
|
|
@cmd /C "echo CODE LOADONCALL MOVEABLE DISCARDABLE >>$(DEF_FILE)"
|
|
|
|
@cmd /C "echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >>$(DEF_FILE)"
|
|
|
|
@cmd /C "echo EXPORTS >>$(DEF_FILE)"
|
|
|
|
ifeq ($(XPCOM_SWITCH),1)
|
|
|
|
$(FILTER) $(DEF_OBJS) >> $(DEF_FILE)
|
|
|
|
else
|
2000-05-16 08:41:54 +04:00
|
|
|
$(FILTER) $(DEF_OBJS) | grep -v getter_Copies__FR| grep -v getc | grep -v putc | grep -v __ctime >> $(DEF_FILE)
|
2000-03-31 05:24:48 +04:00
|
|
|
endif
|
|
|
|
$(ADD_TO_DEF_FILE)
|
|
|
|
$(IMPORT_LIBRARY): $(OBJS) $(DEF_FILE)
|
|
|
|
rm -f $@
|
|
|
|
$(MAKE_DEF_FILE)
|
1998-03-28 05:44:41 +03:00
|
|
|
$(IMPLIB) $@ $(DEF_FILE)
|
|
|
|
$(RANLIB) $@
|
|
|
|
else
|
1999-03-27 03:18:41 +03:00
|
|
|
$(LIBRARY): $(OBJS)
|
1998-03-28 05:44:41 +03:00
|
|
|
rm -f $@
|
2000-03-31 05:24:48 +04:00
|
|
|
$(AR) $(AR_FLAGS) $(LIBOBJS)
|
1998-03-28 05:44:41 +03:00
|
|
|
$(RANLIB) $@
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
2000-03-31 11:18:52 +04:00
|
|
|
$(HOST_LIBRARY): $(HOST_OBJS) Makefile
|
|
|
|
rm -f $@
|
|
|
|
$(HOST_AR) $(HOST_AR_FLAGS) $@ $(HOST_OBJS)
|
|
|
|
$(HOST_RANLIB) $@
|
|
|
|
|
2000-04-23 21:48:04 +04:00
|
|
|
ifdef NO_LD_ARCHIVE_FLAGS
|
|
|
|
SUB_SHLOBJS = $(SUB_LOBJS)
|
|
|
|
endif
|
|
|
|
|
|
|
|
$(SHARED_LIBRARY): $(OBJS) $(LOBJS) $(DEF_FILE) $(SHARED_LIBRARY_LIBS) Makefile Makefile.in
|
1998-03-28 05:44:41 +03:00
|
|
|
rm -f $@
|
2000-05-16 08:41:54 +04:00
|
|
|
ifneq ($(OS_ARCH),OS2)
|
1999-08-03 06:08:12 +04:00
|
|
|
ifneq ($(OS_ARCH),OpenVMS)
|
2000-04-23 21:48:04 +04:00
|
|
|
ifdef NO_LD_ARCHIVE_FLAGS
|
1999-08-03 06:08:12 +04:00
|
|
|
ifdef SHARED_LIBRARY_LIBS
|
2000-04-23 21:48:04 +04:00
|
|
|
@rm -f $(SUB_SHLOBJS)
|
1999-08-03 06:08:12 +04:00
|
|
|
@for lib in $(SHARED_LIBRARY_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done
|
2000-04-23 21:48:04 +04:00
|
|
|
endif # SHARED_LIBRARY_LIBS
|
|
|
|
endif # NO_LD_ARCHIVE_FLAGS
|
2000-07-08 15:39:05 +04:00
|
|
|
$(MKSHLIB) $(SHLIB_LDSTARTFILE) $(OBJS) $(LOBJS) $(SUB_SHLOBJS) $(LDFLAGS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE) $(SHLIB_LDENDFILE)
|
2000-04-23 21:48:04 +04:00
|
|
|
@rm -f foodummyfilefoo $(SUB_SHLOBJS)
|
1999-07-22 07:33:24 +04:00
|
|
|
else
|
|
|
|
@touch no-such-file.vms; rm -f no-such-file.vms $(SUB_LOBJS)
|
1999-09-13 16:21:26 +04:00
|
|
|
ifndef IS_COMPONENT
|
1999-08-20 10:52:59 +04:00
|
|
|
@if test ! -f VMSuni.opt; then \
|
|
|
|
echo "Creating universal symbol option file VMSuni.opt"; \
|
1999-07-22 07:33:24 +04:00
|
|
|
for lib in $(SHARED_LIBRARY_LIBS); do $(AR_EXTRACT) $${lib}; $(CLEANUP2); done; \
|
|
|
|
create_opt_uni $(OBJS) $(SUB_LOBJS); \
|
|
|
|
fi
|
|
|
|
@touch no-such-file.vms; rm -f no-such-file.vms $(SUB_LOBJS)
|
1999-09-13 16:21:26 +04:00
|
|
|
endif
|
1999-08-20 10:52:59 +04:00
|
|
|
$(MKSHLIB) -o $@ $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS) VMSuni.opt;
|
2000-04-02 11:46:23 +04:00
|
|
|
@echo "`translate $@`" > $(@:$(DLL_SUFFIX)=.vms)
|
1999-07-07 13:02:21 +04:00
|
|
|
endif
|
2000-05-16 08:41:54 +04:00
|
|
|
else # OS2
|
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
$(MKSHLIB) /FREE /DE /NOE /NOL /NOBR /DLL /O:$@ /INC:_dllentry /M $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
|
|
|
|
else
|
|
|
|
$(MKSHLIB) -o $@ $(OBJS) $(LOBJS) $(EXTRA_DSO_LDOPTS) $(OS_LIBS) $(EXTRA_LIBS) $(DEF_FILE)
|
|
|
|
endif
|
|
|
|
endif # OS2
|
1998-03-28 05:44:41 +03:00
|
|
|
chmod +x $@
|
1999-06-10 19:18:02 +04:00
|
|
|
$(MOZ_POST_DSO_LIB_COMMAND) $@
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2000-03-31 14:49:39 +04:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
1999-03-27 03:18:41 +03:00
|
|
|
$(DLL): $(OBJS) $(EXTRA_LIBS)
|
1998-03-28 05:44:41 +03:00
|
|
|
rm -f $@
|
2000-03-31 05:24:48 +04:00
|
|
|
$(MKSHLIB) -o $@ $(OBJS) $(EXTRA_LIBS) $(OS_LIBS)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1999-08-20 10:52:59 +04:00
|
|
|
%: %.c
|
2000-02-25 06:55:50 +03:00
|
|
|
$(REPORT_BUILD)
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS), VACPP)
|
2000-03-31 14:38:58 +04:00
|
|
|
$(ELOG) $(CC) -Fo$@ -c $(CFLAGS) $<
|
|
|
|
else
|
2000-02-26 07:21:53 +03:00
|
|
|
$(ELOG) $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $<
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1999-09-12 19:15:52 +04:00
|
|
|
%.o: %.c Makefile.in
|
2000-02-25 06:55:50 +03:00
|
|
|
$(REPORT_BUILD)
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS),VACPP)
|
|
|
|
$(ELOG) $(CC) -Fo$@ -c $(COMPILE_CFLAGS) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2000-02-26 07:21:53 +03:00
|
|
|
$(ELOG) $(CC) -o $@ -c $(COMPILE_CFLAGS) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
2000-03-31 11:18:52 +04:00
|
|
|
%.ho: %.c Makefile.in
|
|
|
|
$(REPORT_BUILD)
|
|
|
|
$(ELOG) $(HOST_CC) -o $@ -c $(HOST_CFLAGS) -I$(DIST)/include $(NSPR_CFLAGS) $<
|
|
|
|
|
1999-08-20 10:52:59 +04:00
|
|
|
moc_%.cpp: %.h
|
1999-08-09 18:55:56 +04:00
|
|
|
$(MOC) $< -o $@
|
|
|
|
|
1999-03-08 18:01:13 +03:00
|
|
|
# The AS_DASH_C_FLAG is needed cause not all assemblers (Solaris) accept
|
|
|
|
# a '-c' flag.
|
1999-08-20 10:52:59 +04:00
|
|
|
%.o: %.s
|
1999-03-08 18:01:13 +03:00
|
|
|
$(AS) -o $@ $(ASFLAGS) $(AS_DASH_C_FLAG) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-08-20 10:52:59 +04:00
|
|
|
%.o: %.S
|
1998-08-20 00:42:14 +04:00
|
|
|
$(AS) -o $@ $(ASFLAGS) -c $<
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-08-20 10:52:59 +04:00
|
|
|
%: %.cpp
|
1999-03-07 08:18:45 +03:00
|
|
|
$(CCC) -o $@ $(CXXFLAGS) $< $(LDFLAGS)
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Please keep the next two rules in sync.
|
|
|
|
#
|
1999-08-20 10:52:59 +04:00
|
|
|
%.o: %.cc
|
2000-02-25 06:55:50 +03:00
|
|
|
$(REPORT_BUILD)
|
2000-02-26 07:21:53 +03:00
|
|
|
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-08-20 10:52:59 +04:00
|
|
|
%.o: %.cpp
|
2000-02-25 06:55:50 +03:00
|
|
|
$(REPORT_BUILD)
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef STRICT_CPLUSPLUS_SUFFIX
|
1999-08-20 10:52:59 +04:00
|
|
|
echo "#line 1 \"$*.cpp\"" | cat - $*.cpp > t_$*.cc
|
2000-02-26 07:21:53 +03:00
|
|
|
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) t_$*.cc
|
1999-08-20 10:52:59 +04:00
|
|
|
rm -f t_$*.cc
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2000-03-31 05:24:48 +04:00
|
|
|
ifeq ($(MOZ_OS2_TOOLS), VACPP)
|
|
|
|
$(ELOG) $(CCC) -Fo$@ -c $(COMPILE_CXXFLAGS) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
2000-02-26 07:21:53 +03:00
|
|
|
$(ELOG) $(CCC) -o $@ -c $(COMPILE_CXXFLAGS) $<
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
endif #STRICT_CPLUSPLUS_SUFFIX
|
|
|
|
|
|
|
|
%.i: %.cpp
|
1999-12-22 06:40:16 +03:00
|
|
|
$(CCC) -C -E $(COMPILE_CXXFLAGS) $< > $*.i
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
%.i: %.c
|
1999-12-22 06:40:16 +03:00
|
|
|
$(CC) -C -E $(COMPILE_CFLAGS) $< > $*.i
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2000-05-16 08:41:54 +04:00
|
|
|
# need 3 separate lines for OS/2
|
1998-03-28 05:44:41 +03:00
|
|
|
%: %.pl
|
2000-05-16 08:41:54 +04:00
|
|
|
rm -f $@
|
|
|
|
cp $< $@
|
|
|
|
chmod +x $@
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
%: %.sh
|
1998-08-20 00:42:14 +04:00
|
|
|
rm -f $@; cp $< $@; chmod +x $@
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-03-22 23:43:05 +03:00
|
|
|
# Cancel these implicit rules
|
|
|
|
#
|
|
|
|
%: %,v
|
|
|
|
|
|
|
|
%: RCS/%,v
|
|
|
|
|
|
|
|
%: s.%
|
|
|
|
|
|
|
|
%: SCCS/s.%
|
|
|
|
|
1999-01-29 23:00:50 +03:00
|
|
|
###############################################################################
|
|
|
|
# Update Makefiles
|
|
|
|
###############################################################################
|
1999-08-26 02:09:50 +04:00
|
|
|
# Note: Passing depth to make-makefile is optional.
|
|
|
|
# It saves the script some work, though.
|
2000-04-03 04:56:31 +04:00
|
|
|
Makefile: Makefile.in $(topsrcdir)/configure
|
2000-03-14 06:00:52 +03:00
|
|
|
@$(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH)
|
1999-08-25 01:45:06 +04:00
|
|
|
|
1999-09-15 03:09:37 +04:00
|
|
|
ifdef SUBMAKEFILES
|
1999-09-04 02:18:30 +04:00
|
|
|
# VPATH does not work on some machines in this case, so add $(srcdir)
|
|
|
|
$(SUBMAKEFILES): % : $(srcdir)/%.in
|
2000-03-14 06:00:52 +03:00
|
|
|
@$(PERL) $(AUTOCONF_TOOLS)/make-makefile -t $(topsrcdir) -d $(DEPTH) $@
|
1999-09-15 03:09:37 +04:00
|
|
|
endif
|
1999-01-29 23:00:50 +03:00
|
|
|
|
2000-04-03 04:56:31 +04:00
|
|
|
ifdef AUTOUPDATE_CONFIGURE
|
|
|
|
$(topsrcdir)/configure: $(topsrcdir)/configure.in
|
|
|
|
(cd $(topsrcdir) && $(AUTOCONF)) && (cd $(DEPTH) && ./config.status --recheck)
|
|
|
|
endif
|
|
|
|
|
1999-01-29 23:00:50 +03:00
|
|
|
###############################################################################
|
1998-03-28 05:44:41 +03:00
|
|
|
# Bunch of things that extend the 'export' rule (in order):
|
1999-01-29 23:00:50 +03:00
|
|
|
###############################################################################
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
$(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) $(JMCSRCDIR)::
|
|
|
|
@if test ! -d $@; then \
|
|
|
|
echo Creating $@; \
|
|
|
|
rm -rf $@; \
|
|
|
|
$(NSINSTALL) -D $@; \
|
1998-10-23 08:41:26 +04:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
### JSRCS -- for compiling java files
|
|
|
|
|
|
|
|
ifneq ($(JSRCS),)
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE)
|
1998-08-20 00:42:14 +04:00
|
|
|
list=`$(PERL) $(topsrcdir)/config/outofdate.pl $(PERLARG) \
|
1998-03-28 05:44:41 +03:00
|
|
|
-d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS)`; \
|
|
|
|
if test "$$list"x != "x"; then \
|
|
|
|
echo $(JAVAC) $$list; \
|
|
|
|
$(JAVAC) $$list; \
|
1999-03-31 02:21:54 +04:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
|
|
|
|
|
|
|
all:: export
|
|
|
|
|
1999-07-20 06:10:47 +04:00
|
|
|
clean clobber::
|
2000-01-11 08:13:01 +03:00
|
|
|
rm -f $(DIST)/classes/$(PACKAGE)/*.class
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# JDK_GEN -- for generating "old style" native methods
|
|
|
|
#
|
|
|
|
# Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory
|
|
|
|
#
|
|
|
|
ifneq ($(JDK_GEN),)
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
INCLUDES += -I$(JDK_GEN_DIR)
|
|
|
|
JDK_PACKAGE_CLASSES = $(JDK_GEN)
|
|
|
|
JDK_PATH_CLASSES = $(subst .,/,$(JDK_PACKAGE_CLASSES))
|
|
|
|
JDK_HEADER_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES))
|
|
|
|
JDK_STUB_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES))
|
|
|
|
JDK_HEADER_CFILES = $(patsubst %,$(JDK_GEN_DIR)/%.h,$(JDK_GEN))
|
|
|
|
JDK_STUB_CFILES = $(patsubst %,$(JDK_STUB_DIR)/%.c,$(JDK_GEN))
|
|
|
|
|
|
|
|
$(JDK_HEADER_CFILES): $(JDK_HEADER_CLASSFILES)
|
|
|
|
$(JDK_STUB_CFILES): $(JDK_STUB_CLASSFILES)
|
|
|
|
|
|
|
|
export::
|
|
|
|
@echo Generating/Updating JDK headers
|
|
|
|
$(JAVAH) -d $(JDK_GEN_DIR) $(JDK_PACKAGE_CLASSES)
|
|
|
|
@echo Generating/Updating JDK stubs
|
|
|
|
$(JAVAH) -stubs -d $(JDK_STUB_DIR) $(JDK_PACKAGE_CLASSES)
|
|
|
|
ifdef MOZ_GENMAC
|
|
|
|
@if test ! -d $(DEPTH)/lib/mac/Java/; then \
|
|
|
|
echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \
|
|
|
|
echo "!!! This allows us to automatically update generated files for the mac."; \
|
|
|
|
echo "!!! If you see any modified files there, please check them in."; \
|
1999-03-31 02:21:54 +04:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
|
|
|
@echo Generating/Updating JDK headers for the Mac
|
|
|
|
$(JAVAH) -mac -d $(DEPTH)/lib/mac/Java/_gen $(JDK_PACKAGE_CLASSES)
|
|
|
|
@echo Generating/Updating JDK stubs for the Mac
|
|
|
|
$(JAVAH) -mac -stubs -d $(DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES)
|
|
|
|
endif
|
1998-08-01 00:19:50 +04:00
|
|
|
endif # JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# JRI_GEN -- for generating JRI native methods
|
|
|
|
#
|
|
|
|
# Generate JRI Headers and Stubs into the 'jri' directory
|
|
|
|
#
|
|
|
|
ifneq ($(JRI_GEN),)
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
INCLUDES += -I$(JRI_GEN_DIR)
|
|
|
|
JRI_PACKAGE_CLASSES = $(JRI_GEN)
|
|
|
|
JRI_PATH_CLASSES = $(subst .,/,$(JRI_PACKAGE_CLASSES))
|
|
|
|
JRI_HEADER_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES))
|
|
|
|
JRI_STUB_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES))
|
|
|
|
JRI_HEADER_CFILES = $(patsubst %,$(JRI_GEN_DIR)/%.h,$(JRI_GEN))
|
|
|
|
JRI_STUB_CFILES = $(patsubst %,$(JRI_GEN_DIR)/%.c,$(JRI_GEN))
|
|
|
|
|
|
|
|
$(JRI_HEADER_CFILES): $(JRI_HEADER_CLASSFILES)
|
|
|
|
$(JRI_STUB_CFILES): $(JRI_STUB_CLASSFILES)
|
|
|
|
|
|
|
|
export::
|
|
|
|
@echo Generating/Updating JRI headers
|
|
|
|
$(JAVAH) -jri -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES)
|
|
|
|
@echo Generating/Updating JRI stubs
|
|
|
|
$(JAVAH) -jri -stubs -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES)
|
|
|
|
ifdef MOZ_GENMAC
|
|
|
|
@if test ! -d $(DEPTH)/lib/mac/Java/; then \
|
|
|
|
echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \
|
|
|
|
echo "!!! This allows us to automatically update generated files for the mac."; \
|
|
|
|
echo "!!! If you see any modified files there, please check them in."; \
|
1999-03-31 02:21:54 +04:00
|
|
|
else \
|
|
|
|
true; \
|
1998-03-28 05:44:41 +03:00
|
|
|
fi
|
|
|
|
@echo Generating/Updating JRI headers for the Mac
|
|
|
|
$(JAVAH) -jri -mac -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES)
|
|
|
|
@echo Generating/Updating JRI stubs for the Mac
|
|
|
|
$(JAVAH) -jri -mac -stubs -d $(DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES)
|
|
|
|
endif
|
1998-08-01 00:19:50 +04:00
|
|
|
endif # JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1998-08-01 00:19:50 +04:00
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# JNI_GEN -- for generating JNI native methods
|
|
|
|
#
|
|
|
|
# Generate JNI Headers and Stubs into the 'jni' directory
|
|
|
|
#
|
|
|
|
ifneq ($(JNI_GEN),)
|
|
|
|
ifdef JAVA_OR_NSJVM
|
|
|
|
INCLUDES += -I$(JNI_GEN_DIR)
|
|
|
|
JNI_PACKAGE_CLASSES = $(JNI_GEN)
|
|
|
|
JNI_PATH_CLASSES = $(subst .,/,$(JNI_PACKAGE_CLASSES))
|
|
|
|
JNI_HEADER_CLASSFILES = $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JNI_PATH_CLASSES))
|
|
|
|
JNI_HEADER_CFILES = $(patsubst %,$(JNI_GEN_DIR)/%.h,$(JNI_GEN))
|
|
|
|
JNI_STUB_CFILES = $(patsubst %,$(JNI_GEN_DIR)/%.c,$(JNI_GEN))
|
|
|
|
|
|
|
|
$(JNI_HEADER_CFILES): $(JNI_HEADER_CLASSFILES)
|
|
|
|
|
|
|
|
export::
|
|
|
|
@echo Generating/Updating JNI headers
|
|
|
|
$(JAVAH) -jni -d $(JNI_GEN_DIR) $(JNI_PACKAGE_CLASSES)
|
|
|
|
ifdef MOZ_GENMAC
|
|
|
|
@if test ! -d $(DEPTH)/lib/mac/Java/; then \
|
|
|
|
echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \
|
|
|
|
echo "!!! This allows us to automatically update generated files for the mac."; \
|
|
|
|
echo "!!! If you see any modified files there, please check them in."; \
|
1999-03-31 02:21:54 +04:00
|
|
|
else \
|
|
|
|
true; \
|
1998-08-01 00:19:50 +04:00
|
|
|
fi
|
|
|
|
@echo Generating/Updating JNI headers for the Mac
|
|
|
|
$(JAVAH) -jni -mac -d $(DEPTH)/lib/mac/Java/_jni $(JNI_PACKAGE_CLASSES)
|
|
|
|
endif
|
|
|
|
endif # JAVA_OR_NSJVM
|
|
|
|
endif # JNI_GEN
|
|
|
|
|
|
|
|
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
#
|
|
|
|
# JMC_EXPORT -- for declaring which java classes are to be exported for jmc
|
|
|
|
#
|
|
|
|
ifneq ($(JMC_EXPORT),)
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
JMC_EXPORT_PATHS = $(subst .,/,$(JMC_EXPORT))
|
|
|
|
JMC_EXPORT_FILES = $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS))
|
|
|
|
|
|
|
|
#
|
|
|
|
# We're doing NSINSTALL -t here (copy mode) because calling INSTALL will pick up
|
|
|
|
# your NSDISTMODE and make links relative to the current directory. This is a
|
|
|
|
# problem because the source isn't in the current directory:
|
|
|
|
#
|
|
|
|
export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
2000-03-31 05:24:48 +04:00
|
|
|
$(NSINSTALL) -t $(IFLAGS1) $(JMC_EXPORT_FILES) $(JMCSRCDIR)
|
1998-08-01 00:19:50 +04:00
|
|
|
endif # JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
|
|
|
#
|
|
|
|
# JMC_GEN -- for generating java modules
|
|
|
|
#
|
|
|
|
# Provide default export & install rules when using JMC_GEN
|
|
|
|
#
|
|
|
|
ifneq ($(JMC_GEN),)
|
|
|
|
INCLUDES += -I$(JMC_GEN_DIR) -I.
|
1998-08-01 00:19:50 +04:00
|
|
|
ifdef JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
JMC_HEADERS = $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN))
|
|
|
|
JMC_STUBS = $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN))
|
1999-08-20 10:52:59 +04:00
|
|
|
JMC_OBJS = $(patsubst %,%.o,$(JMC_GEN))
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
$(JMC_GEN_DIR)/M%.h: $(JMCSRCDIR)/%.class
|
|
|
|
$(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=)
|
|
|
|
|
|
|
|
$(JMC_GEN_DIR)/M%.c: $(JMCSRCDIR)/%.class
|
|
|
|
$(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=)
|
|
|
|
|
1999-08-20 10:52:59 +04:00
|
|
|
M%.o: $(JMC_GEN_DIR)/M%.h $(JMC_GEN_DIR)/M%.c
|
1998-03-28 05:44:41 +03:00
|
|
|
ifeq ($(OS_ARCH),OS2)
|
|
|
|
$(CC) -Fo$@ -c $(CFLAGS) $(JMC_GEN_DIR)/M$*.c
|
|
|
|
else
|
|
|
|
$(CC) -o $@ -c $(CFLAGS) $(JMC_GEN_DIR)/M$*.c
|
|
|
|
endif
|
|
|
|
|
|
|
|
export:: $(JMC_HEADERS) $(JMC_STUBS)
|
1998-08-01 00:19:50 +04:00
|
|
|
endif # JAVA_OR_NSJVM
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
|
1999-03-22 23:43:05 +03:00
|
|
|
################################################################################
|
1999-06-24 00:38:09 +04:00
|
|
|
# Copy each element of EXPORTS to $(PUBLIC)
|
1999-03-22 23:43:05 +03:00
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifneq ($(EXPORTS),)
|
1999-06-24 00:38:09 +04:00
|
|
|
$(PUBLIC)::
|
1999-03-31 02:21:54 +04:00
|
|
|
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-06-24 00:38:09 +04:00
|
|
|
export:: $(EXPORTS) $(PUBLIC)
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $^
|
1999-06-03 04:41:11 +04:00
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
1999-09-18 03:28:56 +04:00
|
|
|
# Copy each element of PREF_JS_EXPORTS to $(DIST)/bin/defaults/pref
|
1999-06-03 04:41:11 +04:00
|
|
|
|
|
|
|
ifneq ($(PREF_JS_EXPORTS),)
|
1999-09-18 03:28:56 +04:00
|
|
|
$(DIST)/bin/defaults/pref::
|
1999-06-03 04:41:11 +04:00
|
|
|
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
|
|
|
|
|
1999-09-18 03:28:56 +04:00
|
|
|
export:: $(PREF_JS_EXPORTS) $(DIST)/bin/defaults/pref
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $^
|
1999-06-03 04:41:11 +04:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
################################################################################
|
1999-05-08 06:06:15 +04:00
|
|
|
# Export the elements of $(XPIDLSRCS), generating .h and .xpt files and
|
|
|
|
# moving them to the appropriate places.
|
|
|
|
|
1999-06-20 12:59:31 +04:00
|
|
|
ifneq ($(XPIDLSRCS),)
|
|
|
|
|
1999-05-26 05:38:36 +04:00
|
|
|
ifndef XPIDL_MODULE
|
1999-09-09 13:24:58 +04:00
|
|
|
XPIDL_MODULE = $(MODULE)
|
1999-05-26 05:38:36 +04:00
|
|
|
endif
|
|
|
|
|
|
|
|
ifeq ($(XPIDL_MODULE),) # we need $(XPIDL_MODULE) to make $(XPIDL_MODULE).xpt
|
1999-05-09 02:28:49 +04:00
|
|
|
export:: FORCE
|
|
|
|
@echo
|
1999-05-09 12:16:07 +04:00
|
|
|
@echo "*** Error processing XPIDLSRCS:"
|
1999-05-26 05:38:36 +04:00
|
|
|
@echo "Please define MODULE or XPIDL_MODULE when defining XPIDLSRCS,"
|
1999-05-09 02:28:49 +04:00
|
|
|
@echo "so we have a module name to use when creating MODULE.xpt."
|
|
|
|
@echo; sleep 2; false
|
1999-11-30 07:25:19 +03:00
|
|
|
endif
|
1999-01-22 04:28:13 +03:00
|
|
|
|
2000-01-11 08:13:01 +03:00
|
|
|
# export .idl files to $(DIST)/idl
|
|
|
|
$(DIST)/idl::
|
1999-03-31 02:21:54 +04:00
|
|
|
@if test ! -d $@; then echo Creating $@; rm -rf $@; $(NSINSTALL) -D $@; else true; fi
|
1999-01-22 04:28:13 +03:00
|
|
|
|
2000-01-11 08:13:01 +03:00
|
|
|
export:: $(XPIDLSRCS) $(DIST)/idl
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $^
|
1999-01-22 04:28:13 +03:00
|
|
|
|
1999-06-24 00:38:09 +04:00
|
|
|
# generate .h files from into $(XPIDL_GEN_DIR), then export to $(PUBLIC);
|
2000-10-25 01:10:31 +04:00
|
|
|
# warn against overriding existing .h file.
|
|
|
|
$(XPIDL_GEN_DIR)/.done:
|
2000-10-26 03:06:55 +04:00
|
|
|
@if test ! -d $(XPIDL_GEN_DIR); then echo Creating $(XPIDL_GEN_DIR)/.done; rm -rf $(XPIDL_GEN_DIR); mkdir $(XPIDL_GEN_DIR); fi
|
|
|
|
@touch $@
|
1999-05-08 06:06:15 +04:00
|
|
|
|
1999-06-20 04:02:37 +04:00
|
|
|
# don't depend on $(XPIDL_GEN_DIR), because the modification date changes
|
|
|
|
# with any addition to the directory, regenerating all .h files -> everything.
|
1999-06-20 12:59:31 +04:00
|
|
|
|
2000-10-25 01:10:31 +04:00
|
|
|
$(XPIDL_GEN_DIR)/%.h: %.idl $(XPIDL_COMPILE) $(XPIDL_GEN_DIR)/.done
|
2000-02-25 06:55:50 +03:00
|
|
|
$(REPORT_BUILD)
|
2000-02-26 07:21:53 +03:00
|
|
|
$(ELOG) $(XPIDL_COMPILE) -m header -w -I $(DIST)/idl -I$(srcdir) -o $(XPIDL_GEN_DIR)/$* $<
|
1999-05-09 10:26:05 +04:00
|
|
|
@if test -n "$(findstring $*.h, $(EXPORTS))"; \
|
1999-06-04 00:28:34 +04:00
|
|
|
then echo "*** WARNING: file $*.h generated from $*.idl overrides $(srcdir)/$*.h"; else true; fi
|
1999-05-08 06:06:15 +04:00
|
|
|
|
1999-06-24 00:38:09 +04:00
|
|
|
export:: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.h, $(XPIDLSRCS)) $(PUBLIC)
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $^
|
1999-05-08 06:06:15 +04:00
|
|
|
|
1999-05-12 03:43:36 +04:00
|
|
|
ifndef NO_GEN_XPT
|
1999-05-08 06:06:15 +04:00
|
|
|
# generate intermediate .xpt files into $(XPIDL_GEN_DIR), then link
|
1999-05-26 05:38:36 +04:00
|
|
|
# into $(XPIDL_MODULE).xpt and export it to $(DIST)/bin/components.
|
1999-06-20 04:02:37 +04:00
|
|
|
$(XPIDL_GEN_DIR)/%.xpt: %.idl $(XPIDL_COMPILE)
|
2000-02-25 06:55:50 +03:00
|
|
|
$(REPORT_BUILD)
|
2000-02-26 07:21:53 +03:00
|
|
|
$(ELOG) $(XPIDL_COMPILE) -m typelib -w -I $(DIST)/idl -I$(srcdir) -o $(XPIDL_GEN_DIR)/$* $<
|
1999-05-08 06:06:15 +04:00
|
|
|
|
1999-05-26 05:38:36 +04:00
|
|
|
$(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt: $(patsubst %.idl,$(XPIDL_GEN_DIR)/%.xpt,$(XPIDLSRCS))
|
|
|
|
$(XPIDL_LINK) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $^
|
1999-05-08 06:06:15 +04:00
|
|
|
|
1999-05-26 05:38:36 +04:00
|
|
|
install:: $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt
|
2000-03-31 05:24:48 +04:00
|
|
|
$(INSTALL) $(IFLAGS1) $(XPIDL_GEN_DIR)/$(XPIDL_MODULE).xpt $(DIST)/bin/components
|
1999-05-09 12:16:07 +04:00
|
|
|
|
1999-05-12 03:43:36 +04:00
|
|
|
endif
|
|
|
|
|
2000-08-30 05:15:32 +04:00
|
|
|
GARBAGE_DIRS += $(XPIDL_GEN_DIR)
|
1999-05-08 06:06:15 +04:00
|
|
|
endif
|
1999-01-22 04:28:13 +03:00
|
|
|
|
1999-07-27 18:30:34 +04:00
|
|
|
################################################################################
|
2000-09-20 23:35:24 +04:00
|
|
|
# CHROME PACKAGING
|
2000-09-09 09:54:35 +04:00
|
|
|
|
2000-09-21 01:28:30 +04:00
|
|
|
JAR_MANIFEST := $(srcdir)/jar.mn
|
2000-09-09 09:54:35 +04:00
|
|
|
|
2000-09-21 10:22:06 +04:00
|
|
|
ifdef MOZ_DISABLE_JAR_PACKAGING
|
|
|
|
_JAR_FLAT_FILES_ONLY=-f
|
|
|
|
_JAR_REGCHROME_JAR=1
|
|
|
|
else
|
|
|
|
_JAR_FLAT_FILES_ONLY=
|
|
|
|
_JAR_REGCHROME_JAR=0
|
|
|
|
endif
|
|
|
|
|
2000-10-20 09:21:40 +04:00
|
|
|
chrome:: $(CHROME_DEPS)
|
2000-10-27 12:47:51 +04:00
|
|
|
@if test -f $(JAR_MANIFEST); then $(PERL) $(MOZILLA_DIR)/config/make-jars.pl $(_JAR_FLAT_FILES_ONLY) -d $(DIST)/bin/chrome -s $(srcdir) < $(JAR_MANIFEST); fi
|
2000-09-09 09:54:35 +04:00
|
|
|
|
2000-09-20 23:35:24 +04:00
|
|
|
install:: chrome
|
2000-05-06 04:06:32 +04:00
|
|
|
|
2000-10-27 12:47:51 +04:00
|
|
|
REGCHROME = $(PERL) $(MOZILLA_DIR)/config/add-chrome.pl $(DIST)/bin/chrome/installed-chrome.txt $(_JAR_REGCHROME_JAR)
|
2000-09-09 09:54:35 +04:00
|
|
|
|
1999-01-22 04:28:13 +03:00
|
|
|
##############################################################################
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-01-27 02:54:59 +03:00
|
|
|
ifndef NO_MDUPDATE
|
1998-03-28 05:44:41 +03:00
|
|
|
ifneq (,$(filter-out OS2 WINNT,$(OS_ARCH)))
|
1998-11-19 06:09:23 +03:00
|
|
|
-include $(DEPENDENCIES)
|
1998-03-28 05:44:41 +03:00
|
|
|
# Can't use sed because of its 4000-char line length limit, so resort to perl
|
|
|
|
.DEFAULT:
|
|
|
|
@$(PERL) -e ' \
|
|
|
|
open(MD, "< $(DEPENDENCIES)"); \
|
|
|
|
while (<MD>) { \
|
|
|
|
if (m@ \.*/*$< @) { \
|
|
|
|
$$found = 1; \
|
|
|
|
last; \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
if ($$found) { \
|
|
|
|
print "Removing stale dependency $< from $(DEPENDENCIES)\n"; \
|
|
|
|
seek(MD, 0, 0); \
|
1999-08-20 10:52:59 +04:00
|
|
|
$$tmpname = "fix.md" . $$$$; \
|
1998-03-28 05:44:41 +03:00
|
|
|
open(TMD, "> " . $$tmpname); \
|
|
|
|
while (<MD>) { \
|
|
|
|
s@ \.*/*$< @ @; \
|
|
|
|
if (!print TMD "$$_") { \
|
|
|
|
unlink(($$tmpname)); \
|
|
|
|
exit(1); \
|
|
|
|
} \
|
|
|
|
} \
|
|
|
|
close(TMD); \
|
|
|
|
if (!rename($$tmpname, "$(DEPENDENCIES)")) { \
|
|
|
|
unlink(($$tmpname)); \
|
|
|
|
} \
|
|
|
|
} elsif ("$<" ne "$(DEPENDENCIES)") { \
|
|
|
|
print "$(MAKE): *** No rule to make target $<. Stop.\n"; \
|
|
|
|
exit(1); \
|
|
|
|
}'
|
|
|
|
endif
|
1999-01-27 02:54:59 +03:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#############################################################################
|
|
|
|
# X dependency system
|
|
|
|
#############################################################################
|
1999-03-22 23:43:05 +03:00
|
|
|
ifdef COMPILER_DEPEND
|
|
|
|
depend::
|
1999-03-31 23:07:29 +04:00
|
|
|
@echo "$(MAKE): No need to run depend target.\
|
|
|
|
Using compiler-based depend." 1>&2
|
|
|
|
ifeq ($(GNU_CC)$(GNU_CXX),)
|
|
|
|
# Non-GNU compilers
|
|
|
|
@echo "`echo '$(MAKE):'|sed 's/./ /g'`"\
|
|
|
|
'(Compiler-based depend was turned on by "--enable-depend".)' 1>&2
|
|
|
|
else
|
|
|
|
# GNU compilers
|
|
|
|
@space="`echo '$(MAKE): '|sed 's/./ /g'`";\
|
|
|
|
echo "$$space"'Since you are using a GNU compiler,\
|
|
|
|
it is on by default.' 1>&2; \
|
|
|
|
echo "$$space"'To turn it off, pass --disable-md to configure.' 1>&2
|
|
|
|
endif
|
1999-03-22 23:43:05 +03:00
|
|
|
else
|
1998-03-28 05:44:41 +03:00
|
|
|
$(MKDEPENDENCIES)::
|
|
|
|
touch $(MKDEPENDENCIES)
|
1999-10-04 14:43:28 +04:00
|
|
|
ifneq ($(OS_ARCH),OpenVMS)
|
1999-08-20 10:52:59 +04:00
|
|
|
$(MKDEPEND) -o'.o' -f$(MKDEPENDENCIES) $(DEFINES) $(ACDEFINES) $(INCLUDES) $(addprefix $(srcdir)/,$(CSRCS) $(CPPSRCS)) >/dev/null 2>&1
|
1999-09-02 05:14:01 +04:00
|
|
|
@mv $(MKDEPENDENCIES) depend.mk.old && cat depend.mk.old | sed "s|^$(srcdir)/||g" > $(MKDEPENDENCIES) && rm -f depend.mk.old
|
1999-10-04 14:43:28 +04:00
|
|
|
else
|
|
|
|
# OpenVMS can't handle long lines, so make it shorter
|
|
|
|
@ln -s $(srcdir) VMSs
|
|
|
|
$(MKDEPEND) -o'.o' -f$(MKDEPENDENCIES) $(DEFINES) $(ACDEFINES) $(INCLUDES) $(addprefix VMSs/,$(CSRCS) $(CPPSRCS)) >/dev/null 2>&1
|
|
|
|
@mv $(MKDEPENDENCIES) depend.mk.old && cat depend.mk.old | sed "s|^VMSs/||g" | sed "s| VMSs/| $(srcdir)/|g" > $(MKDEPENDENCIES) && rm -f depend.mk.old
|
|
|
|
@rm VMSs
|
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1998-12-04 08:07:01 +03:00
|
|
|
ifndef MOZ_NATIVE_MAKEDEPEND
|
1999-03-22 23:43:05 +03:00
|
|
|
$(MKDEPEND):
|
1999-04-11 18:27:35 +04:00
|
|
|
cd $(DEPTH)/config; $(MAKE) nsinstall
|
1998-03-28 05:44:41 +03:00
|
|
|
cd $(MKDEPEND_DIR); $(MAKE)
|
1998-12-04 08:07:01 +03:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1998-12-04 08:07:01 +03:00
|
|
|
ifndef MOZ_NATIVE_MAKEDEPEND
|
1999-09-09 13:24:58 +04:00
|
|
|
MKDEPEND_BUILTIN = $(MKDEPEND)
|
1998-12-04 08:07:01 +03:00
|
|
|
else
|
1999-09-09 13:24:58 +04:00
|
|
|
MKDEPEND_BUILTIN =
|
1998-12-04 08:07:01 +03:00
|
|
|
endif
|
|
|
|
|
1998-03-28 05:44:41 +03:00
|
|
|
ifdef OBJS
|
1999-08-25 01:45:06 +04:00
|
|
|
depend:: $(SUBMAKEFILES) $(MAKE_DIRS) $(MKDEPEND_BUILTIN) $(MKDEPENDENCIES)
|
1998-03-28 05:44:41 +03:00
|
|
|
else
|
1999-08-25 01:45:06 +04:00
|
|
|
depend:: $(SUBMAKEFILES)
|
1998-03-28 05:44:41 +03:00
|
|
|
endif
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
1999-08-25 01:45:06 +04:00
|
|
|
dependclean:: $(SUBMAKEFILES)
|
1998-03-28 05:44:41 +03:00
|
|
|
rm -f $(MKDEPENDENCIES)
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
1999-08-20 10:52:59 +04:00
|
|
|
-include depend.mk
|
1998-03-28 05:44:41 +03:00
|
|
|
|
1999-03-22 23:43:05 +03:00
|
|
|
endif # ! COMPILER_DEPEND
|
|
|
|
|
1999-02-17 20:33:07 +03:00
|
|
|
#############################################################################
|
1999-08-25 01:45:06 +04:00
|
|
|
# Yet another depend system: -MD (configure switch: --enable-md)
|
1999-03-09 04:31:26 +03:00
|
|
|
ifdef COMPILER_DEPEND
|
|
|
|
ifdef OBJS
|
1999-08-25 01:45:06 +04:00
|
|
|
# MDDEPDIR is the subdirectory where all the dependency files are placed.
|
|
|
|
# This uses a make rule (instead of a macro) to support parallel
|
|
|
|
# builds (-jN). If this were done in the LOOP_OVER_DIRS macro, two
|
|
|
|
# processes could simultaneously try to create the same directory.
|
|
|
|
#
|
|
|
|
$(MDDEPDIR):
|
1999-09-09 13:24:58 +04:00
|
|
|
@if test ! -d $@; then echo Creating $@; rm -rf $@; mkdir $@; else true; fi
|
|
|
|
|
|
|
|
MDDEPEND_FILES := $(wildcard $(MDDEPDIR)/*.pp)
|
|
|
|
|
1999-03-09 04:31:26 +03:00
|
|
|
ifdef MDDEPEND_FILES
|
1999-10-12 16:36:07 +04:00
|
|
|
ifdef PERL
|
1999-03-11 04:35:33 +03:00
|
|
|
# The script mddepend.pl checks the dependencies and writes to stdout
|
|
|
|
# one rule to force out-of-date objects. For example,
|
|
|
|
# foo.o boo.o: FORCE
|
|
|
|
# The script has an advantage over including the *.pp files directly
|
1999-05-18 04:26:10 +04:00
|
|
|
# because it handles the case when header files are removed from the build.
|
|
|
|
# 'make' would complain that there is no way to build missing headers.
|
1999-03-30 03:19:57 +04:00
|
|
|
$(MDDEPDIR)/.all.pp: FORCE
|
2000-03-14 06:00:52 +03:00
|
|
|
@$(PERL) $(BUILD_TOOLS)/mddepend.pl $@ $(MDDEPEND_FILES)
|
1999-03-22 23:43:05 +03:00
|
|
|
-include $(MDDEPDIR)/.all.pp
|
1999-03-11 04:35:33 +03:00
|
|
|
else
|
|
|
|
include $(MDDEPEND_FILES)
|
|
|
|
endif
|
1999-03-09 04:31:26 +03:00
|
|
|
endif
|
1999-02-17 20:33:07 +03:00
|
|
|
endif
|
1999-03-10 03:03:12 +03:00
|
|
|
endif
|
1998-03-28 05:44:41 +03:00
|
|
|
#############################################################################
|
|
|
|
|
|
|
|
-include $(MY_RULES)
|
|
|
|
|
|
|
|
#
|
|
|
|
# This speeds up gmake's processing if these files don't exist.
|
|
|
|
#
|
|
|
|
$(MY_CONFIG) $(MY_RULES):
|
|
|
|
@touch $@
|
|
|
|
|
|
|
|
#
|
|
|
|
# Generate Emacs tags in a file named TAGS if ETAGS was set in $(MY_CONFIG)
|
|
|
|
# or in $(MY_RULES)
|
|
|
|
#
|
|
|
|
ifdef ETAGS
|
1998-04-16 03:56:45 +04:00
|
|
|
ifneq ($(CSRCS)$(CPPSRCS)$(HEADERS),)
|
1998-03-28 05:44:41 +03:00
|
|
|
all:: TAGS
|
|
|
|
TAGS:: $(CSRCS) $(CPPSRCS) $(HEADERS)
|
|
|
|
$(ETAGS) $(CSRCS) $(CPPSRCS) $(HEADERS)
|
|
|
|
endif
|
|
|
|
endif
|
|
|
|
|
|
|
|
################################################################################
|
|
|
|
# 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:
|
2000-03-31 11:18:52 +04:00
|
|
|
.SUFFIXES: .out .a .ln .o .ho .c .cc .C .cpp .y .l .s .S .h .sh .i .pl .class .java .html .pp .mk .in
|
1998-03-28 05:44:41 +03:00
|
|
|
|
|
|
|
#
|
|
|
|
# Don't delete these files if we get killed.
|
|
|
|
#
|
|
|
|
.PRECIOUS: .java $(JDK_HEADERS) $(JDK_STUBS) $(JRI_HEADERS) $(JRI_STUBS) $(JMC_HEADERS) $(JMC_STUBS)
|
|
|
|
|
|
|
|
#
|
|
|
|
# Fake targets. Always run these rules, even if a file/directory with that
|
|
|
|
# name already exists.
|
|
|
|
#
|
1999-09-04 02:18:30 +04:00
|
|
|
.PHONY: all all_platforms alltags boot checkout clean clobber clobber_all export install libs makefiles realclean run_viewer run_apprunner $(DIRS) FORCE
|
1999-03-10 00:56:44 +03:00
|
|
|
|
|
|
|
# Used as a dependency to force targets to rebuild
|
|
|
|
FORCE:
|
1998-03-28 05:44:41 +03:00
|
|
|
|
2000-09-28 08:02:15 +04:00
|
|
|
# Delete target if error occurs when building target
|
|
|
|
.DELETE_ON_ERROR:
|
|
|
|
|
1999-05-12 03:43:36 +04:00
|
|
|
tags: TAGS
|
|
|
|
|
1999-08-25 01:45:06 +04:00
|
|
|
TAGS: $(SUBMAKEFILES) $(CSRCS) $(CPPSRCS) $(wildcard *.h)
|
1999-05-12 03:43:36 +04:00
|
|
|
-etags $(CSRCS) $(CPPSRCS) $(wildcard *.h)
|
|
|
|
+$(LOOP_OVER_DIRS)
|
|
|
|
|
1998-08-01 00:19:50 +04:00
|
|
|
envirocheck::
|
|
|
|
@echo -----------------------------------
|
|
|
|
@echo "Enviro-Check (tm)"
|
|
|
|
@echo -----------------------------------
|
|
|
|
@echo "MOZILLA_CLIENT = $(MOZILLA_CLIENT)"
|
|
|
|
@echo "NO_MDUPDATE = $(NO_MDUPDATE)"
|
|
|
|
@echo "BUILD_OPT = $(BUILD_OPT)"
|
|
|
|
@echo "MOZ_LITE = $(MOZ_LITE)"
|
|
|
|
@echo "MOZ_MEDIUM = $(MOZ_MEDIUM)"
|
|
|
|
@echo -----------------------------------
|
1999-10-21 18:57:38 +04:00
|
|
|
|
|
|
|
echo-dirs:
|
|
|
|
@echo $(DIRS)
|
|
|
|
|
|
|
|
echo-depth-path:
|
2000-09-06 01:42:52 +04:00
|
|
|
@$(topsrcdir)/build/unix/print-depth-path.sh
|
1999-10-21 18:57:38 +04:00
|
|
|
|
|
|
|
echo-module-name:
|
|
|
|
@$(topsrcdir)/build/package/rpm/print-module-name.sh
|
|
|
|
|
|
|
|
echo-module-filelist:
|
|
|
|
@$(topsrcdir)/build/package/rpm/print-module-filelist.sh
|
2000-03-31 05:24:48 +04:00
|
|
|
|
|
|
|
showtargs:
|
2000-03-31 11:18:52 +04:00
|
|
|
ifneq (,$(filter $(PROGRAM) $(HOST_PROGRAM) $(SIMPLE_PROGRAMS) $(HOST_LIBRARY) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS)))
|
2000-03-31 05:24:48 +04:00
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
@echo "PROGRAM = $(PROGRAM)"
|
|
|
|
@echo "SIMPLE_PROGRAMS = $(SIMPLE_PROGRAMS)"
|
|
|
|
@echo "LIBRARY = $(LIBRARY)"
|
|
|
|
@echo "SHARED_LIBRARY = $(SHARED_LIBRARY)"
|
|
|
|
@echo "SHARED_LIBRARY_LIBS = $(SHARED_LIBRARY_LIBS)"
|
|
|
|
@echo "LIBS = $(LIBS)"
|
|
|
|
@echo "DEF_FILE = $(DEF_FILE)"
|
|
|
|
@echo "DEF_OBJS = $(DEF_OBJS)"
|
|
|
|
@echo "IMPORT_LIBRARY = $(IMPORT_LIBRARY)"
|
|
|
|
@echo "STATIC_LIBS = $(STATIC_LIBS)"
|
|
|
|
@echo "SHARED_LIBS = $(SHARED_LIBS)"
|
|
|
|
@echo "EXTRA_DSO_LIBS = $(EXTRA_DSO_LIBS)"
|
|
|
|
@echo "EXTRA_DSO_LDOPTS = $(EXTRA_DSO_LDOPTS)"
|
|
|
|
@echo --------------------------------------------------------------------------------
|
|
|
|
endif
|
2000-11-10 03:55:44 +03:00
|
|
|
+$(LOOP_OVER_MOZ_DIRS)
|
2000-03-31 05:24:48 +04:00
|
|
|
|
|
|
|
showbuild:
|
|
|
|
@echo "MOZ_BUILD_ROOT = $(MOZ_BUILD_ROOT)"
|
|
|
|
@echo "MOZ_WIDGET_TOOLKIT = $(MOZ_WIDGET_TOOLKIT)"
|
|
|
|
@echo "CC = $(CC)"
|
|
|
|
@echo "CXX = $(CXX)"
|
|
|
|
@echo "CPP = $(CPP)"
|
|
|
|
@echo "LD = $(LD)"
|
|
|
|
@echo "AR = $(AR)"
|
|
|
|
@echo "IMPLIB = $(IMPLIB)"
|
|
|
|
@echo "FILTER = $(FILTER)"
|
|
|
|
@echo "MKSHLIB = $(MKSHLIB)"
|
|
|
|
@echo "MKCSHLIB = $(MKCSHLIB)"
|
|
|
|
@echo "RC = $(RC)"
|
|
|
|
@echo "CFLAGS = $(CFLAGS)"
|
|
|
|
@echo "OS_CFLAGS = $(OS_CFLAGS)"
|
|
|
|
@echo "COMPILE_CFLAGS = $(COMPILE_CFLAGS)"
|
|
|
|
@echo "CXXFLAGS = $(CXXFLAGS)"
|
|
|
|
@echo "OS_CXXFLAGS = $(OS_CFXXFLAGS)"
|
|
|
|
@echo "COMPILE_CXXFLAGS = $(COMPILE_CXXFLAGS)"
|
|
|
|
@echo "LDFLAGS = $(LDFLAGS)"
|
|
|
|
@echo "OS_LDFLAGS = $(OS_LDFLAGS)"
|
|
|
|
@echo "DSO_LDOPTS = $(DSO_LDOPTS)"
|
|
|
|
@echo "OS_INCLUDES = $(OS_INCLUDES)"
|
|
|
|
@echo "OS_LIBS = $(OS_LIBS)"
|
|
|
|
@echo "EXTRA_LIBS = $(EXTRA_LIBS)"
|
|
|
|
@echo "BIN_FLAGS = $(BIN_FLAGS)"
|
|
|
|
@echo "INCLUDES = $(INCLUDES)"
|
|
|
|
@echo "DEFINES = $(DEFINES)"
|
|
|
|
@echo "ACDEFINES = $(ACDEFINES)"
|
|
|
|
@echo "BIN_SUFFIX = $(BIN_SUFFIX)"
|
|
|
|
@echo "LIB_SUFFIX = $(LIB_SUFFIX)"
|
|
|
|
@echo "DLL_SUFFIX = $(DLL_SUFFIX)"
|
|
|
|
@echo "INSTALL = $(INSTALL)"
|
|
|
|
|
2000-04-02 20:15:42 +04:00
|
|
|
showhost:
|
|
|
|
@echo "HOST_CC = $(HOST_CC)"
|
|
|
|
@echo "HOST_CFLAGS = $(HOST_CFLAGS)"
|
|
|
|
@echo "HOST_LIBS = $(HOST_LIBS)"
|
|
|
|
@echo "HOST_EXTRA_LIBS = $(HOST_EXTRA_LIBS)"
|
|
|
|
@echo "HOST_EXTRA_DEPS = $(HOST_EXTRA_DEPS)"
|
|
|
|
@echo "HOST_PROGRAM = $(HOST_PROGRAM)"
|
|
|
|
@echo "HOST_PROGOBJS = $(HOST_PROGOBJS)"
|
|
|
|
|
2000-04-21 05:14:45 +04:00
|
|
|
showbuildmods::
|
|
|
|
@echo "Build Modules = $(BUILD_MODULES)"
|
|
|
|
@echo "Module dirs = $(BUILD_MODULE_DIRS)"
|
|
|
|
|
2000-03-31 05:24:48 +04:00
|
|
|
zipmakes:
|
|
|
|
ifneq (,$(filter $(PROGRAM) $(SIMPLE_PROGRAMS) $(LIBRARY) $(SHARED_LIBRARY),$(TARGETS)))
|
|
|
|
zip $(DEPTH)/makefiles $(subst $(topsrcdir),$(MOZ_SRC)/mozilla,$(srcdir)/Makefile.in)
|
|
|
|
endif
|
2000-11-10 03:55:44 +03:00
|
|
|
+$(LOOP_OVER_MOZ_DIRS)
|