security/nss/coreconf/ruleset.mk

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

michael@0 1 #
michael@0 2 # This Source Code Form is subject to the terms of the Mozilla Public
michael@0 3 # License, v. 2.0. If a copy of the MPL was not distributed with this
michael@0 4 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
michael@0 5
michael@0 6 #######################################################################
michael@0 7 # #
michael@0 8 # Parameters to this makefile (set these in this file): #
michael@0 9 # #
michael@0 10 # a) #
michael@0 11 # TARGETS -- the target to create #
michael@0 12 # (defaults to $LIBRARY $PROGRAM) #
michael@0 13 # b) #
michael@0 14 # DIRS -- subdirectories for make to recurse on #
michael@0 15 # (the 'all' rule builds $TARGETS $DIRS) #
michael@0 16 # c) #
michael@0 17 # CSRCS, CPPSRCS -- .c and .cpp files to compile #
michael@0 18 # (used to define $OBJS) #
michael@0 19 # d) #
michael@0 20 # PROGRAM -- the target program name to create from $OBJS #
michael@0 21 # ($OBJDIR automatically prepended to it) #
michael@0 22 # e) #
michael@0 23 # LIBRARY -- the target library name to create from $OBJS #
michael@0 24 # ($OBJDIR automatically prepended to it) #
michael@0 25 # f) #
michael@0 26 # JSRCS -- java source files to compile into class files #
michael@0 27 # (if you don't specify this it will default #
michael@0 28 # to *.java) #
michael@0 29 # g) #
michael@0 30 # PACKAGE -- the package to put the .class files into #
michael@0 31 # (e.g. netscape/applet) #
michael@0 32 # (NOTE: the default definition for this may be #
michael@0 33 # overridden if "jdk.mk" is included) #
michael@0 34 # h) #
michael@0 35 # JMC_EXPORT -- java files to be exported for use by JMC_GEN #
michael@0 36 # (this is a list of Class names) #
michael@0 37 # i) #
michael@0 38 # JRI_GEN -- files to run through javah to generate headers #
michael@0 39 # and stubs #
michael@0 40 # (output goes into the _jri sub-dir) #
michael@0 41 # j) #
michael@0 42 # JMC_GEN -- files to run through jmc to generate headers #
michael@0 43 # and stubs #
michael@0 44 # (output goes into the _jmc sub-dir) #
michael@0 45 # k) #
michael@0 46 # JNI_GEN -- files to run through javah to generate headers #
michael@0 47 # (output goes into the _jni sub-dir) #
michael@0 48 # #
michael@0 49 #######################################################################
michael@0 50
michael@0 51 #
michael@0 52 # CPU_TAG is now defined in the $(TARGET).mk files
michael@0 53 #
michael@0 54
michael@0 55 ifndef COMPILER_TAG
michael@0 56 ifneq ($(DEFAULT_COMPILER), $(notdir $(firstword $(CC))))
michael@0 57 #
michael@0 58 # Temporary define for the Client; to be removed when binary release is used
michael@0 59 #
michael@0 60 ifdef MOZILLA_CLIENT
michael@0 61 COMPILER_TAG =
michael@0 62 else
michael@0 63 COMPILER_TAG = _$(notdir $(firstword $(CC)))
michael@0 64 endif
michael@0 65 else
michael@0 66 COMPILER_TAG =
michael@0 67 endif
michael@0 68 endif
michael@0 69
michael@0 70 ifeq ($(MKPROG),)
michael@0 71 MKPROG = $(CC)
michael@0 72 endif
michael@0 73
michael@0 74 #
michael@0 75 # This makefile contains rules for building the following kinds of
michael@0 76 # objects:
michael@0 77 # - (1) LIBRARY: a static (archival) library
michael@0 78 # - (2) SHARED_LIBRARY: a shared (dynamic link) library
michael@0 79 # - (3) IMPORT_LIBRARY: an import library, defined in $(OS_TARGET).mk
michael@0 80 # - (4) PROGRAM: an executable binary
michael@0 81 #
michael@0 82 # NOTE: The names of libraries can be generated by simply specifying
michael@0 83 # LIBRARY_NAME (and LIBRARY_VERSION in the case of non-static libraries).
michael@0 84 # LIBRARY and SHARED_LIBRARY may be defined differently in $(OS_TARGET).mk
michael@0 85 #
michael@0 86
michael@0 87 ifdef LIBRARY_NAME
michael@0 88 ifndef LIBRARY
michael@0 89 LIBRARY = $(OBJDIR)/$(LIB_PREFIX)$(LIBRARY_NAME).$(LIB_SUFFIX)
michael@0 90 endif
michael@0 91 ifndef SHARED_LIBRARY
michael@0 92 SHARED_LIBRARY = $(OBJDIR)/$(DLL_PREFIX)$(LIBRARY_NAME)$(LIBRARY_VERSION)$(JDK_DEBUG_SUFFIX).$(DLL_SUFFIX)
michael@0 93 endif
michael@0 94 ifndef MAPFILE_SOURCE
michael@0 95 MAPFILE_SOURCE = $(LIBRARY_NAME).def
michael@0 96 endif
michael@0 97 endif
michael@0 98
michael@0 99 #
michael@0 100 # Common rules used by lots of makefiles...
michael@0 101 #
michael@0 102
michael@0 103 ifdef PROGRAM
michael@0 104 PROGRAM := $(addprefix $(OBJDIR)/, $(PROGRAM)$(JDK_DEBUG_SUFFIX)$(PROG_SUFFIX))
michael@0 105 endif
michael@0 106
michael@0 107 ifdef PROGRAMS
michael@0 108 PROGRAMS := $(addprefix $(OBJDIR)/, $(PROGRAMS:%=%$(JDK_DEBUG_SUFFIX)$(PROG_SUFFIX)))
michael@0 109 endif
michael@0 110
michael@0 111 ifndef TARGETS
michael@0 112 TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(PROGRAM)
michael@0 113 endif
michael@0 114
michael@0 115 ifndef OBJS
michael@0 116 SIMPLE_OBJS = $(JRI_STUB_CFILES) \
michael@0 117 $(addsuffix $(OBJ_SUFFIX), $(JMC_GEN)) \
michael@0 118 $(CSRCS:.c=$(OBJ_SUFFIX)) \
michael@0 119 $(CPPSRCS:.cpp=$(OBJ_SUFFIX)) \
michael@0 120 $(ASFILES:$(ASM_SUFFIX)=$(OBJ_SUFFIX)) \
michael@0 121 $(BUILT_CSRCS:.c=$(OBJ_SUFFIX)) \
michael@0 122 $(BUILT_CPPSRCS:.cpp=$(OBJ_SUFFIX)) \
michael@0 123 $(BUILT_ASFILES:$(ASM_SUFFIX)=$(OBJ_SUFFIX))
michael@0 124 OBJS = $(addprefix $(OBJDIR)/$(PROG_PREFIX), $(SIMPLE_OBJS))
michael@0 125 endif
michael@0 126
michael@0 127 ifndef BUILT_SRCS
michael@0 128 BUILT_SRCS = $(addprefix $(OBJDIR)/$(PROG_PREFIX), \
michael@0 129 $(BUILT_CSRCS) $(BUILT_CPPSRCS) $(BUILT_ASFILES))
michael@0 130 endif
michael@0 131
michael@0 132
michael@0 133 ifeq (,$(filter-out WIN%,$(OS_TARGET)))
michael@0 134 MAKE_OBJDIR = $(INSTALL) -D $(OBJDIR)
michael@0 135 else
michael@0 136 define MAKE_OBJDIR
michael@0 137 if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); fi
michael@0 138 endef
michael@0 139 endif
michael@0 140
michael@0 141 ifndef PACKAGE
michael@0 142 PACKAGE = .
michael@0 143 endif
michael@0 144
michael@0 145 ifdef NSBUILDROOT
michael@0 146 JDK_GEN_DIR = $(SOURCE_XP_DIR)/_gen
michael@0 147 JMC_GEN_DIR = $(SOURCE_XP_DIR)/_jmc
michael@0 148 JNI_GEN_DIR = $(SOURCE_XP_DIR)/_jni
michael@0 149 JRI_GEN_DIR = $(SOURCE_XP_DIR)/_jri
michael@0 150 JDK_STUB_DIR = $(SOURCE_XP_DIR)/_stubs
michael@0 151 else
michael@0 152 JDK_GEN_DIR = _gen
michael@0 153 JMC_GEN_DIR = _jmc
michael@0 154 JNI_GEN_DIR = _jni
michael@0 155 JRI_GEN_DIR = _jri
michael@0 156 JDK_STUB_DIR = _stubs
michael@0 157 endif
michael@0 158
michael@0 159 ALL_TRASH = $(TARGETS) $(OBJS) $(OBJDIR) LOGS TAGS $(GARBAGE) \
michael@0 160 so_locations $(BUILT_SRCS) $(NOSUCHFILE)
michael@0 161
michael@0 162 ifdef NS_USE_JDK
michael@0 163 ALL_TRASH += $(JDK_HEADER_CFILES) $(JDK_STUB_CFILES) \
michael@0 164 $(JMC_HEADERS) $(JMC_STUBS) $(JMC_EXPORT_FILES) \
michael@0 165 $(JNI_HEADERS) \
michael@0 166 $(JRI_HEADER_CFILES) $(JRI_STUB_CFILES) \
michael@0 167 $(JDK_GEN_DIR) $(JMC_GEN_DIR) $(JNI_GEN_DIR) \
michael@0 168 $(JRI_GEN_DIR) $(JDK_STUB_DIR)
michael@0 169
michael@0 170 ifdef JAVA_DESTPATH
michael@0 171 ALL_TRASH += $(wildcard $(JAVA_DESTPATH)/$(PACKAGE)/*.class)
michael@0 172 ifdef JDIRS
michael@0 173 ALL_TRASH += $(addprefix $(JAVA_DESTPATH)/,$(JDIRS))
michael@0 174 endif
michael@0 175 else # !JAVA_DESTPATH
michael@0 176 ALL_TRASH += $(wildcard $(PACKAGE)/*.class) $(JDIRS)
michael@0 177 endif
michael@0 178
michael@0 179 endif #NS_USE_JDK
michael@0 180
michael@0 181 ifdef NSS_BUILD_CONTINUE_ON_ERROR
michael@0 182 # Try to build everything. I.e., don't exit on errors.
michael@0 183 EXIT_ON_ERROR = +e
michael@0 184 IGNORE_ERROR = -
michael@0 185 CLICK_STOPWATCH = date
michael@0 186 else
michael@0 187 EXIT_ON_ERROR = -e
michael@0 188 IGNORE_ERROR =
michael@0 189 CLICK_STOPWATCH = true
michael@0 190 endif
michael@0 191
michael@0 192 ifdef REQUIRES
michael@0 193 MODULE_INCLUDES := $(addprefix -I$(SOURCE_XP_DIR)/public/, $(REQUIRES))
michael@0 194 INCLUDES += $(MODULE_INCLUDES)
michael@0 195 ifeq ($(MODULE), sectools)
michael@0 196 PRIVATE_INCLUDES := $(addprefix -I$(SOURCE_XP_DIR)/private/, $(REQUIRES))
michael@0 197 INCLUDES += $(PRIVATE_INCLUDES)
michael@0 198 endif
michael@0 199 endif
michael@0 200
michael@0 201 ifdef SYSTEM_INCL_DIR
michael@0 202 YOPT = -Y$(SYSTEM_INCL_DIR)
michael@0 203 endif
michael@0 204
michael@0 205 ifdef DIRS
michael@0 206 define SUBMAKE
michael@0 207 +@echo "cd $2; $(MAKE) $1"
michael@0 208 $(IGNORE_ERROR)@$(MAKE) -C $(2) $(1)
michael@0 209 @$(CLICK_STOPWATCH)
michael@0 210
michael@0 211 endef
michael@0 212
michael@0 213 LOOP_OVER_DIRS = $(foreach dir,$(DIRS),$(call SUBMAKE,$@,$(dir)))
michael@0 214 endif
michael@0 215
michael@0 216 MK_RULESET = included

mercurial