1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/nsprpub/config/rules.mk Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,522 @@ 1.4 +#! gmake 1.5 +# 1.6 +# This Source Code Form is subject to the terms of the Mozilla Public 1.7 +# License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 +# file, You can obtain one at http://mozilla.org/MPL/2.0/. 1.9 + 1.10 +################################################################################ 1.11 +# We used to have a 4 pass build process. Now we do everything in one pass. 1.12 +# 1.13 +# export - Create generated headers and stubs. Publish public headers to 1.14 +# dist/<arch>/include. 1.15 +# Create libraries. Publish libraries to dist/<arch>/lib. 1.16 +# Create programs. 1.17 +# 1.18 +# libs - obsolete. Now a synonym of "export". 1.19 +# 1.20 +# all - the default makefile target. Now a synonym of "export". 1.21 +# 1.22 +# install - Install headers, libraries, and programs on the system. 1.23 +# 1.24 +# Parameters to this makefile (set these before including): 1.25 +# 1.26 +# a) 1.27 +# TARGETS -- the target to create 1.28 +# (defaults to $LIBRARY $PROGRAM) 1.29 +# b) 1.30 +# DIRS -- subdirectories for make to recurse on 1.31 +# (the 'all' rule builds $TARGETS $DIRS) 1.32 +# c) 1.33 +# CSRCS -- .c files to compile 1.34 +# (used to define $OBJS) 1.35 +# d) 1.36 +# PROGRAM -- the target program name to create from $OBJS 1.37 +# ($OBJDIR automatically prepended to it) 1.38 +# e) 1.39 +# LIBRARY -- the target library name to create from $OBJS 1.40 +# ($OBJDIR automatically prepended to it) 1.41 +# 1.42 +################################################################################ 1.43 + 1.44 +ifndef topsrcdir 1.45 +topsrcdir=$(MOD_DEPTH) 1.46 +endif 1.47 + 1.48 +ifndef srcdir 1.49 +srcdir=. 1.50 +endif 1.51 + 1.52 +ifndef NSPR_CONFIG_MK 1.53 +include $(topsrcdir)/config/config.mk 1.54 +endif 1.55 + 1.56 +ifdef USE_AUTOCONF 1.57 +ifdef CROSS_COMPILE 1.58 +ifdef INTERNAL_TOOLS 1.59 +CC=$(HOST_CC) 1.60 +CCC=$(HOST_CXX) 1.61 +CFLAGS=$(HOST_CFLAGS) 1.62 +CXXFLAGS=$(HOST_CXXFLAGS) 1.63 +LDFLAGS=$(HOST_LDFLAGS) 1.64 +endif 1.65 +endif 1.66 +endif 1.67 + 1.68 +# 1.69 +# This makefile contains rules for building the following kinds of 1.70 +# libraries: 1.71 +# - LIBRARY: a static (archival) library 1.72 +# - SHARED_LIBRARY: a shared (dynamic link) library 1.73 +# - IMPORT_LIBRARY: an import library, used only on Windows and OS/2 1.74 +# 1.75 +# The names of these libraries can be generated by simply specifying 1.76 +# LIBRARY_NAME and LIBRARY_VERSION. 1.77 +# 1.78 + 1.79 +ifdef LIBRARY_NAME 1.80 +ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH))) 1.81 + 1.82 +# 1.83 +# Win95 and OS/2 require library names conforming to the 8.3 rule. 1.84 +# other platforms do not. 1.85 +# 1.86 +ifeq (,$(filter-out WIN95 WINCE WINMO OS2,$(OS_TARGET))) 1.87 +LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) 1.88 +SHARED_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) 1.89 +IMPORT_LIBRARY = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) 1.90 +SHARED_LIB_PDB = $(OBJDIR)/$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb 1.91 +else 1.92 +LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_s.$(LIB_SUFFIX) 1.93 +SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) 1.94 +IMPORT_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) 1.95 +SHARED_LIB_PDB = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).pdb 1.96 +endif 1.97 + 1.98 +else 1.99 + 1.100 +LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(LIB_SUFFIX) 1.101 +ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) 1.102 +SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION)_shr.a 1.103 +else 1.104 +ifdef MKSHLIB 1.105 +SHARED_LIBRARY = $(OBJDIR)/lib$(LIBRARY_NAME)$(LIBRARY_VERSION).$(DLL_SUFFIX) 1.106 +endif 1.107 +endif 1.108 + 1.109 +endif 1.110 +endif 1.111 + 1.112 +ifndef TARGETS 1.113 +ifeq (,$(filter-out WINNT WINCE OS2,$(OS_ARCH))) 1.114 +TARGETS = $(LIBRARY) $(SHARED_LIBRARY) $(IMPORT_LIBRARY) 1.115 +ifdef MOZ_DEBUG_SYMBOLS 1.116 +ifdef MSC_VER 1.117 +ifneq (,$(filter-out 1100 1200,$(MSC_VER))) 1.118 +TARGETS += $(SHARED_LIB_PDB) 1.119 +endif 1.120 +endif 1.121 +endif 1.122 +else 1.123 +TARGETS = $(LIBRARY) $(SHARED_LIBRARY) 1.124 +endif 1.125 +endif 1.126 + 1.127 +# 1.128 +# OBJS is the list of object files. It can be constructed by 1.129 +# specifying CSRCS (list of C source files) and ASFILES (list 1.130 +# of assembly language source files). 1.131 +# 1.132 + 1.133 +ifndef OBJS 1.134 +OBJS = $(addprefix $(OBJDIR)/,$(CSRCS:.c=.$(OBJ_SUFFIX))) \ 1.135 + $(addprefix $(OBJDIR)/,$(ASFILES:.$(ASM_SUFFIX)=.$(OBJ_SUFFIX))) 1.136 +endif 1.137 + 1.138 +ALL_TRASH = $(TARGETS) $(OBJS) $(RES) $(filter-out . .., $(OBJDIR)) LOGS TAGS $(GARBAGE) \ 1.139 + $(NOSUCHFILE) \ 1.140 + $(OBJS:.$(OBJ_SUFFIX)=.i_o) \ 1.141 + so_locations 1.142 + 1.143 +ifndef RELEASE_LIBS_DEST 1.144 +RELEASE_LIBS_DEST = $(RELEASE_LIB_DIR) 1.145 +endif 1.146 + 1.147 +define MAKE_IN_DIR 1.148 + $(MAKE) -C $(dir) $@ 1.149 + 1.150 +endef # do not remove the blank line! 1.151 + 1.152 +ifdef DIRS 1.153 +LOOP_OVER_DIRS = $(foreach dir,$(DIRS),$(MAKE_IN_DIR)) 1.154 +endif 1.155 + 1.156 +################################################################################ 1.157 + 1.158 +all:: export 1.159 + 1.160 +export:: 1.161 + +$(LOOP_OVER_DIRS) 1.162 + 1.163 +libs:: export 1.164 + 1.165 +clean:: 1.166 + rm -rf $(OBJS) $(RES) so_locations $(NOSUCHFILE) $(GARBAGE) 1.167 + +$(LOOP_OVER_DIRS) 1.168 + 1.169 +clobber:: 1.170 + rm -rf $(OBJS) $(RES) $(TARGETS) $(filter-out . ..,$(OBJDIR)) $(GARBAGE) so_locations $(NOSUCHFILE) 1.171 + +$(LOOP_OVER_DIRS) 1.172 + 1.173 +realclean clobber_all:: 1.174 + rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) 1.175 + +$(LOOP_OVER_DIRS) 1.176 + 1.177 +distclean:: 1.178 + rm -rf $(wildcard *.OBJ *.OBJD) dist $(ALL_TRASH) $(DIST_GARBAGE) 1.179 + +$(LOOP_OVER_DIRS) 1.180 + 1.181 +install:: $(RELEASE_BINS) $(RELEASE_HEADERS) $(RELEASE_LIBS) 1.182 +ifdef RELEASE_BINS 1.183 + $(NSINSTALL) -t -m 0755 $(RELEASE_BINS) $(DESTDIR)$(bindir) 1.184 +endif 1.185 +ifdef RELEASE_HEADERS 1.186 + $(NSINSTALL) -t -m 0644 $(RELEASE_HEADERS) $(DESTDIR)$(includedir)/$(include_subdir) 1.187 +endif 1.188 +ifdef RELEASE_LIBS 1.189 + $(NSINSTALL) -t -m 0755 $(RELEASE_LIBS) $(DESTDIR)$(libdir)/$(lib_subdir) 1.190 +endif 1.191 + +$(LOOP_OVER_DIRS) 1.192 + 1.193 +release:: export 1.194 +ifdef RELEASE_BINS 1.195 + @echo "Copying executable programs and scripts to release directory" 1.196 + @if test -z "$(BUILD_NUMBER)"; then \ 1.197 + echo "BUILD_NUMBER must be defined"; \ 1.198 + false; \ 1.199 + else \ 1.200 + true; \ 1.201 + fi 1.202 + @if test ! -d $(RELEASE_BIN_DIR); then \ 1.203 + rm -rf $(RELEASE_BIN_DIR); \ 1.204 + $(NSINSTALL) -D $(RELEASE_BIN_DIR);\ 1.205 + else \ 1.206 + true; \ 1.207 + fi 1.208 + cp $(RELEASE_BINS) $(RELEASE_BIN_DIR) 1.209 +endif 1.210 +ifdef RELEASE_LIBS 1.211 + @echo "Copying libraries to release directory" 1.212 + @if test -z "$(BUILD_NUMBER)"; then \ 1.213 + echo "BUILD_NUMBER must be defined"; \ 1.214 + false; \ 1.215 + else \ 1.216 + true; \ 1.217 + fi 1.218 + @if test ! -d $(RELEASE_LIBS_DEST); then \ 1.219 + rm -rf $(RELEASE_LIBS_DEST); \ 1.220 + $(NSINSTALL) -D $(RELEASE_LIBS_DEST);\ 1.221 + else \ 1.222 + true; \ 1.223 + fi 1.224 + cp $(RELEASE_LIBS) $(RELEASE_LIBS_DEST) 1.225 +endif 1.226 +ifdef RELEASE_HEADERS 1.227 + @echo "Copying header files to release directory" 1.228 + @if test -z "$(BUILD_NUMBER)"; then \ 1.229 + echo "BUILD_NUMBER must be defined"; \ 1.230 + false; \ 1.231 + else \ 1.232 + true; \ 1.233 + fi 1.234 + @if test ! -d $(RELEASE_HEADERS_DEST); then \ 1.235 + rm -rf $(RELEASE_HEADERS_DEST); \ 1.236 + $(NSINSTALL) -D $(RELEASE_HEADERS_DEST);\ 1.237 + else \ 1.238 + true; \ 1.239 + fi 1.240 + cp $(RELEASE_HEADERS) $(RELEASE_HEADERS_DEST) 1.241 +endif 1.242 + +$(LOOP_OVER_DIRS) 1.243 + 1.244 +alltags: 1.245 + rm -f TAGS tags 1.246 + find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs etags -a 1.247 + find . -name dist -prune -o \( -name '*.[hc]' -o -name '*.cp' -o -name '*.cpp' \) -print | xargs ctags -a 1.248 + 1.249 +$(NFSPWD): 1.250 + cd $(@D); $(MAKE) $(@F) 1.251 + 1.252 +$(PROGRAM): $(OBJS) 1.253 + @$(MAKE_OBJDIR) 1.254 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) 1.255 +ifdef MOZ_PROFILE_USE 1.256 +# In the second pass, we need to merge the pgc files into the pgd file. 1.257 +# The compiler would do this for us automatically if they were in the right 1.258 +# place, but they're in dist/bin. 1.259 + python $(topsrcdir)/build/win32/pgomerge.py \ 1.260 + $(notdir $(PROGRAM:.exe=)) $(DIST)/bin 1.261 +endif # MOZ_PROFILE_USE 1.262 + $(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS) 1.263 +ifdef MT 1.264 + @if test -f $@.manifest; then \ 1.265 + $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;1; \ 1.266 + rm -f $@.manifest; \ 1.267 + fi 1.268 +endif # MSVC with manifest tool 1.269 +ifdef MOZ_PROFILE_GENERATE 1.270 +# touch it a few seconds into the future to work around FAT's 1.271 +# 2-second granularity 1.272 + touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink 1.273 +endif # MOZ_PROFILE_GENERATE 1.274 +else # WINNT && !GCC 1.275 + $(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS) $(WRAP_LDFLAGS) 1.276 +endif # WINNT && !GCC 1.277 +ifdef ENABLE_STRIP 1.278 + $(STRIP) $@ 1.279 +endif 1.280 + 1.281 +$(LIBRARY): $(OBJS) 1.282 + @$(MAKE_OBJDIR) 1.283 + rm -f $@ 1.284 + $(AR) $(AR_FLAGS) $(OBJS) $(AR_EXTRA_ARGS) 1.285 + $(RANLIB) $@ 1.286 + 1.287 +ifeq ($(OS_TARGET), OS2) 1.288 +$(IMPORT_LIBRARY): $(MAPFILE) 1.289 + rm -f $@ 1.290 + $(IMPLIB) $@ $(MAPFILE) 1.291 +else 1.292 +ifeq (,$(filter-out WIN95 WINCE WINMO,$(OS_TARGET))) 1.293 +# PDBs and import libraries need to depend on the shared library to 1.294 +# order dependencies properly. 1.295 +$(IMPORT_LIBRARY): $(SHARED_LIBRARY) 1.296 +$(SHARED_LIB_PDB): $(SHARED_LIBRARY) 1.297 +endif 1.298 +endif 1.299 + 1.300 +$(SHARED_LIBRARY): $(OBJS) $(RES) $(MAPFILE) 1.301 + @$(MAKE_OBJDIR) 1.302 + rm -f $@ 1.303 +ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1) 1.304 + echo "#!" > $(OBJDIR)/lib$(LIBRARY_NAME)_syms 1.305 + nm -B -C -g $(OBJS) \ 1.306 + | awk '/ [T,D] / {print $$3}' \ 1.307 + | sed -e 's/^\.//' \ 1.308 + | sort -u >> $(OBJDIR)/lib$(LIBRARY_NAME)_syms 1.309 + $(LD) $(XCFLAGS) -o $@ $(OBJS) -bE:$(OBJDIR)/lib$(LIBRARY_NAME)_syms \ 1.310 + -bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS) 1.311 +else # AIX 4.1 1.312 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) 1.313 +ifdef MOZ_PROFILE_USE 1.314 + python $(topsrcdir)/build/win32/pgomerge.py \ 1.315 + $(notdir $(SHARED_LIBRARY:.$(DLL_SUFFIX)=)) $(DIST)/bin 1.316 +endif # MOZ_PROFILE_USE 1.317 + $(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES) 1.318 +ifdef MT 1.319 + @if test -f $@.manifest; then \ 1.320 + $(MT) -NOLOGO -MANIFEST $@.manifest -OUTPUTRESOURCE:$@\;2; \ 1.321 + rm -f $@.manifest; \ 1.322 + fi 1.323 +endif # MSVC with manifest tool 1.324 +ifdef MOZ_PROFILE_GENERATE 1.325 + touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink 1.326 +endif # MOZ_PROFILE_GENERATE 1.327 +else # WINNT && !GCC 1.328 + $(MKSHLIB) $(OBJS) $(RES) $(LDFLAGS) $(WRAP_LDFLAGS) $(EXTRA_LIBS) 1.329 +endif # WINNT && !GCC 1.330 +endif # AIX 4.1 1.331 +ifdef ENABLE_STRIP 1.332 + $(STRIP) $@ 1.333 +endif 1.334 + 1.335 +################################################################################ 1.336 + 1.337 +ifdef MOZ_PROFILE_USE 1.338 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) 1.339 +# When building with PGO, we have to make sure to re-link 1.340 +# in the MOZ_PROFILE_USE phase if we linked in the 1.341 +# MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink 1.342 +# file in the link rule in the GENERATE phase to indicate 1.343 +# that we need a relink. 1.344 +$(SHARED_LIBRARY): pgo.relink 1.345 + 1.346 +$(PROGRAM): pgo.relink 1.347 + 1.348 +endif # WINNT && !GCC 1.349 +endif # MOZ_PROFILE_USE 1.350 + 1.351 +ifneq (,$(MOZ_PROFILE_GENERATE)$(MOZ_PROFILE_USE)) 1.352 +ifdef NS_USE_GCC 1.353 +# Force rebuilding libraries and programs in both passes because each 1.354 +# pass uses different object files. 1.355 +$(PROGRAM) $(SHARED_LIBRARY) $(LIBRARY): FORCE 1.356 +.PHONY: FORCE 1.357 +endif 1.358 +endif 1.359 + 1.360 +################################################################################ 1.361 + 1.362 +ifdef MOZ_PROFILE_GENERATE 1.363 +# Clean up profiling data during PROFILE_GENERATE phase 1.364 +export:: 1.365 +ifeq ($(OS_ARCH)_$(NS_USE_GCC), WINNT_) 1.366 + $(foreach pgd,$(wildcard *.pgd),pgomgr -clear $(pgd);) 1.367 +else 1.368 +ifdef NS_USE_GCC 1.369 + -$(RM) *.gcda 1.370 +endif 1.371 +endif 1.372 +endif 1.373 + 1.374 +################################################################################ 1.375 + 1.376 +ifeq ($(OS_ARCH),WINNT) 1.377 +$(RES): $(RESNAME) 1.378 + @$(MAKE_OBJDIR) 1.379 +# The resource compiler does not understand the -U option. 1.380 +ifdef NS_USE_GCC 1.381 + $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $< 1.382 +else 1.383 + $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $< 1.384 +endif # GCC 1.385 + @echo $(RES) finished 1.386 +endif 1.387 + 1.388 +$(MAPFILE): $(LIBRARY_NAME).def 1.389 + @$(MAKE_OBJDIR) 1.390 +ifeq ($(OS_ARCH),SunOS) 1.391 + grep -v ';-' $< | \ 1.392 + sed -e 's,;+,,' -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,;,' > $@ 1.393 +endif 1.394 +ifeq ($(OS_ARCH),OS2) 1.395 + echo LIBRARY $(LIBRARY_NAME)$(LIBRARY_VERSION) INITINSTANCE TERMINSTANCE > $@ 1.396 + echo PROTMODE >> $@ 1.397 + echo CODE LOADONCALL MOVEABLE DISCARDABLE >> $@ 1.398 + echo DATA PRELOAD MOVEABLE MULTIPLE NONSHARED >> $@ 1.399 + echo EXPORTS >> $@ 1.400 + grep -v ';+' $< | grep -v ';-' | \ 1.401 + sed -e 's; DATA ;;' -e 's,;;,,' -e 's,;.*,,' -e 's,\([\t ]*\),\1_,' | \ 1.402 + awk 'BEGIN {ord=1;} { print($$0 " @" ord " RESIDENTNAME"); ord++;}' >> $@ 1.403 + $(ADD_TO_DEF_FILE) 1.404 +endif 1.405 + 1.406 +# 1.407 +# Translate source filenames to absolute paths. This is required for 1.408 +# debuggers under Windows and OS/2 to find source files automatically. 1.409 +# 1.410 + 1.411 +ifeq (,$(filter-out AIX OS2,$(OS_ARCH))) 1.412 +NEED_ABSOLUTE_PATH = 1 1.413 +endif 1.414 + 1.415 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) 1.416 +NEED_ABSOLUTE_PATH = 1 1.417 +endif 1.418 + 1.419 +ifdef NEED_ABSOLUTE_PATH 1.420 +# The quotes allow absolute paths to contain spaces. 1.421 +pr_abspath = "$(if $(findstring :,$(1)),$(1),$(if $(filter /%,$(1)),$(1),$(CURDIR)/$(1)))" 1.422 +endif 1.423 + 1.424 +$(OBJDIR)/%.$(OBJ_SUFFIX): %.cpp 1.425 + @$(MAKE_OBJDIR) 1.426 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) 1.427 + $(CCC) -Fo$@ -c $(CCCFLAGS) $(call pr_abspath,$<) 1.428 +else 1.429 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINCE) 1.430 + $(CCC) -Fo$@ -c $(CCCFLAGS) $< 1.431 +else 1.432 +ifdef NEED_ABSOLUTE_PATH 1.433 + $(CCC) -o $@ -c $(CCCFLAGS) $(call pr_abspath,$<) 1.434 +else 1.435 + $(CCC) -o $@ -c $(CCCFLAGS) $< 1.436 +endif 1.437 +endif 1.438 +endif 1.439 + 1.440 +WCCFLAGS1 = $(subst /,\\,$(CFLAGS)) 1.441 +WCCFLAGS2 = $(subst -I,-i=,$(WCCFLAGS1)) 1.442 +WCCFLAGS3 = $(subst -D,-d,$(WCCFLAGS2)) 1.443 +$(OBJDIR)/%.$(OBJ_SUFFIX): %.c 1.444 + @$(MAKE_OBJDIR) 1.445 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT) 1.446 + $(CC) -Fo$@ -c $(CFLAGS) $(call pr_abspath,$<) 1.447 +else 1.448 +ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINCE) 1.449 + $(CC) -Fo$@ -c $(CFLAGS) $< 1.450 +else 1.451 +ifdef NEED_ABSOLUTE_PATH 1.452 + $(CC) -o $@ -c $(CFLAGS) $(call pr_abspath,$<) 1.453 +else 1.454 + $(CC) -o $@ -c $(CFLAGS) $< 1.455 +endif 1.456 +endif 1.457 +endif 1.458 + 1.459 + 1.460 +$(OBJDIR)/%.$(OBJ_SUFFIX): %.s 1.461 + @$(MAKE_OBJDIR) 1.462 + $(AS) -o $@ $(ASFLAGS) -c $< 1.463 + 1.464 +%.i: %.c 1.465 + $(CC) -C -E $(CFLAGS) $< > $*.i 1.466 + 1.467 +%: %.pl 1.468 + rm -f $@; cp $< $@; chmod +x $@ 1.469 + 1.470 +# 1.471 +# HACK ALERT 1.472 +# 1.473 +# The only purpose of this rule is to pass Mozilla's Tinderbox depend 1.474 +# builds (http://tinderbox.mozilla.org/showbuilds.cgi). Mozilla's 1.475 +# Tinderbox builds NSPR continuously as part of the Mozilla client. 1.476 +# Because NSPR's make depend is not implemented, whenever we change 1.477 +# an NSPR header file, the depend build does not recompile the NSPR 1.478 +# files that depend on the header. 1.479 +# 1.480 +# This rule makes all the objects depend on a dummy header file. 1.481 +# Touch this dummy header file to force the depend build to recompile 1.482 +# everything. 1.483 +# 1.484 +# This rule should be removed when make depend is implemented. 1.485 +# 1.486 + 1.487 +DUMMY_DEPEND_H = $(topsrcdir)/config/prdepend.h 1.488 + 1.489 +$(filter $(OBJDIR)/%.$(OBJ_SUFFIX),$(OBJS)): $(OBJDIR)/%.$(OBJ_SUFFIX): $(DUMMY_DEPEND_H) 1.490 + 1.491 +# END OF HACK 1.492 + 1.493 +################################################################################ 1.494 +# Special gmake rules. 1.495 +################################################################################ 1.496 + 1.497 +# 1.498 +# Disallow parallel builds with MSVC < 8 since it can't open the PDB file in 1.499 +# parallel. 1.500 +# 1.501 +ifeq (,$(filter-out 1200 1300 1310,$(MSC_VER))) 1.502 +.NOTPARALLEL: 1.503 +endif 1.504 + 1.505 +# 1.506 +# Re-define the list of default suffixes, so gmake won't have to churn through 1.507 +# hundreds of built-in suffix rules for stuff we don't need. 1.508 +# 1.509 +.SUFFIXES: 1.510 +.SUFFIXES: .a .$(OBJ_SUFFIX) .c .cpp .s .h .i .pl 1.511 + 1.512 +# 1.513 +# Fake targets. Always run these rules, even if a file/directory with that 1.514 +# name already exists. 1.515 +# 1.516 +.PHONY: all alltags clean export install libs realclean release 1.517 + 1.518 +# 1.519 +# List the target pattern of an implicit rule as a dependency of the 1.520 +# special target .PRECIOUS to preserve intermediate files made by 1.521 +# implicit rules whose target patterns match that file's name. 1.522 +# (See GNU Make documentation, Edition 0.51, May 1996, Sec. 10.4, 1.523 +# p. 107.) 1.524 +# 1.525 +.PRECIOUS: $(OBJDIR)/%.$(OBJ_SUFFIX)