michael@0: # michael@0: # This Source Code Form is subject to the terms of the Mozilla Public michael@0: # License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: # file, You can obtain one at http://mozilla.org/MPL/2.0/. michael@0: michael@0: ####################################################################### michael@0: ### ### michael@0: ### R U L E S O F E N G A G E M E N T ### michael@0: ### ### michael@0: ####################################################################### michael@0: michael@0: ####################################################################### michael@0: # Double-Colon rules for utilizing the binary release model. # michael@0: ####################################################################### michael@0: michael@0: all:: export libs michael@0: michael@0: ifeq ($(AUTOCLEAN),1) michael@0: autobuild:: clean export private_export libs program install michael@0: else michael@0: autobuild:: export private_export libs program install michael@0: endif michael@0: michael@0: platform:: michael@0: @echo $(OBJDIR_NAME) michael@0: michael@0: ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: USE_NT_C_SYNTAX=1 michael@0: endif michael@0: michael@0: # michael@0: # IMPORTS will always be associated with a component. Therefore, michael@0: # the "import" rule will always change directory to the top-level michael@0: # of a component, and traverse the IMPORTS keyword from the michael@0: # "manifest.mn" file located at this level only. michael@0: # michael@0: # note: if there is a trailing slash, the component will be appended michael@0: # (see import.pl - only used for xpheader.jar) michael@0: michael@0: import:: michael@0: @echo "== import.pl ==" michael@0: @$(PERL) -I$(CORE_DEPTH)/coreconf $(CORE_DEPTH)/coreconf/import.pl \ michael@0: "RELEASE_TREE=$(RELEASE_TREE)" \ michael@0: "IMPORTS=$(IMPORTS)" \ michael@0: "VERSION=$(VERSION)" \ michael@0: "OS_ARCH=$(OS_ARCH)" \ michael@0: "PLATFORM=$(PLATFORM)" \ michael@0: "OVERRIDE_IMPORT_CHECK=$(OVERRIDE_IMPORT_CHECK)" \ michael@0: "ALLOW_VERSION_OVERRIDE=$(ALLOW_VERSION_OVERRIDE)" \ michael@0: "SOURCE_RELEASE_PREFIX=$(SOURCE_RELEASE_XP_DIR)" \ michael@0: "SOURCE_MD_DIR=$(SOURCE_MD_DIR)" \ michael@0: "SOURCE_XP_DIR=$(SOURCE_XP_DIR)" \ michael@0: "FILES=$(IMPORT_XPCLASS_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR)" \ michael@0: "$(IMPORT_XPCLASS_JAR)=$(IMPORT_XP_DIR)|$(IMPORT_XPCLASS_DIR)|" \ michael@0: "$(XPHEADER_JAR)=$(IMPORT_XP_DIR)|$(SOURCE_XP_DIR)/public/|v" \ michael@0: "$(MDHEADER_JAR)=$(IMPORT_MD_DIR)|$(SOURCE_MD_DIR)/include|" \ michael@0: "$(MDBINARY_JAR)=$(IMPORT_MD_DIR)|$(SOURCE_MD_DIR)|" michael@0: # On Mac OS X ranlib needs to be rerun after static libs are moved. michael@0: ifeq ($(OS_TARGET),Darwin) michael@0: find $(SOURCE_MD_DIR)/lib -name "*.a" -exec $(RANLIB) {} \; michael@0: endif michael@0: michael@0: export:: michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: private_export:: michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: release_export:: michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: release_classes:: michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: libs program install:: $(TARGETS) michael@0: ifdef LIBRARY michael@0: $(INSTALL) -m 664 $(LIBRARY) $(SOURCE_LIB_DIR) michael@0: endif michael@0: ifdef SHARED_LIBRARY michael@0: $(INSTALL) -m 775 $(SHARED_LIBRARY) $(SOURCE_LIB_DIR) michael@0: ifdef MOZ_DEBUG_SYMBOLS michael@0: ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: $(INSTALL) -m 644 $(SHARED_LIBRARY:$(DLL_SUFFIX)=pdb) $(SOURCE_LIB_DIR) michael@0: endif michael@0: endif michael@0: endif michael@0: ifdef IMPORT_LIBRARY michael@0: $(INSTALL) -m 775 $(IMPORT_LIBRARY) $(SOURCE_LIB_DIR) michael@0: endif michael@0: ifdef PROGRAM michael@0: $(INSTALL) -m 775 $(PROGRAM) $(SOURCE_BIN_DIR) michael@0: ifdef MOZ_DEBUG_SYMBOLS michael@0: ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: $(INSTALL) -m 644 $(PROGRAM:$(PROG_SUFFIX)=.pdb) $(SOURCE_BIN_DIR) michael@0: endif michael@0: endif michael@0: endif michael@0: ifdef PROGRAMS michael@0: $(INSTALL) -m 775 $(PROGRAMS) $(SOURCE_BIN_DIR) michael@0: endif michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: tests:: michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: clean clobber:: michael@0: rm -rf $(ALL_TRASH) michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: realclean clobber_all:: michael@0: rm -rf $(wildcard *.OBJ) dist $(ALL_TRASH) michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: ####################################################################### michael@0: # Double-Colon rules for populating the binary release model. # michael@0: ####################################################################### michael@0: michael@0: michael@0: release_clean:: michael@0: rm -rf $(SOURCE_XP_DIR)/release/$(RELEASE_MD_DIR) michael@0: michael@0: release:: release_clean release_export release_classes release_policy release_md release_jars release_cpdistdir michael@0: michael@0: release_cpdistdir:: michael@0: @echo "== cpdist.pl ==" michael@0: @$(PERL) -I$(CORE_DEPTH)/coreconf $(CORE_DEPTH)/coreconf/cpdist.pl \ michael@0: "RELEASE_TREE=$(RELEASE_TREE)" \ michael@0: "CORE_DEPTH=$(CORE_DEPTH)" \ michael@0: "MODULE=${MODULE}" \ michael@0: "OS_ARCH=$(OS_ARCH)" \ michael@0: "RELEASE=$(RELEASE)" \ michael@0: "PLATFORM=$(PLATFORM)" \ michael@0: "RELEASE_VERSION=$(RELEASE_VERSION)" \ michael@0: "SOURCE_RELEASE_PREFIX=$(SOURCE_RELEASE_XP_DIR)" \ michael@0: "RELEASE_XP_DIR=$(RELEASE_XP_DIR)" \ michael@0: "RELEASE_MD_DIR=$(RELEASE_MD_DIR)" \ michael@0: "FILES=$(XPCLASS_JAR) $(XPCLASS_DBG_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR) XP_FILES MD_FILES" \ michael@0: "$(XPCLASS_JAR)=$(SOURCE_RELEASE_CLASSES_DIR)|x"\ michael@0: "$(XPCLASS_DBG_JAR)=$(SOURCE_RELEASE_CLASSES_DBG_DIR)|x"\ michael@0: "$(XPHEADER_JAR)=$(SOURCE_RELEASE_XPHEADERS_DIR)|x" \ michael@0: "$(MDHEADER_JAR)=$(SOURCE_RELEASE_MDHEADERS_DIR)|m" \ michael@0: "$(MDBINARY_JAR)=$(SOURCE_RELEASE_MD_DIR)|m" \ michael@0: "XP_FILES=$(XP_FILES)|xf" \ michael@0: "MD_FILES=$(MD_FILES)|mf" michael@0: michael@0: michael@0: # $(SOURCE_RELEASE_xxx_JAR) is a name like yyy.jar michael@0: # $(SOURCE_RELEASE_xx_DIR) is a name like michael@0: michael@0: release_jars:: michael@0: @echo "== release.pl ==" michael@0: @$(PERL) -I$(CORE_DEPTH)/coreconf $(CORE_DEPTH)/coreconf/release.pl \ michael@0: "RELEASE_TREE=$(RELEASE_TREE)" \ michael@0: "PLATFORM=$(PLATFORM)" \ michael@0: "OS_ARCH=$(OS_ARCH)" \ michael@0: "RELEASE_VERSION=$(RELEASE_VERSION)" \ michael@0: "SOURCE_RELEASE_DIR=$(SOURCE_RELEASE_DIR)" \ michael@0: "FILES=$(XPCLASS_JAR) $(XPCLASS_DBG_JAR) $(XPHEADER_JAR) $(MDHEADER_JAR) $(MDBINARY_JAR)" \ michael@0: "$(XPCLASS_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DIR)|b"\ michael@0: "$(XPCLASS_DBG_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DBG_DIR)|b"\ michael@0: "$(XPHEADER_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_XPHEADERS_DIR)|a" \ michael@0: "$(MDHEADER_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_MDHEADERS_DIR)|a" \ michael@0: "$(MDBINARY_JAR)=$(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_MD_DIR)|bi" michael@0: michael@0: # Rules for releasing classes. michael@0: # We have to do some REALLY gross stuff to deal with multiple classes in one michael@0: # file, as well as nested classes, which have a filename of the form michael@0: # ContainingClass$NestedClass.class. michael@0: # RELEASE_CLASSES simply performs a required patsubst on CLASSES michael@0: # RELEASE_CLASS_PATH is RELEASE_CLASSES with the path (in ns/dist) prepended michael@0: # RELEASE_NESTED is all the nested classes in RELEASE_CLASS_PATH. We use a michael@0: # foreach and wildcard to get all the files that start out like one of the michael@0: # class files, then have a $. So, for each class file, we look for file$* michael@0: # RELEASE_FILES is the combination of RELEASE_NESTED and the class files michael@0: # specified by RELEASE_CLASSES which have .class appended to them. Note that michael@0: # the RELEASE_NESTED don't need to have .class appended because they were michael@0: # read in from the wildcard as complete filenames. michael@0: # michael@0: # The _DBG versions are the debuggable ones. michael@0: ifneq ($(CLASSES),) michael@0: michael@0: RELEASE_CLASSES := $(patsubst %,%,$(CLASSES)) michael@0: michael@0: ifdef BUILD_OPT michael@0: RELEASE_CLASS_PATH := $(patsubst %,$(SOURCE_CLASSES_DIR)/$(PACKAGE)/%, $(RELEASE_CLASSES)) michael@0: RELEASE_NESTED := $(foreach file,$(RELEASE_CLASS_PATH),$(wildcard $(file)$$*)) michael@0: RELEASE_FILES := $(patsubst %,%.class,$(RELEASE_CLASS_PATH)) $(RELEASE_NESTED) michael@0: else michael@0: RELEASE_DBG_CLASS_PATH:= $(patsubst %,$(SOURCE_CLASSES_DBG_DIR)/$(PACKAGE)/%, $(RELEASE_CLASSES)) michael@0: RELEASE_DBG_NESTED := $(foreach file,$(RELEASE_DBG_CLASS_PATH),$(wildcard $(file)$$*)) michael@0: RELEASE_DBG_FILES := $(patsubst %,%.class,$(RELEASE_DBG_CLASS_PATH)) $(RELEASE_DBG_NESTED) michael@0: endif michael@0: michael@0: # Substitute \$ for $ so the shell doesn't choke michael@0: ifdef BUILD_OPT michael@0: release_classes:: michael@0: $(INSTALL) -m 444 $(subst $$,\$$,$(RELEASE_FILES)) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DIR)/$(PACKAGE) michael@0: else michael@0: release_classes:: michael@0: $(INSTALL) -m 444 $(subst $$,\$$,$(RELEASE_DBG_FILES)) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_CLASSES_DBG_DIR)/$(PACKAGE) michael@0: endif michael@0: michael@0: endif michael@0: michael@0: release_policy:: michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: ifndef NO_MD_RELEASE michael@0: ifdef LIBRARY michael@0: MD_LIB_RELEASE_FILES += $(LIBRARY) michael@0: endif michael@0: ifdef SHARED_LIBRARY michael@0: MD_LIB_RELEASE_FILES += $(SHARED_LIBRARY) michael@0: endif michael@0: ifdef IMPORT_LIBRARY michael@0: MD_LIB_RELEASE_FILES += $(IMPORT_LIBRARY) michael@0: endif michael@0: ifdef PROGRAM michael@0: MD_BIN_RELEASE_FILES += $(PROGRAM) michael@0: endif michael@0: ifdef PROGRAMS michael@0: MD_BIN_RELEASE_FILES += $(PROGRAMS) michael@0: endif michael@0: endif michael@0: michael@0: release_md:: michael@0: ifneq ($(MD_LIB_RELEASE_FILES),) michael@0: $(INSTALL) -m 444 $(MD_LIB_RELEASE_FILES) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_LIB_DIR) michael@0: endif michael@0: ifneq ($(MD_BIN_RELEASE_FILES),) michael@0: $(INSTALL) -m 555 $(MD_BIN_RELEASE_FILES) $(SOURCE_RELEASE_PREFIX)/$(SOURCE_RELEASE_BIN_DIR) michael@0: endif michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: michael@0: alltags: michael@0: rm -f TAGS michael@0: find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a michael@0: find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a michael@0: michael@0: $(PROGRAM): $(OBJS) $(EXTRA_LIBS) michael@0: @$(MAKE_OBJDIR) michael@0: ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: $(MKPROG) $(subst /,\\,$(OBJS)) -Fe$@ -link $(LDFLAGS) $(subst /,\\,$(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS)) michael@0: ifdef MT michael@0: if test -f $@.manifest; then \ michael@0: $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ michael@0: rm -f $@.manifest; \ michael@0: fi michael@0: endif # MSVC with manifest tool michael@0: else michael@0: $(MKPROG) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) michael@0: endif michael@0: michael@0: get_objs: michael@0: @echo $(OBJS) michael@0: michael@0: $(LIBRARY): $(OBJS) michael@0: @$(MAKE_OBJDIR) michael@0: rm -f $@ michael@0: ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: $(AR) $(subst /,\\,$(OBJS)) michael@0: else michael@0: $(AR) $(OBJS) michael@0: endif michael@0: $(RANLIB) $@ michael@0: michael@0: michael@0: ifeq ($(OS_TARGET),OS2) michael@0: $(IMPORT_LIBRARY): $(MAPFILE) michael@0: rm -f $@ michael@0: $(IMPLIB) $@ $< michael@0: $(RANLIB) $@ michael@0: endif michael@0: michael@0: ifdef SHARED_LIBRARY_LIBS michael@0: ifdef BUILD_TREE michael@0: SUB_SHLOBJS = $(foreach dir,$(SHARED_LIBRARY_DIRS),$(shell $(MAKE) -C $(dir) --no-print-directory get_objs)) michael@0: else michael@0: SUB_SHLOBJS = $(foreach dir,$(SHARED_LIBRARY_DIRS),$(addprefix $(dir)/,$(shell $(MAKE) -C $(dir) --no-print-directory get_objs))) michael@0: endif michael@0: endif michael@0: michael@0: $(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE) $(SUB_SHLOBJS) michael@0: @$(MAKE_OBJDIR) michael@0: rm -f $@ michael@0: ifeq ($(OS_TARGET)$(OS_RELEASE), AIX4.1) michael@0: echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms michael@0: nm -B -C -g $(OBJS) \ michael@0: | awk '/ [T,D] / {print $$3}' \ michael@0: | sed -e 's/^\.//' \ michael@0: | sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms michael@0: $(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \ michael@0: -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) michael@0: else michael@0: ifeq (,$(filter-out WIN%,$(OS_TARGET))) michael@0: ifdef NS_USE_GCC michael@0: $(LINK_DLL) $(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES) michael@0: else michael@0: $(LINK_DLL) -MAP $(DLLBASE) $(subst /,\\,$(OBJS) $(SUB_SHLOBJS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) $(LD_LIBS) $(RES)) michael@0: ifdef MT michael@0: if test -f $@.manifest; then \ michael@0: $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \ michael@0: rm -f $@.manifest; \ michael@0: fi michael@0: endif # MSVC with manifest tool michael@0: endif michael@0: else michael@0: $(MKSHLIB) -o $@ $(OBJS) $(SUB_SHLOBJS) $(LD_LIBS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) michael@0: chmod +x $@ michael@0: endif michael@0: endif michael@0: michael@0: ifeq (,$(filter-out WIN%,$(OS_TARGET))) michael@0: $(RES): $(RESNAME) michael@0: @$(MAKE_OBJDIR) michael@0: # The resource compiler does not understand the -U option. michael@0: ifdef NS_USE_GCC michael@0: $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $< michael@0: else michael@0: $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $< michael@0: endif michael@0: @echo $(RES) finished michael@0: endif michael@0: michael@0: $(MAPFILE): $(MAPFILE_SOURCE) michael@0: @$(MAKE_OBJDIR) michael@0: $(PROCESS_MAP_FILE) michael@0: michael@0: michael@0: $(OBJDIR)/$(PROG_PREFIX)%$(PROG_SUFFIX): $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX) michael@0: @$(MAKE_OBJDIR) michael@0: ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: $(MKPROG) $< -Fe$@ -link \ michael@0: $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) michael@0: ifdef MT michael@0: if test -f $@.manifest; then \ michael@0: $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ michael@0: rm -f $@.manifest; \ michael@0: fi michael@0: endif # MSVC with manifest tool michael@0: else michael@0: $(MKPROG) -o $@ $(CFLAGS) $< \ michael@0: $(LDFLAGS) $(EXTRA_LIBS) $(EXTRA_SHARED_LIBS) $(OS_LIBS) michael@0: endif michael@0: michael@0: WCCFLAGS1 := $(subst /,\\,$(CFLAGS)) michael@0: WCCFLAGS2 := $(subst -I,-i=,$(WCCFLAGS1)) michael@0: WCCFLAGS3 := $(subst -D,-d,$(WCCFLAGS2)) michael@0: michael@0: # Translate source filenames to absolute paths. This is required for michael@0: # debuggers under Windows & OS/2 to find source files automatically michael@0: michael@0: ifeq (,$(filter-out OS2 AIX,$(OS_TARGET))) michael@0: # OS/2 and AIX michael@0: NEED_ABSOLUTE_PATH := 1 michael@0: PWD := $(shell pwd) michael@0: michael@0: else michael@0: # Windows michael@0: ifeq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: NEED_ABSOLUTE_PATH := 1 michael@0: ifdef .PYMAKE michael@0: PWD := $(CURDIR) michael@0: else michael@0: PWD := $(shell pwd) michael@0: ifeq (,$(findstring ;,$(PATH))) michael@0: ifndef USE_MSYS michael@0: PWD := $(subst \,/,$(shell cygpath -w $(PWD))) michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: else michael@0: # everything else michael@0: PWD := $(shell pwd) michael@0: endif michael@0: endif michael@0: michael@0: # The quotes allow absolute paths to contain spaces. michael@0: core_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(PWD)/$(1)))" michael@0: michael@0: $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.c michael@0: @$(MAKE_OBJDIR) michael@0: ifdef USE_NT_C_SYNTAX michael@0: $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: ifdef NEED_ABSOLUTE_PATH michael@0: $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: $(CC) -o $@ -c $(CFLAGS) $< michael@0: endif michael@0: endif michael@0: michael@0: $(PROG_PREFIX)%$(OBJ_SUFFIX): %.c michael@0: ifdef USE_NT_C_SYNTAX michael@0: $(CC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: ifdef NEED_ABSOLUTE_PATH michael@0: $(CC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: $(CC) -o $@ -c $(CFLAGS) $< michael@0: endif michael@0: endif michael@0: michael@0: ifneq (,$(filter-out _WIN%,$(NS_USE_GCC)_$(OS_TARGET))) michael@0: $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.s michael@0: @$(MAKE_OBJDIR) michael@0: $(AS) -o $@ $(ASFLAGS) -c $< michael@0: endif michael@0: michael@0: $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.asm michael@0: @$(MAKE_OBJDIR) michael@0: $(AS) -Fo$@ $(ASFLAGS) -c $< michael@0: michael@0: $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.S michael@0: @$(MAKE_OBJDIR) michael@0: $(AS) -o $@ $(ASFLAGS) -c $< michael@0: michael@0: $(OBJDIR)/$(PROG_PREFIX)%: %.cpp michael@0: @$(MAKE_OBJDIR) michael@0: ifdef USE_NT_C_SYNTAX michael@0: $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: ifdef NEED_ABSOLUTE_PATH michael@0: $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: $(CCC) -o $@ -c $(CFLAGS) $< michael@0: endif michael@0: endif michael@0: michael@0: # michael@0: # Please keep the next two rules in sync. michael@0: # michael@0: $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.cc michael@0: @$(MAKE_OBJDIR) michael@0: $(CCC) -o $@ -c $(CFLAGS) $< michael@0: michael@0: $(OBJDIR)/$(PROG_PREFIX)%$(OBJ_SUFFIX): %.cpp michael@0: @$(MAKE_OBJDIR) michael@0: ifdef STRICT_CPLUSPLUS_SUFFIX michael@0: echo "#line 1 \"$<\"" | cat - $< > $(OBJDIR)/t_$*.cc michael@0: $(CCC) -o $@ -c $(CFLAGS) $(OBJDIR)/t_$*.cc michael@0: rm -f $(OBJDIR)/t_$*.cc michael@0: else michael@0: ifdef USE_NT_C_SYNTAX michael@0: $(CCC) -Fo$@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: ifdef NEED_ABSOLUTE_PATH michael@0: $(CCC) -o $@ -c $(CFLAGS) $(call core_abspath,$<) michael@0: else michael@0: $(CCC) -o $@ -c $(CFLAGS) $< michael@0: endif michael@0: endif michael@0: endif #STRICT_CPLUSPLUS_SUFFIX michael@0: michael@0: %.i: %.cpp michael@0: $(CCC) -C -E $(CFLAGS) $< > $@ michael@0: michael@0: %.i: %.c michael@0: ifeq (,$(filter-out WIN%,$(OS_TARGET))) michael@0: $(CC) -C /P $(CFLAGS) $< michael@0: else michael@0: $(CC) -C -E $(CFLAGS) $< > $@ michael@0: endif michael@0: michael@0: ifneq (,$(filter-out WIN%,$(OS_TARGET))) michael@0: %.i: %.s michael@0: $(CC) -C -E $(CFLAGS) $< > $@ michael@0: endif michael@0: michael@0: %: %.pl michael@0: rm -f $@; cp $< $@; chmod +x $@ michael@0: michael@0: %: %.sh michael@0: rm -f $@; cp $< $@; chmod +x $@ michael@0: michael@0: ################################################################################ michael@0: # Bunch of things that extend the 'export' rule (in order): michael@0: ################################################################################ michael@0: michael@0: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) $(JMCSRCDIR):: michael@0: @if test ! -d $@; then \ michael@0: echo Creating $@; \ michael@0: rm -rf $@; \ michael@0: $(NSINSTALL) -D $@; \ michael@0: fi michael@0: michael@0: ################################################################################ michael@0: ## IDL_GEN michael@0: michael@0: ifneq ($(IDL_GEN),) michael@0: michael@0: #export:: michael@0: # $(IDL2JAVA) $(IDL_GEN) michael@0: michael@0: #all:: export michael@0: michael@0: #clobber:: michael@0: # rm -f $(IDL_GEN:.idl=.class) # XXX wrong! michael@0: michael@0: endif michael@0: michael@0: ################################################################################ michael@0: ### JSRCS -- for compiling java files michael@0: ### michael@0: ### NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, michael@0: ### replace $(CORE_DEPTH) with $(NETLIBDEPTH). michael@0: ### michael@0: michael@0: ifneq ($(JSRCS),) michael@0: ifneq ($(JAVAC),) michael@0: ifdef NETLIBDEPTH michael@0: CORE_DEPTH := $(NETLIBDEPTH) michael@0: endif michael@0: michael@0: JAVA_EXPORT_SRCS=$(shell $(PERL) $(CORE_DEPTH)/coreconf/outofdate.pl $(PERLARG) -d $(JAVA_DESTPATH)/$(PACKAGE) $(JSRCS) $(PRIVATE_JSRCS)) michael@0: michael@0: export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) michael@0: ifneq ($(JAVA_EXPORT_SRCS),) michael@0: $(JAVAC) $(JAVA_EXPORT_SRCS) michael@0: endif michael@0: michael@0: all:: export michael@0: michael@0: clobber:: michael@0: rm -f $(SOURCE_XP_DIR)/classes/$(PACKAGE)/*.class michael@0: michael@0: endif michael@0: endif michael@0: michael@0: # michael@0: # JDIRS -- like JSRCS, except you can give a list of directories and it will michael@0: # compile all the out-of-date java files in those directories. michael@0: # michael@0: # NOTE: recursing through these can speed things up, but they also cause michael@0: # some builds to run out of memory michael@0: # michael@0: # NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, michael@0: # replace $(CORE_DEPTH) with $(NETLIBDEPTH). michael@0: # michael@0: ifdef JDIRS michael@0: ifneq ($(JAVAC),) michael@0: ifdef NETLIBDEPTH michael@0: CORE_DEPTH := $(NETLIBDEPTH) michael@0: endif michael@0: michael@0: # !!!!! THIS WILL CRASH SHMSDOS.EXE !!!!! michael@0: # shmsdos does not support shell variables. It will crash when it tries michael@0: # to parse the '=' character. A solution is to rewrite outofdate.pl so it michael@0: # takes the Javac command as an argument and executes the command itself, michael@0: # instead of returning a list of files. michael@0: export:: $(JAVA_DESTPATH) $(JAVA_DESTPATH)/$(PACKAGE) michael@0: @echo "!!! THIS COMMAND IS BROKEN ON WINDOWS--SEE rules.mk FOR DETAILS !!!" michael@0: return -1 michael@0: @for d in $(JDIRS); do \ michael@0: if test -d $$d; then \ michael@0: set $(EXIT_ON_ERROR); \ michael@0: files=`echo $$d/*.java`; \ michael@0: list=`$(PERL) $(CORE_DEPTH)/coreconf/outofdate.pl $(PERLARG) \ michael@0: -d $(JAVA_DESTPATH)/$(PACKAGE) $$files`; \ michael@0: if test "$${list}x" != "x"; then \ michael@0: echo Building all java files in $$d; \ michael@0: echo $(JAVAC) $$list; \ michael@0: $(JAVAC) $$list; \ michael@0: fi; \ michael@0: set +e; \ michael@0: else \ michael@0: echo "Skipping non-directory $$d..."; \ michael@0: fi; \ michael@0: $(CLICK_STOPWATCH); \ michael@0: done michael@0: endif michael@0: endif michael@0: michael@0: # michael@0: # JDK_GEN -- for generating "old style" native methods michael@0: # michael@0: # Generate JDK Headers and Stubs into the '_gen' and '_stubs' directory michael@0: # michael@0: # NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, michael@0: # replace $(CORE_DEPTH) with $(NETLIBDEPTH). michael@0: # michael@0: ifneq ($(JDK_GEN),) michael@0: ifneq ($(JAVAH),) michael@0: ifdef NSBUILDROOT michael@0: INCLUDES += -I$(JDK_GEN_DIR) -I$(SOURCE_XP_DIR) michael@0: else michael@0: INCLUDES += -I$(JDK_GEN_DIR) michael@0: endif michael@0: michael@0: ifdef NETLIBDEPTH michael@0: CORE_DEPTH := $(NETLIBDEPTH) michael@0: endif michael@0: michael@0: JDK_PACKAGE_CLASSES := $(JDK_GEN) michael@0: JDK_PATH_CLASSES := $(subst .,/,$(JDK_PACKAGE_CLASSES)) michael@0: JDK_HEADER_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES)) michael@0: JDK_STUB_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JDK_PATH_CLASSES)) michael@0: JDK_HEADER_CFILES := $(patsubst %,$(JDK_GEN_DIR)/%.h,$(JDK_GEN)) michael@0: JDK_STUB_CFILES := $(patsubst %,$(JDK_STUB_DIR)/%.c,$(JDK_GEN)) michael@0: michael@0: $(JDK_HEADER_CFILES): $(JDK_HEADER_CLASSFILES) michael@0: $(JDK_STUB_CFILES): $(JDK_STUB_CLASSFILES) michael@0: michael@0: export:: michael@0: @echo Generating/Updating JDK headers michael@0: $(JAVAH) -d $(JDK_GEN_DIR) $(JDK_PACKAGE_CLASSES) michael@0: @echo Generating/Updating JDK stubs michael@0: $(JAVAH) -stubs -d $(JDK_STUB_DIR) $(JDK_PACKAGE_CLASSES) michael@0: ifndef NO_MAC_JAVA_SHIT michael@0: @if test ! -d $(CORE_DEPTH)/lib/mac/Java/; then \ michael@0: echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \ michael@0: echo "!!! This allows us to automatically update generated files for the mac."; \ michael@0: echo "!!! If you see any modified files there, please check them in."; \ michael@0: fi michael@0: @echo Generating/Updating JDK headers for the Mac michael@0: $(JAVAH) -mac -d $(CORE_DEPTH)/lib/mac/Java/_gen $(JDK_PACKAGE_CLASSES) michael@0: @echo Generating/Updating JDK stubs for the Mac michael@0: $(JAVAH) -mac -stubs -d $(CORE_DEPTH)/lib/mac/Java/_stubs $(JDK_PACKAGE_CLASSES) michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: # michael@0: # JRI_GEN -- for generating "old style" JRI native methods michael@0: # michael@0: # Generate JRI Headers and Stubs into the 'jri' directory michael@0: # michael@0: # NOTE: For backwards compatibility, if $(NETLIBDEPTH) is defined, michael@0: # replace $(CORE_DEPTH) with $(NETLIBDEPTH). michael@0: # michael@0: ifneq ($(JRI_GEN),) michael@0: ifneq ($(JAVAH),) michael@0: ifdef NSBUILDROOT michael@0: INCLUDES += -I$(JRI_GEN_DIR) -I$(SOURCE_XP_DIR) michael@0: else michael@0: INCLUDES += -I$(JRI_GEN_DIR) michael@0: endif michael@0: michael@0: ifdef NETLIBDEPTH michael@0: CORE_DEPTH := $(NETLIBDEPTH) michael@0: endif michael@0: michael@0: JRI_PACKAGE_CLASSES := $(JRI_GEN) michael@0: JRI_PATH_CLASSES := $(subst .,/,$(JRI_PACKAGE_CLASSES)) michael@0: JRI_HEADER_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES)) michael@0: JRI_STUB_CLASSFILES := $(patsubst %,$(JAVA_DESTPATH)/%.class,$(JRI_PATH_CLASSES)) michael@0: JRI_HEADER_CFILES := $(patsubst %,$(JRI_GEN_DIR)/%.h,$(JRI_GEN)) michael@0: JRI_STUB_CFILES := $(patsubst %,$(JRI_GEN_DIR)/%.c,$(JRI_GEN)) michael@0: michael@0: $(JRI_HEADER_CFILES): $(JRI_HEADER_CLASSFILES) michael@0: $(JRI_STUB_CFILES): $(JRI_STUB_CLASSFILES) michael@0: michael@0: export:: michael@0: @echo Generating/Updating JRI headers michael@0: $(JAVAH) -jri -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES) michael@0: @echo Generating/Updating JRI stubs michael@0: $(JAVAH) -jri -stubs -d $(JRI_GEN_DIR) $(JRI_PACKAGE_CLASSES) michael@0: ifndef NO_MAC_JAVA_SHIT michael@0: @if test ! -d $(CORE_DEPTH)/lib/mac/Java/; then \ michael@0: echo "!!! You need to have a ns/lib/mac/Java directory checked out."; \ michael@0: echo "!!! This allows us to automatically update generated files for the mac."; \ michael@0: echo "!!! If you see any modified files there, please check them in."; \ michael@0: fi michael@0: @echo Generating/Updating JRI headers for the Mac michael@0: $(JAVAH) -jri -mac -d $(CORE_DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES) michael@0: @echo Generating/Updating JRI stubs for the Mac michael@0: $(JAVAH) -jri -mac -stubs -d $(CORE_DEPTH)/lib/mac/Java/_jri $(JRI_PACKAGE_CLASSES) michael@0: endif michael@0: endif michael@0: endif michael@0: michael@0: # michael@0: # JNI_GEN -- for generating JNI native methods michael@0: # michael@0: # Generate JNI Headers into the 'jni' directory michael@0: # michael@0: ifneq ($(JNI_GEN),) michael@0: ifneq ($(JAVAH),) michael@0: JNI_HEADERS := $(patsubst %,$(JNI_GEN_DIR)/%.h,$(JNI_GEN)) michael@0: michael@0: export:: michael@0: @if test ! -d $(JNI_GEN_DIR); then \ michael@0: echo $(JAVAH) -jni -d $(JNI_GEN_DIR) $(JNI_GEN); \ michael@0: $(JAVAH) -jni -d $(JNI_GEN_DIR) $(JNI_GEN); \ michael@0: else \ michael@0: echo "Checking for out of date header files" ; \ michael@0: $(PERL) $(CORE_DEPTH)/coreconf/jniregen.pl $(PERLARG) \ michael@0: -d $(JAVA_DESTPATH) -j "$(JAVAH) -jni -d $(JNI_GEN_DIR)" $(JNI_GEN);\ michael@0: fi michael@0: endif michael@0: endif michael@0: michael@0: # michael@0: # JMC_EXPORT -- for declaring which java classes are to be exported for jmc michael@0: # michael@0: ifneq ($(JMC_EXPORT),) michael@0: JMC_EXPORT_PATHS := $(subst .,/,$(JMC_EXPORT)) michael@0: JMC_EXPORT_FILES := $(patsubst %,$(JAVA_DESTPATH)/$(PACKAGE)/%.class,$(JMC_EXPORT_PATHS)) michael@0: michael@0: # michael@0: # We're doing NSINSTALL -t here (copy mode) because calling INSTALL will pick up michael@0: # your NSDISTMODE and make links relative to the current directory. This is a michael@0: # problem because the source isn't in the current directory: michael@0: # michael@0: export:: $(JMC_EXPORT_FILES) $(JMCSRCDIR) michael@0: $(NSINSTALL) -t -m 444 $(JMC_EXPORT_FILES) $(JMCSRCDIR) michael@0: endif michael@0: michael@0: # michael@0: # JMC_GEN -- for generating java modules michael@0: # michael@0: # Provide default export & install rules when using JMC_GEN michael@0: # michael@0: ifneq ($(JMC_GEN),) michael@0: ifneq ($(JMC),) michael@0: INCLUDES += -I$(JMC_GEN_DIR) -I. michael@0: JMC_HEADERS := $(patsubst %,$(JMC_GEN_DIR)/%.h,$(JMC_GEN)) michael@0: JMC_STUBS := $(patsubst %,$(JMC_GEN_DIR)/%.c,$(JMC_GEN)) michael@0: JMC_OBJS := $(patsubst %,$(OBJDIR)/%$(OBJ_SUFFIX),$(JMC_GEN)) michael@0: michael@0: $(JMC_GEN_DIR)/M%.h: $(JMCSRCDIR)/%.class michael@0: $(JMC) -d $(JMC_GEN_DIR) -interface $(JMC_GEN_FLAGS) $(?F:.class=) michael@0: michael@0: $(JMC_GEN_DIR)/M%.c: $(JMCSRCDIR)/%.class michael@0: $(JMC) -d $(JMC_GEN_DIR) -module $(JMC_GEN_FLAGS) $(?F:.class=) michael@0: michael@0: $(OBJDIR)/M%$(OBJ_SUFFIX): $(JMC_GEN_DIR)/M%.c $(JMC_GEN_DIR)/M%.h michael@0: @$(MAKE_OBJDIR) michael@0: $(CC) -o $@ -c $(CFLAGS) $< michael@0: michael@0: export:: $(JMC_HEADERS) $(JMC_STUBS) michael@0: endif michael@0: endif michael@0: michael@0: # michael@0: # Copy each element of EXPORTS to $(SOURCE_XP_DIR)/public/$(MODULE)/ michael@0: # michael@0: PUBLIC_EXPORT_DIR = $(SOURCE_XP_DIR)/public/$(MODULE) michael@0: michael@0: ifneq ($(EXPORTS),) michael@0: $(PUBLIC_EXPORT_DIR):: michael@0: @if test ! -d $@; then \ michael@0: echo Creating $@; \ michael@0: $(NSINSTALL) -D $@; \ michael@0: fi michael@0: michael@0: export:: $(PUBLIC_EXPORT_DIR) michael@0: michael@0: export:: $(EXPORTS) michael@0: $(INSTALL) -m 444 $^ $(PUBLIC_EXPORT_DIR) michael@0: michael@0: export:: $(BUILT_SRCS) michael@0: endif michael@0: michael@0: # Duplicate export rule for private exports, with different directories michael@0: michael@0: PRIVATE_EXPORT_DIR = $(SOURCE_XP_DIR)/private/$(MODULE) michael@0: michael@0: ifneq ($(PRIVATE_EXPORTS),) michael@0: $(PRIVATE_EXPORT_DIR):: michael@0: @if test ! -d $@; then \ michael@0: echo Creating $@; \ michael@0: $(NSINSTALL) -D $@; \ michael@0: fi michael@0: michael@0: private_export:: $(PRIVATE_EXPORT_DIR) michael@0: michael@0: private_export:: $(PRIVATE_EXPORTS) michael@0: $(INSTALL) -m 444 $^ $(PRIVATE_EXPORT_DIR) michael@0: else michael@0: private_export:: michael@0: @echo There are no private exports.; michael@0: endif michael@0: michael@0: ########################################################################## michael@0: ### RULES FOR RUNNING REGRESSION SUITE TESTS michael@0: ### REQUIRES 'REGRESSION_SPEC' TO BE SET TO THE NAME OF A REGRESSION SPECFILE michael@0: ### AND RESULTS_SUBDIR TO BE SET TO SOMETHING LIKE SECURITY/PKCS5 michael@0: ########################################################################## michael@0: michael@0: TESTS_DIR = $(RESULTS_DIR)/$(RESULTS_SUBDIR)/$(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(IMPL_STRATEGY) michael@0: michael@0: ifneq ($(REGRESSION_SPEC),) michael@0: michael@0: ifneq ($(BUILD_OPT),) michael@0: REGDATE = $(subst \ ,, $(shell $(PERL) $(CORE_DEPTH)/$(MODULE)/scripts/now)) michael@0: endif michael@0: michael@0: tests:: $(REGRESSION_SPEC) michael@0: cd $(PLATFORM); \ michael@0: ../$(SOURCE_MD_DIR)/bin/regress$(PROG_SUFFIX) specfile=../$(REGRESSION_SPEC) progress $(EXTRA_REGRESS_OPTIONS); \ michael@0: if test ! -d $(TESTS_DIR); then \ michael@0: echo Creating $(TESTS_DIR); \ michael@0: $(NSINSTALL) -D $(TESTS_DIR); \ michael@0: fi michael@0: ifneq ($(BUILD_OPT),) michael@0: $(NSINSTALL) -m 664 $(PLATFORM)/$(REGDATE).sum $(TESTS_DIR); \ michael@0: $(NSINSTALL) -m 664 $(PLATFORM)/$(REGDATE).htm $(TESTS_DIR); \ michael@0: echo "Please now make sure your results files are copied to $(TESTS_DIR), "; \ michael@0: echo "then run 'reporter specfile=$(RESULTS_DIR)/rptspec'" michael@0: endif michael@0: else michael@0: tests:: michael@0: @echo Error: you didn't specify REGRESSION_SPEC in your manifest.mn file!; michael@0: endif michael@0: michael@0: michael@0: # Duplicate export rule for releases, with different directories michael@0: michael@0: ifneq ($(EXPORTS),) michael@0: $(SOURCE_RELEASE_XP_DIR)/include:: michael@0: @if test ! -d $@; then \ michael@0: echo Creating $@; \ michael@0: $(NSINSTALL) -D $@; \ michael@0: fi michael@0: michael@0: release_export:: $(SOURCE_RELEASE_XP_DIR)/include michael@0: michael@0: release_export:: $(EXPORTS) michael@0: $(INSTALL) -m 444 $^ $(SOURCE_RELEASE_XP_DIR)/include michael@0: endif michael@0: michael@0: michael@0: michael@0: michael@0: ################################################################################ michael@0: michael@0: -include $(DEPENDENCIES) michael@0: michael@0: ifneq (,$(filter-out OS2 WIN%,$(OS_TARGET))) michael@0: # Can't use sed because of its 4000-char line length limit, so resort to perl michael@0: PERL_DEPENDENCIES_PROGRAM = \ michael@0: open(MD, "< $(DEPENDENCIES)"); \ michael@0: while () { \ michael@0: if (m@ \.*/*$< @) { \ michael@0: $$found = 1; \ michael@0: last; \ michael@0: } \ michael@0: } \ michael@0: if ($$found) { \ michael@0: print "Removing stale dependency $< from $(DEPENDENCIES)\n"; \ michael@0: seek(MD, 0, 0); \ michael@0: $$tmpname = "$(OBJDIR)/fix.md" . $$$$; \ michael@0: open(TMD, "> " . $$tmpname); \ michael@0: while () { \ michael@0: s@ \.*/*$< @ @; \ michael@0: if (!print TMD "$$_") { \ michael@0: unlink(($$tmpname)); \ michael@0: exit(1); \ michael@0: } \ michael@0: } \ michael@0: close(TMD); \ michael@0: if (!rename($$tmpname, "$(DEPENDENCIES)")) { \ michael@0: unlink(($$tmpname)); \ michael@0: } \ michael@0: } elsif ("$<" ne "$(DEPENDENCIES)") { \ michael@0: print "$(MAKE): *** No rule to make target $<. Stop.\n"; \ michael@0: exit(1); \ michael@0: } michael@0: michael@0: .DEFAULT: michael@0: @$(PERL) -e '$(PERL_DEPENDENCIES_PROGRAM)' michael@0: endif michael@0: michael@0: ############################################################################# michael@0: # X dependency system michael@0: ############################################################################# michael@0: michael@0: ifdef MKDEPENDENCIES michael@0: michael@0: # For Windows, $(MKDEPENDENCIES) must be -included before including rules.mk michael@0: michael@0: $(MKDEPENDENCIES):: michael@0: @$(MAKE_OBJDIR) michael@0: touch $(MKDEPENDENCIES) michael@0: chmod u+w $(MKDEPENDENCIES) michael@0: #on NT, the preceding touch command creates a read-only file !?!?! michael@0: #which is why we have to explicitly chmod it. michael@0: $(MKDEPEND) -p$(OBJDIR_NAME)/ -o'$(OBJ_SUFFIX)' -f$(MKDEPENDENCIES) \ michael@0: $(NOMD_CFLAGS) $(YOPT) $(CSRCS) $(CPPSRCS) $(ASFILES) michael@0: michael@0: $(MKDEPEND):: $(MKDEPEND_DIR)/*.c $(MKDEPEND_DIR)/*.h michael@0: $(MAKE) -C $(MKDEPEND_DIR) michael@0: michael@0: ifdef OBJS michael@0: depend:: $(MKDEPEND) $(MKDEPENDENCIES) michael@0: else michael@0: depend:: michael@0: endif michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: dependclean:: michael@0: rm -f $(MKDEPENDENCIES) michael@0: +$(LOOP_OVER_DIRS) michael@0: michael@0: #-include $(NSINSTALL_DIR)/$(OBJDIR)/depend.mk michael@0: michael@0: else michael@0: depend:: michael@0: endif michael@0: michael@0: # michael@0: # HACK ALERT michael@0: # michael@0: # The only purpose of this rule is to pass Mozilla's Tinderbox depend michael@0: # builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's michael@0: # Tinderbox builds NSS continuously as part of the Mozilla client. michael@0: # Because NSS's make depend is not implemented, whenever we change michael@0: # an NSS header file, the depend build does not recompile the NSS michael@0: # files that depend on the header. michael@0: # michael@0: # This rule makes all the objects depend on a dummy header file. michael@0: # Check in a change to this dummy header file to force the depend michael@0: # build to recompile everything. michael@0: # michael@0: # This rule should be removed when make depend is implemented. michael@0: # michael@0: michael@0: DUMMY_DEPEND = $(CORE_DEPTH)/coreconf/coreconf.dep michael@0: michael@0: $(filter $(OBJDIR)/%$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%$(OBJ_SUFFIX): $(DUMMY_DEPEND) michael@0: michael@0: # END OF HACK michael@0: michael@0: ################################################################################ michael@0: # Special gmake rules. michael@0: ################################################################################ michael@0: michael@0: # michael@0: # Re-define the list of default suffixes, so gmake won't have to churn through michael@0: # hundreds of built-in suffix rules for stuff we don't need. michael@0: # michael@0: .SUFFIXES: michael@0: .SUFFIXES: .out .a .ln .o .obj .c .cc .C .cpp .y .l .s .S .h .sh .i .pl .class .java .html .asm .dep michael@0: michael@0: # michael@0: # Don't delete these files if we get killed. michael@0: # michael@0: .PRECIOUS: .java $(JDK_HEADERS) $(JDK_STUBS) $(JRI_HEADERS) $(JRI_STUBS) $(JMC_HEADERS) $(JMC_STUBS) $(JNI_HEADERS) michael@0: michael@0: # michael@0: # Fake targets. Always run these rules, even if a file/directory with that michael@0: # name already exists. michael@0: # michael@0: .PHONY: all all_platforms alltags boot clean clobber clobber_all export install libs program realclean release $(OBJDIR) michael@0: